Difference between revisions of "Tips on using CSS with XML/TEI"
(started page) |
m (small entity fix) |
||
Line 10: | Line 10: | ||
<code><pre>div[type="chapter"] {}</pre></code> | <code><pre>div[type="chapter"] {}</pre></code> | ||
− | Another important adjustment to make is that while X/HTML defines a default display behavior (e.g., | + | Another important adjustment to make is that while X/HTML defines a default display behavior (e.g., <p> in HTML is block while <span> in HTML is inline), other XML is more generic and forces you to define which elements out to be defined as block (they will otherwise be rendered inline). |
For example, for TEI, you might define the following: | For example, for TEI, you might define the following: |
Revision as of 07:47, 20 February 2008
For those who are fairly familiar with using CSS with HTML or XHTML, one might be familiar enough with how to define colors, etc., but still remain unaware of how to make a simple stylesheet.
Since one cannot use @class as in X/HTML (though some processors might be able to use xml:id to be the target of the # id selector), one first ought to be familiar with the generic attribute selectors.
For example,
<div type="chapter">...
Could be styled with:
div[type="chapter"] {}
Another important adjustment to make is that while X/HTML defines a default display behavior (e.g., <p> in HTML is block while <span> in HTML is inline), other XML is more generic and forces you to define which elements out to be defined as block (they will otherwise be rendered inline).
For example, for TEI, you might define the following:
p, div, div1, div2, div3 {display:block}
You can also specify inline elements by using display:inline