Creating Block Elements

You might have noticed the property-value pair display: block in the rules in ch09_02.css:

 TITLE {display: block; font-size: 24pt; font-weight: bold;  text-align: center; text-decoration: underline} AUTHOR {display: block; font-size: 18pt; font-weight: bold; text-align: center} SECTION {display: block; font-size: 16pt; font-weight: bold; text-align: center; font-style: italic} P {display: block; margin-top: 10} 

In particular, display: block specifies that the element in question get its own block, which means that these elements start on a new line and that the element following them starts on a new line as well. That is, you use display: block to create block-level elements.

The display property is more important in XML stylesheets than it is in HTML stylesheets because HTML styles such as <H1> already inherit the display: block style. To create elements that you want set off from other elements, such as paragraphs and headers, use display: block . (For example, using this style specification is the reason the <TITLE> , <AUTHOR> , and <SECTION> elements appear on their own lines in Figure 9-2.)

Specifying Width and Height

You can specify the width and height of a block using the width and height properties; see the topic "Displaying Images," later in this chapter, for more details.



Real World XML
Real World XML (2nd Edition)
ISBN: 0735712867
EAN: 2147483647
Year: 2005
Pages: 440
Authors: Steve Holzner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net