>> English << | česky | PortuguêsZVON > Tutorials > CSS2 tutorial
>> Example 20 << | Prev | Next | Index | Contents

Authors may specify the background-color of an element (1) or use a background image(2).

XML SourceCSS stylesheetExample link
(1)
     <AAA>
          <BBB>bbb bb bbbb bb bbb</BBB>
     </AAA>

AAA {background-color:red}
BBB {background-color:navy; color:yellow}
View output
XML SourceCSS stylesheetExample link
(2)
     <AAA>
          <BBB>bbb bb bbbb bb bbb</BBB>
     </AAA>

AAA {background-image:url("../Pictures/zvon.gif")}
View output
XML SourceCSS stylesheetExample link
(3)
     <AAA>
          <BBB>bbb bb bbbb bb bbb</BBB>
     </AAA>

AAA {background-image:url("../Pictures/zvon.gif")}
BBB {background-image:url("../Pictures/gnu.jpg")}
View output