Add content to pseudo class : pseudo class « CSS Style « XML






Add content to pseudo class


File: Data.xml

<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="Style.css"?>
<document>
  <page>
    <paragraph3>This content is within paragraph 3</paragraph3>
    <paragraph4>This content is within paragraph 4</paragraph4>
  </page>
</document>

File: Style.css

paragraph1:first-letter {
  float:left;
  font-size:24pt;
  font-style:italic;
  font-weight:bold;
  padding-right:4px;
}
paragraph2:first-line {
  text-transform:uppercase;
  font-weight:bold;
}
paragraph3:before {
  font-weight:bold;
  text-transform:uppercase;
  content:"Text before paragraph 3 - ";
}
paragraph4:after {
  content: url(lions.jpg);
}
paragraph3, paragraph4 {
  display: block;
}

 








Related examples in the same category

1.before pseudo class
2.pseudo class:before