<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://w.arbores.tech/w/index.php?action=history&amp;feed=atom&amp;title=CSS_for_XML_tutorial</id>
	<title>CSS for XML tutorial - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://w.arbores.tech/w/index.php?action=history&amp;feed=atom&amp;title=CSS_for_XML_tutorial"/>
	<link rel="alternate" type="text/html" href="http://w.arbores.tech/w/index.php?title=CSS_for_XML_tutorial&amp;action=history"/>
	<updated>2026-05-27T07:19:22Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.11</generator>
	<entry>
		<id>http://w.arbores.tech/w/index.php?title=CSS_for_XML_tutorial&amp;diff=16135&amp;oldid=prev</id>
		<title>Daniel K. Schneider: Text replacement - &quot;$&quot; to &quot;
{{edutechwiki}}&quot;</title>
		<link rel="alternate" type="text/html" href="http://w.arbores.tech/w/index.php?title=CSS_for_XML_tutorial&amp;diff=16135&amp;oldid=prev"/>
		<updated>2021-04-10T00:18:28Z</updated>

		<summary type="html">&lt;p&gt;Text replacement - &amp;quot;$&amp;quot; to &amp;quot; {{edutechwiki}}&amp;quot;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 02:18, 10 April 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l506&quot;&gt;Line 506:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 506:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category: XML]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category: XML]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category: CSS]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category: CSS]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{edutechwiki}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Daniel K. Schneider</name></author>
	</entry>
	<entry>
		<id>http://w.arbores.tech/w/index.php?title=CSS_for_XML_tutorial&amp;diff=15479&amp;oldid=prev</id>
		<title>Daniel K. Schneider: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="http://w.arbores.tech/w/index.php?title=CSS_for_XML_tutorial&amp;diff=15479&amp;oldid=prev"/>
		<updated>2021-04-09T22:47:58Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 00:47, 10 April 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Daniel K. Schneider</name></author>
	</entry>
	<entry>
		<id>http://w.arbores.tech/w/index.php?title=CSS_for_XML_tutorial&amp;diff=15478&amp;oldid=prev</id>
		<title>Daniel K. Schneider: /* Use of XHTML tags */</title>
		<link rel="alternate" type="text/html" href="http://w.arbores.tech/w/index.php?title=CSS_for_XML_tutorial&amp;diff=15478&amp;oldid=prev"/>
		<updated>2017-03-23T00:18:20Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Use of XHTML tags&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Incomplete}}&lt;br /&gt;
{{web technology tutorial|Intermediary}}&lt;br /&gt;
&amp;lt;!-- &amp;lt;pageby nominor=&amp;quot;false&amp;quot; comments=&amp;quot;false&amp;quot;/&amp;gt; --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;tut_goals&amp;quot;&amp;gt;&lt;br /&gt;
; Learning goals&lt;br /&gt;
* Learn how to use CSS with XML tags&lt;br /&gt;
; Prerequisites&lt;br /&gt;
* [[CSS tutorial]]&lt;br /&gt;
* [[XML]], in particular [[Editing XML tutorial]]&lt;br /&gt;
; Moving on&lt;br /&gt;
* [[CSS positioning tutorial]] (or another advanced CSS topic)&lt;br /&gt;
* [[XSLT Tutorial - Basics]]&lt;br /&gt;
; Level and target population&lt;br /&gt;
* People who like to publish documents with XML markup. CSS for XML is not difficult, but you need to understand [[XML]] of course.&lt;br /&gt;
; Remarks&lt;br /&gt;
* I may add some more stuff later, but rather suggest to translate XML contents to HTML with [[XSLT]]. The XSLT strategy works perfectly well in all popular browsers. It&amp;#039;s possible since IE 5.5 (last century) ! Today, only really exotic or small device browsers may not understand XSLT.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using CSS with XML ==&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s assume that you directly want to render XML contents in a browser. This content may be text-centric XML that you created yourself, contents using a [[document standard]], contents that are pulled out of a database or that are obtained through a web service, e.g. a simple RSS news feed. In most cases, you would use [[XSLT]] for styling, i.e. translate XML to HTML or another markup language. However, using CSS is easier and can do a perfect job for &amp;#039;&amp;#039;&amp;#039;some&amp;#039;&amp;#039;&amp;#039; text-centric contents.&lt;br /&gt;
&lt;br /&gt;
CSS for XML is in no way different from CSS for HTML, but you need a browser that implements most of CSS 2 (all modern browsers do).&lt;br /&gt;
&lt;br /&gt;
The only practical difference is that HTML includes default style for each element, e.g. a &amp;quot;h1&amp;quot; title would show in a big font and add space above and below. An XML element like &amp;quot;h1&amp;quot; or &amp;quot;header1&amp;quot; would not show at all. XML elements &amp;#039;&amp;#039;&amp;#039;don&amp;#039;t have any default styling&amp;#039;&amp;#039;&amp;#039;. In other words, you will have to define properties for &amp;#039;&amp;#039;&amp;#039;each&amp;#039;&amp;#039;&amp;#039; of your elements. Since CSS implements cascading, you may define defaults for the root elements, or else use the &amp;quot;*&amp;quot; selector.&lt;br /&gt;
&lt;br /&gt;
CSS sometimes is used to make [[XML editor|XML editing]] easier. I.e. the Schema author would produce a CSS that is then used to create a sort of WYSYWIG editing interface. With respect to this functionality, XSLT cannot replace CSS as a rendering solution.&lt;br /&gt;
&lt;br /&gt;
=== Association of a style sheet ===&lt;br /&gt;
&lt;br /&gt;
CSS stylesheets are associated with the following processing instruction. Please note that this is different from HTML and XHTML ! &lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;?xml-stylesheet type=&amp;quot;text/css&amp;quot; href=&amp;quot;some_name.css&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;?xml-stylesheet href=&amp;quot;stepbystep.css&amp;quot; type=&amp;quot;text/css&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE Stepbystep SYSTEM &amp;quot;stepbystep-ex.dtd&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Stepbystep xmlns:xlink=&amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;Doctitle&amp;gt;Instructions &amp;lt;/Doctitle&amp;gt;&lt;br /&gt;
  .....&lt;br /&gt;
 &amp;lt;/Stepbystep&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic steps in defining a CSS style sheet for XML ===&lt;br /&gt;
When defining style rules for XML elements, you should do the following.&lt;br /&gt;
# Define default rendering of text elements, e.g. font-size and font-family&lt;br /&gt;
# Define for each element if it is a block, inline or list element, using the &amp;lt;code&amp;gt;display&amp;lt;/code&amp;gt; attribute.&lt;br /&gt;
# Fine tune, e.g. identify titles and make them bigger&lt;br /&gt;
&lt;br /&gt;
Here is a little example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;CSS&amp;quot;&amp;gt;&lt;br /&gt;
/* 1) ---- Definitions that apply to the whole hierarchy */&lt;br /&gt;
page { font-family:Times; line-height:1.5;}&lt;br /&gt;
page { margin-top:3cm; margin-left:3cm; margin-right:3cm; }&lt;br /&gt;
&lt;br /&gt;
/* 2) ---- title and para are &amp;quot;block&amp;quot; elements with a small margin */&lt;br /&gt;
title, para {display: block; margin: 0.5em;}&lt;br /&gt;
&lt;br /&gt;
/* Titles are a bit taller than default size */&lt;br /&gt;
title {font-size: 1.5em;}&lt;br /&gt;
&lt;br /&gt;
/* Item are list-item of type bullet */&lt;br /&gt;
item {display: list-item;list-style-type: bullet;}&lt;br /&gt;
&lt;br /&gt;
/* strong is an inline element, we render these in italic and blue  */&lt;br /&gt;
strong {display: inline; font-style: italic; color: rgb(000,000,128);}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A corresponding XML document for this example can be found towards the end of this page.&lt;br /&gt;
&lt;br /&gt;
Below, we explain the use of CSS for XML mostly by example. All example XML and CSS files can be found in the &amp;quot;http://tecfa.unige.ch/guides/xml/examples/css/&amp;quot; directory.&lt;br /&gt;
&lt;br /&gt;
== CSS 2 selectors ==&lt;br /&gt;
Firstly, let&amp;#039;s recall how CSS works. A CSS style sheet is a set of &amp;#039;&amp;#039;&amp;#039;rules&amp;#039;&amp;#039;&amp;#039; (also called rule sets) that describe how to render XML or HTML elements. Each rule has two parts:&lt;br /&gt;
# The &amp;#039;&amp;#039;&amp;#039;selector&amp;#039;&amp;#039;&amp;#039; (before the curly braces) defines to which elements a rule applies&lt;br /&gt;
# The &amp;#039;&amp;#039;&amp;#039;declaration block&amp;#039;&amp;#039;&amp;#039; (inside the curly braces) defines rendering, i.e. values of CSS properties&lt;br /&gt;
The syntax can be summarized as follows:&lt;br /&gt;
   selector { property:value; property:value; .... }&lt;br /&gt;
* Each declaration block includes at least a property name and a value, separated by a colon (:)&lt;br /&gt;
* Each &amp;#039;&amp;#039;property&amp;#039;&amp;#039;:&amp;#039;&amp;#039;value&amp;#039;&amp;#039; pair must be separated by a semi-colon (;)&lt;br /&gt;
CSS 2 selectors are introduced in the [[CSS tutorial]]. If you are not familiar with CSS properties, read that tutorial (or equivalent) and come back once you understand the basics.&lt;br /&gt;
&lt;br /&gt;
Below we will recall CSS2 selectors, except that example tags are random XML elements and not HTML tags. A selector identifies the element(s) that we will style with properties. CSS 2 selectors work in the same way for HTML, XHTML, HTML5 and any text-centric XML.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Selection of an element (mostly you will use this)&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
: element&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
 Step {&lt;br /&gt;
    display: list-item;&lt;br /&gt;
    list-style-type: decimal;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;selection of a child element&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
:  mother_element  &amp;gt; child_element&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
 Step &amp;gt; Title { .... }&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;selection of descendant element (child, great-child, etc.)&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
:  mother_element element&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
 Step Title { .... }&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Combinations&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
 DIV OL&amp;gt;LI P&lt;br /&gt;
&lt;br /&gt;
: Means all &amp;quot;P&amp;quot;s that are somewhere within an LI of an OL list that sits somewhere within a DIV&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;selection of siblings (elements next to each other sharing the same parent)&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
:  sister_element + sister_element&lt;br /&gt;
&lt;br /&gt;
example:&lt;br /&gt;
&lt;br /&gt;
 chapter + section { margin-top: -5mm }&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;selection of an element that has a certain attribute&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
:  element[attribute]&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
 Title[status] { color: blue; }&lt;br /&gt;
&lt;br /&gt;
(all titles that have a status attribute are rendered in blue )&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;selection of an element that has an attribute with a given value&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
:  element[attribute=&amp;quot;value&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
 Title[status=&amp;quot;draft&amp;quot;] { color: red; }&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Selection of an element that has an attribute with a given value in a comma-separated list&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
 Title[status~=&amp;quot;draft&amp;quot;] { color: blue; }&lt;br /&gt;
&lt;br /&gt;
=== Cascading and inheritance ===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Rule ordering&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* (Roughly speaking): &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;the last rule found will win&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;. E.g. if you define text color in more than one place, the &amp;#039;&amp;#039;&amp;#039;color:&amp;#039;&amp;#039;&amp;#039; property found in the last rule encountered will be used&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Inheritance of properties from parents&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Child elements usually inherit properties from the parent elements&amp;#039;&amp;#039;&amp;#039; ! If you don’t like this you have to change explicitly these properties&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Inheritance of properties example&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
XML&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;section&amp;gt;&lt;br /&gt;
   &amp;lt;title&amp;gt;Here is a title&amp;lt;/title&amp;gt; &lt;br /&gt;
   &amp;lt;para&amp;gt;Here is a paragraph&amp;gt; &lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
CSS&lt;br /&gt;
&amp;lt;source lang=&amp;quot;CSS&amp;quot;&amp;gt;&lt;br /&gt;
 section {font-family:Arial}&lt;br /&gt;
 title {font-family:Helvetica}&lt;br /&gt;
 /* para will inherit font-family from section, i.e. Arial */&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Simple page example ===&lt;br /&gt;
&lt;br /&gt;
XML file: [http://tecfa.unige.ch/guides/xml/examples/css/simple-page.xml simple-page.xml]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;?xml-stylesheet href=&amp;quot;simple-page.css&amp;quot; type=&amp;quot;text/css&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;page updated=&amp;quot;jan 2007&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;title&amp;gt;Hello friend&amp;lt;/title&amp;gt;&lt;br /&gt;
  &amp;lt;content&amp;gt; Here is some content  &amp;lt;/content&amp;gt; &lt;br /&gt;
  &amp;lt;content&amp;gt; Here is some more content :) &amp;lt;/content&amp;gt; &lt;br /&gt;
  &amp;lt;comment&amp;gt; Written by DKS/Tecfa &amp;lt;/comment&amp;gt;&lt;br /&gt;
 &amp;lt;/page&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
CSS: [http://tecfa.unige.ch/guides/xml/examples/css/simple-page.css simple-page.css]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 /* Definitions that apply to the whole hierarchy */&lt;br /&gt;
 page { font-family:Times; line-height:1.5;}&lt;br /&gt;
 /* Margins for the box of the root element */&lt;br /&gt;
 page { margin-top:3cm; margin-left:3cm; margin-right:3cm; }&lt;br /&gt;
&lt;br /&gt;
 /* Block elements */&lt;br /&gt;
&lt;br /&gt;
 title, content, comment { display:block; }&lt;br /&gt;
&lt;br /&gt;
 title { font-family: Arial; font-size:1.5em;}&lt;br /&gt;
 content { }&lt;br /&gt;
 comment { font-style:italic; }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Simple list example ===&lt;br /&gt;
&lt;br /&gt;
[http://tecfa.unige.ch/guides/xml/examples/css/simple-list.xml simple-list.xml]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;?xml-stylesheet href=&amp;quot;simple-list.css&amp;quot; type=&amp;quot;text/css&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;page updated=&amp;quot;jan 2007&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;title&amp;gt;Hello friend&amp;lt;/title&amp;gt;&lt;br /&gt;
  &amp;lt;list&amp;gt;&lt;br /&gt;
    &amp;lt;item&amp;gt; Here is an item that will be somewhat longer. Here is an item that will be somewhat longer. &amp;lt;/item&amp;gt; &lt;br /&gt;
    &amp;lt;item&amp;gt; Here is item B&amp;lt;/item&amp;gt; &lt;br /&gt;
    &amp;lt;item&amp;gt; Here is a C item &amp;lt;/item&amp;gt; &lt;br /&gt;
  &amp;lt;/list&amp;gt;&lt;br /&gt;
  &amp;lt;comment&amp;gt; Written by DKS/Tecfa , jan 2007 &amp;lt;/comment&amp;gt;&lt;br /&gt;
 &amp;lt;/page&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[http://tecfa.unige.ch/guides/xml/examples/css/simple-list.css simple-list.css]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 /* Definitions that apply to the whole hierarchy */&lt;br /&gt;
 page { font-family:Times; line-height:1.5;}&lt;br /&gt;
 page { margin-top:3cm; margin-left:3cm; margin-right:3cm; }&lt;br /&gt;
 title, list, comment { display:block; }&lt;br /&gt;
&lt;br /&gt;
 title { font-family: Arial; font-size:1.5em;}&lt;br /&gt;
 item {display:list-item; list-style-position:outside; &lt;br /&gt;
       list-style-type: disc; }&lt;br /&gt;
 comment { font-style:italic; }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== More complex examples ===&lt;br /&gt;
&lt;br /&gt;
* http://tecfa.unige.ch/guides/css/ex-xml/stepbystep/&lt;br /&gt;
** http://tecfa.unige.ch/guides/css/ex-xml/stepbystep/stepbystep-ex.xml&lt;br /&gt;
** http://tecfa.unige.ch/guides/css/ex-xml/stepbystep/stepbystep.css&lt;br /&gt;
&lt;br /&gt;
* http://tecfa.unige.ch/guides/xml/examples/recit/&lt;br /&gt;
** http://tecfa.unige.ch/guides/xml/examples/recit/story-grammar.xml&lt;br /&gt;
** http://tecfa.unige.ch/guides/xml/examples/recit/story-grammar.css&lt;br /&gt;
&lt;br /&gt;
* [http://tecfa.unige.ch/guides/xml/examples/dtd-examples/cd-list.xml cd-list.xml]&lt;br /&gt;
** [http://tecfa.unige.ch/guides/xml/examples/dtd-examples/cd-list.css cd-list.css]&lt;br /&gt;
&lt;br /&gt;
== Positioning ==&lt;br /&gt;
&lt;br /&gt;
By default elements of an XML (or HTML) file are displayed in sequential order. It is possible to put an element wherever you wish. Positioning is not easy (avoid if you are new to CSS)&lt;br /&gt;
&lt;br /&gt;
=== Simple absolute positioning ===&lt;br /&gt;
&lt;br /&gt;
XML: [http://tecfa.unige.ch/guides/xml/examples/css/simple-positioning.xml simple-positioning.xml]&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;?xml-stylesheet href=&amp;quot;simple-positioning.css&amp;quot; type=&amp;quot;text/css&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;page updated=&amp;quot;jan 2007&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;title&amp;gt;Hello friend&amp;lt;/title&amp;gt;&lt;br /&gt;
  &amp;lt;hotstuff&amp;gt;&lt;br /&gt;
    &amp;lt;item&amp;gt; Here is an item that will be somewhat longer. Here is an item that will be somewhat longer. &amp;lt;/item&amp;gt; &lt;br /&gt;
    &amp;lt;item&amp;gt; Here is item B&amp;lt;/item&amp;gt; &lt;br /&gt;
    &amp;lt;item&amp;gt; Here is a C item &amp;lt;/item&amp;gt; &lt;br /&gt;
  &amp;lt;/hotstuff&amp;gt;&lt;br /&gt;
  &amp;lt;content&amp;gt; &lt;br /&gt;
   &amp;lt;para&amp;gt; Here is some standard content. Here is some standard content. Here is some standard content. Here is some standard content. Here is some standard content. Here is some standard content. Here is some standard content. Here is some standard content. &amp;lt;/para&amp;gt;&lt;br /&gt;
  &amp;lt;comment&amp;gt; Written by DKS/Tecfa , jan 2007 &amp;lt;/comment&amp;gt;&lt;br /&gt;
  &amp;lt;/content&amp;gt;&lt;br /&gt;
 &amp;lt;/page&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
CSS: [http://tecfa.unige.ch/guides/xml/examples/css/simple-positioning.css simple-positioning.css]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;CSS&amp;quot;&amp;gt;&lt;br /&gt;
 /* Definitions that apply to the whole hierarchy */&lt;br /&gt;
 page { font-family:Times; line-height:1.5;}&lt;br /&gt;
&lt;br /&gt;
 /* Margins for the box of the root element */&lt;br /&gt;
 page { margin-top:3cm; margin-left:3cm; margin-right:3cm; }&lt;br /&gt;
&lt;br /&gt;
 /* Block elements */&lt;br /&gt;
&lt;br /&gt;
 title, hotstuff, content, comment { display:block; }&lt;br /&gt;
&lt;br /&gt;
 title { font-family: Arial; font-size:1.5em;}&lt;br /&gt;
 content { position: absolute; left: 0; width: 60% }&lt;br /&gt;
 hotstuff { position: absolute;&lt;br /&gt;
        right: 0;&lt;br /&gt;
        width: 20%;&lt;br /&gt;
        font: 10px/14px verdana, sans-serif;&lt;br /&gt;
        color: white;&lt;br /&gt;
        margin: 5px 5px 5px 5px;&lt;br /&gt;
        padding: 1cm;&lt;br /&gt;
        background-color: black; }&lt;br /&gt;
&lt;br /&gt;
 item {display:list-item; list-style-position:outside; list-style-type: disc; }&lt;br /&gt;
 comment { font-style:italic; }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Data-centric XML with CSS ==&lt;br /&gt;
&lt;br /&gt;
CSS isn’t made for data-centric XML, however one can use CSS to add some extra information.&lt;br /&gt;
* Data transformation is very weak in CSS (e.g. you barely can add extra text to the contents of an element) &lt;br /&gt;
* There is no easy way to display attribute values.&lt;br /&gt;
&lt;br /&gt;
=== The CSS 2.1 &amp;quot;content&amp;quot; property ===&lt;br /&gt;
&lt;br /&gt;
Allows to deal somewhat with data-centric XML. Below is an example.&lt;br /&gt;
&lt;br /&gt;
XML: [http://tecfa.unige.ch/guides/xml/examples/css/simple-content.xml simple-content.xml]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;?xml-stylesheet href=&amp;quot;simple-content.css&amp;quot; type=&amp;quot;text/css&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;page updated=&amp;quot;jan 2007&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;title&amp;gt;Hello friend&amp;lt;/title&amp;gt;&lt;br /&gt;
  &amp;lt;list&amp;gt;&lt;br /&gt;
    &amp;lt;item price=&amp;quot;10&amp;quot;&amp;gt; White plate &amp;lt;/item&amp;gt; &lt;br /&gt;
    &amp;lt;item price=&amp;quot;20&amp;quot;&amp;gt; Gold plate &amp;lt;/item&amp;gt; &lt;br /&gt;
    &amp;lt;item price=&amp;quot;15&amp;quot;&amp;gt; Silver plate &amp;lt;/item&amp;gt; &lt;br /&gt;
  &amp;lt;/list&amp;gt;&lt;br /&gt;
  &amp;lt;comment&amp;gt; Written by DKS/Tecfa , jan 2007 &amp;lt;/comment&amp;gt;&lt;br /&gt;
 &amp;lt;/page&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
CSS: [http://tecfa.unige.ch/guides/xml/examples/css/simple-content.css simple-content.css]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;CSS&amp;quot;&amp;gt;&lt;br /&gt;
 /* Definitions that apply to the whole heirarchy */&lt;br /&gt;
 page { font-family:Times; font-size:14pt; line-height:1.5;}&lt;br /&gt;
&lt;br /&gt;
 /* Margins for the box of the root element */&lt;br /&gt;
 page { margin-top:2cm; margin-left:2cm; margin-right:2cm; }&lt;br /&gt;
&lt;br /&gt;
 /* Block elements */&lt;br /&gt;
&lt;br /&gt;
 title, list, comment { display:block; }&lt;br /&gt;
 title { font-family: Arial; font-size:1.5em;}&lt;br /&gt;
&lt;br /&gt;
 list:before { content:&amp;quot;Products on sale:&amp;quot;; font-size:1.2em; }&lt;br /&gt;
 item        { display:block; }&lt;br /&gt;
 item:after  { content:&amp;quot; - Price: &amp;quot; attr(price) &amp;quot; CHF&amp;quot;;}&lt;br /&gt;
&lt;br /&gt;
 comment { font-style:italic; }&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;The :before and :after selectors&amp;#039;&amp;#039;&amp;#039; can be used to add contents before or after element contents (doesn’t work with IE6/7/8)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;The content property:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
: can access attribute values: attr(attribute_name)&lt;br /&gt;
: can add extra information strings.&lt;br /&gt;
&lt;br /&gt;
== Use XHTML tags and XLink ==&lt;br /&gt;
&lt;br /&gt;
You may add XHTML tags to your XML, but you will have to adjust your DTD or other Schema file in order to keep documents valid. If you only plan to use links but no pictures, you should use XLink. In any case, you also should learn [[XSLT]], a powerful transformation language that allows transforming any XML content into a rendering format like HTML or PDF.&lt;br /&gt;
&lt;br /&gt;
=== Use XHTML tags to display pictures and links ===&lt;br /&gt;
&lt;br /&gt;
To make your life a bit simpler, you may include XHTML tags in your XML in order to create links and insert pictures. If you use a DTD or another Schema, you should modify these accordingly. Pictures inserted into XML also can be used to style contents.  I discourage this, since that way data isn’t anymore separated from styling. Rather learn [[XSLT]] !&lt;br /&gt;
&lt;br /&gt;
Below is a simple well-formed XML document that uses a bit of XHTML. Notice how the html namespace &amp;lt;code&amp;gt;xmlns:html=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;lt;/code&amp;gt; is declared in the root element &amp;lt;code&amp;gt;page&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
XML: [http://tecfa.unige.ch/guides/xml/examples/css/simple-content-htmlns.xml simple-content-htmlns.xml]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;?xml-stylesheet href=&amp;quot;simple-content-htmlns.css&amp;quot; type=&amp;quot;text/css&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;page xmlns:html=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot; updated=&amp;quot;jan 2007&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;title&amp;gt;Hello friend&amp;lt;/title&amp;gt;&lt;br /&gt;
  &amp;lt;list&amp;gt;&lt;br /&gt;
    &amp;lt;html:img src=&amp;quot;photo.jpg&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;item price=&amp;quot;10&amp;quot;&amp;gt; White plate &amp;lt;/item&amp;gt; &lt;br /&gt;
    &amp;lt;item price=&amp;quot;20&amp;quot;&amp;gt; Gold plate &amp;lt;/item&amp;gt; &lt;br /&gt;
    &amp;lt;item price=&amp;quot;15&amp;quot;&amp;gt; Silver plate &amp;lt;/item&amp;gt; &lt;br /&gt;
  &amp;lt;/list&amp;gt;&lt;br /&gt;
  &amp;lt;comment&amp;gt; Written by DKS/Tecfa , jan 2007 &amp;lt;/comment&amp;gt;&lt;br /&gt;
 &amp;lt;/page&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
CSS: [http://tecfa.unige.ch/guides/xml/examples/css/simple-content-htmlns.css simple-content-htmlns.css]&lt;br /&gt;
: same as simple-content.css&lt;br /&gt;
&lt;br /&gt;
If &amp;#039;&amp;#039;&amp;#039;you you plan to use XHTML tags&amp;#039;&amp;#039;&amp;#039;, you will have to adjust your DTDs or other schema definitions&amp;#039;&amp;#039;&amp;#039; (if you do use one). Remember: XML knows &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;nothing&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; about anything. The code fragment below shows (1) how to declare the XHTML namespace, and (2) simple versions of the &amp;#039;&amp;#039;a&amp;#039;&amp;#039; and &amp;#039;&amp;#039;img&amp;#039;&amp;#039; Xhtml elements.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;XML&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;!ATTLIST YOUR_ROOT_ELEMENT xmlns:html CDATA #FIXED &amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;gt;&lt;br /&gt;
     .....&lt;br /&gt;
    &amp;lt;!ELEMENT html:img EMPTY&amp;gt;&lt;br /&gt;
    &amp;lt;!ATTLIST html:img src CDATA #REQUIRED&amp;gt;&lt;br /&gt;
    &amp;lt;!ELEMENT html:a (#PCDATA)&amp;gt;&lt;br /&gt;
    &amp;lt;!ATTLIST html:a href CDATA #REQUIRED &amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;XML with XHTML example&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The next example uses XHTML for linking and is available as [http://tecfa.unige.ch/guides/xml/examples/recit/story-grammar-con-xhtml.dtd story-grammar-con-xhtml.dtd], [http://tecfa.unige.ch/guides/xml/examples/recit/story-grammar-con-xhtml.xml story-grammar-con-xhtml.xml] and [http://tecfa.unige.ch/guides/xml/examples/recit/story-grammar.css story-grammar.css]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!ELEMENT STORY (title, context, problem, goal, THREADS, moral, INFOS)&amp;gt;&lt;br /&gt;
&amp;lt;!ATTLIST STORY xmlns:html CDATA #FIXED &amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!ELEMENT THREADS (EPISODE+)&amp;gt;&lt;br /&gt;
&amp;lt;!ELEMENT EPISODE (subgoal, ATTEMPT+, result) &amp;gt;&lt;br /&gt;
&amp;lt;!ELEMENT ATTEMPT (action | EPISODE) &amp;gt;&lt;br /&gt;
&amp;lt;!ELEMENT INFOS ( ( date | author | html:a )* ) &amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!ELEMENT title (#PCDATA) &amp;gt;&lt;br /&gt;
&amp;lt;!ELEMENT context (#PCDATA|html:img)* &amp;gt;&lt;br /&gt;
&amp;lt;!ELEMENT problem (#PCDATA) &amp;gt;&lt;br /&gt;
&amp;lt;!ELEMENT goal (#PCDATA) &amp;gt;&lt;br /&gt;
&amp;lt;!ELEMENT subgoal (#PCDATA) &amp;gt;&lt;br /&gt;
&amp;lt;!ELEMENT result (#PCDATA) &amp;gt;&lt;br /&gt;
&amp;lt;!ELEMENT moral (#PCDATA) &amp;gt;&lt;br /&gt;
&amp;lt;!ELEMENT action (#PCDATA) &amp;gt;&lt;br /&gt;
&amp;lt;!ELEMENT date (#PCDATA) &amp;gt;&lt;br /&gt;
&amp;lt;!ELEMENT author (#PCDATA) &amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!ELEMENT html:a (#PCDATA)&amp;gt;&lt;br /&gt;
&amp;lt;!ATTLIST html:a&lt;br /&gt;
     href CDATA #REQUIRED &amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!ELEMENT html:img (#PCDATA)&amp;gt;&lt;br /&gt;
&amp;lt;!ATTLIST html:img&lt;br /&gt;
     src CDATA #REQUIRED &amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a reason I don&amp;#039;t understand, the namespace prefix must be called &amp;#039;&amp;#039;html&amp;#039;&amp;#039; (e.g. not &amp;#039;&amp;#039;xh&amp;#039;&amp;#039;), else IE 8 will not display the link. Firefox would ...&lt;br /&gt;
&lt;br /&gt;
=== XML plus xlink ===&lt;br /&gt;
&lt;br /&gt;
Below is a DTD example using XLink (the XML linking language), available as [http://tecfa.unige.ch/guides/xml/examples/recit/story-grammar.dtd story-grammar.dtd] and [http://tecfa.unige.ch/guides/xml/examples/recit/story-grammar.xml story-grammar.xml]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!ELEMENT STORY (title, context, problem, goal, THREADS, moral, INFOS)&amp;gt;&lt;br /&gt;
&amp;lt;!ATTLIST STORY xmlns:xlink CDATA #FIXED &amp;quot;http://www.w3.org/1999/xlink&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!ELEMENT THREADS (EPISODE+)&amp;gt;&lt;br /&gt;
&amp;lt;!ELEMENT EPISODE (subgoal, ATTEMPT+, result) &amp;gt;&lt;br /&gt;
&amp;lt;!ELEMENT ATTEMPT (action | EPISODE) &amp;gt;&lt;br /&gt;
&amp;lt;!ELEMENT INFOS ( ( date | author | a )* ) &amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!ELEMENT title (#PCDATA) &amp;gt;&lt;br /&gt;
&amp;lt;!ELEMENT context (#PCDATA) &amp;gt;&lt;br /&gt;
&amp;lt;!ELEMENT problem (#PCDATA) &amp;gt;&lt;br /&gt;
&amp;lt;!ELEMENT goal (#PCDATA) &amp;gt;&lt;br /&gt;
&amp;lt;!ELEMENT subgoal (#PCDATA) &amp;gt;&lt;br /&gt;
&amp;lt;!ELEMENT result (#PCDATA) &amp;gt;&lt;br /&gt;
&amp;lt;!ELEMENT moral (#PCDATA) &amp;gt;&lt;br /&gt;
&amp;lt;!ELEMENT action (#PCDATA) &amp;gt;&lt;br /&gt;
&amp;lt;!ELEMENT date (#PCDATA) &amp;gt;&lt;br /&gt;
&amp;lt;!ELEMENT author (#PCDATA) &amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!ELEMENT a (#PCDATA)&amp;gt;&lt;br /&gt;
&amp;lt;!ATTLIST a&lt;br /&gt;
     xlink:href CDATA #REQUIRED&lt;br /&gt;
     xlink:type CDATA #FIXED &amp;quot;simple&amp;quot;&lt;br /&gt;
&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== A last example and again some advice ===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;First operations when writing a CSS for XML&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
* Use the root element to define margins, default font, etc.&lt;br /&gt;
* Decide which elements are blocks and which ones are inline&lt;br /&gt;
* Identify &amp;quot;special elements&amp;quot; like titles and lists&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Some example CSS rules&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;CSS&amp;quot;&amp;gt;&lt;br /&gt;
 /* title and para elements are blocks. They have an extra margin */&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;title, para {display: block; margin: 0.5em;}&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /* title element font is 1.5 as big */&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;title {font-size: 1.5em;}&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /* item elements are list elements, we use bullet style */&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;item {display: list-item;list-style-type: disc;}&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /* strong is an inline element. Uses italic style and blue color */&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;strong {display: inline; font-style: italic; color: rgb(000,000,128);}&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== If your stylesheet doesn’t display as it should ==&lt;br /&gt;
&lt;br /&gt;
See also: [[CSS tutorial]]&lt;br /&gt;
* Validate your CSS !! E.g. upload the file to the [http://jigsaw.w3.org/css-validator/  CSS Validation Service]&lt;br /&gt;
* Do not use the &amp;quot;class&amp;quot; selector in XML (unless you defined such an attribute in your DTD)&lt;br /&gt;
* If you try advanced CSS features, make sure to check a compatibility table, e.g. at [http://www.quirksmode.org/css/contents.html quirksmode] and check if the CSS features you use are implemented in your browser&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.css-zibaldone.com/articles/xml/cssxml.html CSS and XML]. Tutorial by Gabriele Romanato. Quote: In this article I&amp;#039;ll explain how to format a well-formed XML document by using CSS. The techniques explained below can be used to stylize an (X)HTML document as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Web technology tutorials]]&lt;br /&gt;
[[Category: XML]]&lt;br /&gt;
[[Category: CSS]]&lt;/div&gt;</summary>
		<author><name>Daniel K. Schneider</name></author>
	</entry>
</feed>