h2 background-image: url(http://java2s.com/style/logo.png); : Header background « Tags « HTML / CSS






h2 background-image: url(http://java2s.com/style/logo.png);

  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<style type="text/css">

h2 { 
 font: bold italic 2em Georgia, Times, "Times New Roman", serif; 
 background-image: url(http://java2s.com/style/logo.png);
 background-repeat: repeat-x;
 background-position: bottom;
 border-bottom: 10px solid #666;
 margin: 10px 0 0 0;
 padding: 0.5em 0 60px 0;
}


</style>
</head>

<body>
  <h2>Welcome to the Tall Grass National Prairie Preserve</h2>
  <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam ligula nulla, blandit quis, vehicula sed, blandit ut, lorem. Vestibulum magna magna, suscipit eu, condimentum nec, molestie vitae, ligula. Phasellus molestie orci convallis diam. Donec eget arcu. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Ut nibh nisi, varius eu, interdum at, viverra at, est. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Praesent a lacus in nunc feugiat ullamcorper. Quisque tristique, ante eget interdum rhoncus, pede risus ullamcorper dolor, vel adipiscing dui enim a elit. Donec eu magna non mauris blandit elementum.</p>
</body>
</html>

   
    
  








Related examples in the same category

1.h2 background-repeat: repeat-x;
2.h2 background-position: bottom;
3.H1 background: inherit;
4.H1 background: transparent;
5.h2 background: inherit;
6.h2 background: inherit; 2