animated-logo

Backgrounds


Cascading Style Sheets is the best way of setting the background properties in your HTML page. It is more flexible than the (outdated) HTML method. Using CSS, you can set the background properties of any HTML element. Plus you can do things like, specify an image's position, whether it should repeat, how it should repeat etc.


  1. The CSS background-image property is used to specify a background image of an element.
  2. <style type="text/css">
    .imageBox {
    width:320;
    height:240;
    background-image:url("/image.gif");
    }
    </style>
    <div class="imageBox">
    <p>This div element has a background-image. To stop it repeating see the <a href="/css/properties/css_background-repeat.cfm">background-repeat</a> property.</p>
    </div>