HTML and CSS Reference
In-Depth Information
abbr[title]:after {
content: " (" attr(title) ")";
}
But, this means even links that are just linking to another location in the same page
or are used for JavaScript actions (with the javascript: prefix) would render the
same way! So, we would need to make sure we do not do this for these links.
For this, we use the attribute selector that allows us to select elements that have
properties that begin, end, or contain certain values. By using the selector
a[href^="javascript:"]:after , we ensure we are only selecting the :after
pseudo-elements of links that have the attribute href , whose value starts with the
string javascript: .
Similarly, we also select all links which have the href attribute that begin with the #
character, as that means such links are inline links linking to another location within
the same page.
We then make sure we render no content for pseudo-elements within these links.
The rule then looks like the following code snippet:
.ir a:after,
a[href^="javascript:"]:after,
a[href^="#"]:after {
content: "";
}
Do note that these rules are not available for IE6 and if it is highly necessary to offer
this functionality in IE6, you would like to use JavaScript that provides this.
Rendering all code and quotes within one page
It sometimes happens that your printed page would contain quotes or code, and as
a reader, it is annoying to keep referring back to a previous page when the code (or
the quote) could all have been within one page without any break. For this, we can
use the CSS page-break-inside property that allows you to tell the browser if
Search WWH ::




Custom Search