HTML and CSS Reference
In-Depth Information
::before and ::after
The pseudo-elements ::before and ::after represent placeholders for
content before and after an element's existing content. {
content: "(?)";
color: red;
background: yellow;
} {
content: url(images/right_arrow.png);
<p>Here is some text that contains a link to the <a class=
"help" href="">help page</a>
and a link to the <a class="next" href="
next.html">next page</a></p>
The previous code adds an arrow image after any link to a “next” document
and then a question mark after any “help” link, as shown in Figure 10.2 .
These two hints, or similar additions using the content property, are
examples of where presentational hints introduced through design would
be different from content that would normally be in the HTML source.
Figure 10.2 Example of generated content added after links with different
class attributes.
note The generated content is added to the content of the selected elements.
They are styled as though they are content in the original HTML tag, and
for links the added content is clickable, just like the rest of the link text is.
Search WWH ::

Custom Search