Graphics Programs Reference
In-Depth Information
Figure 2-23: Passing markup through in the raw.
68
Figure 2-24: Inserting a character with an escaped code.
In theory, you could also insert any Unicode character into your document by typing the
characters directly into your CSS and then serving up the style sheet with full Unicode
encoding. However, this may run into problems with servers that aren't coni gured to send
out CSS as anything but ASCII. If you can overcome those kinds of problems, then you can
ignore the escaped-hex approach and just use the characters directly. Test thoroughly, though,
especially in older browsers that may not handle Unicode gracefully.
h e reason :before and :after are pseudo-elements is that they insert the element as
though it were enclosed in an element. h is pseudo-element is placed either at the very
beginning or end of the element's content, depending on which pseudo-element you used.
You can style it much as you would a span in the same place.
You can do a lot of interesting things with generated content, but you have to be careful about
what you generate. What happens to your page if CSS doesn't load or isn't supported, as on
some mobile devices? If you're using generated content to insert things that are crucial to the
understanding of the page, then you could have real trouble if the content isn't generated.
h us, it's strongly recommended that you use only generated content in the service of what's
called progressive enhancement, where you use advanced features to add enhancements that
the page can live without.
 
Search WWH ::




Custom Search