166 CHAPTER 5 DISPLAYING XML USING CSS (Affordable web hosting)
166 CHAPTER 5 DISPLAYING XML USING CSS As you can imagine, referencing attributes with pseudo-elements is very helpful for displaying content, although you re somewhat limited with this approach because: You have limited formatting control over the attribute values: While you can display the content in either a block or inline box, or change the color, font-style, and font-weight properties, you re not able to use the text in a structure like a table. You can only present the content of two attributes in any element: You re limited to using the :beforeand :after pseudo-elements. The conclusion you should draw is that while CSS is capable of rendering XML documents, it s limited in its ability to display content from attributes. Summary In this chapter, you ve seen many different ways to display XML content in a web browser using CSS. Because an XML document is focused on content, you can only display elements by using an associated CSS declaration for each one. This is more labor-intensive than using CSS with XHTML, where the browser already understands how to render certain structural elements, such as tables. In this chapter, you learned how to use Element type selectors without class or idattributes The box model to display element content using three positioning schemes: normal flow, floating boxes, and absolute positioning CSS declarations to display tabular data Floating boxes to create more complex table layouts XLinks to create links between documents CSS backgroundor background-image properties to force the display of an image in XML documents The :before and :afterpseudo-classes to display images and text in addition to XML document content The :before and :afterpseudo-classes to display attribute content Despite the flexibility of CSS, it still creates limitations when used to style XML documents directly in a web browser. The most important limitation is that support for CSS2 is mixed across the major web browsers.
In case you need quality webspace to host and run your web applications, try our personal web hosting services.