X hits on this document

431 views

0 shares

1 downloads

0 comments

36 / 142

Rendering XML with cascading style sheets

This is used to denote whether or not the font is displayed in bold text or not. Typical values for font- weight are normal and bold:

  • font-weight: normal;

  • font-weight: bold;

Putting it together

Below is a CSS file intended to be applied against the letter.xml file previously illustrated. Notice how each element in the XML file has a corresponding selector in the CSS file. In order to tell your Web browser to use this CSS file, you will have to add the xml-stylesheet processing instruction (<?xml-stylesheet type="text/css" href="letter.css" ?>) to the top of letter.xml.

letter { display: block; margin: 5%;

}

date, addressee { display: block; margin-bottom: 1em;

} n a m e , a d d r e s s _ o n e , a d d r e s s _ t w o { d i s p l a y : b l o c k ;

}

greeting, list { display: block; margin-bottom: 1em;

}

paragraph { display: block; margin-bottom: 1em; text-indent: 1em;

}

italics { display: inline; font-style: italic;

} list { display: block;

}

item { display: list-item; list-style: inside; text-indent: 2em;

}

closing { display: block; margin-top: 3em; text-align: right;

}

28

Document info
Document views431
Page views437
Page last viewedWed Dec 07 22:58:34 UTC 2016
Pages142
Paragraphs3126
Words34660

Comments