Glubase - share your knowledge


All / Computers / Programming / CSS





  • View Command

CSS Reference

CSS background-repeat definition

Browser support
IEFFOpSaf

Type:

Syntax

background-repeat: <repeat>

Description

The background-repeat property specifies if the background image is repeated (in x, y or both directions).

Values

Value Description

repeat (default)

With the default value repeat the background repeats itself in both horisontal and vertical directions.

repeat-x

With the value repeat-x the background repeats itself only in the horisontal direction.

repeat-y

With the value repeat-y the background repeats itself only in the vertical direction.

no-repeat

With the value no-repeat the background is not repeated in any direction.

 See also

background, background-attachment, background-color, background-image and background-position.

Example

[Try this example yourself]
<style type="text/css">
.repeat1

  background-image: url(http://www.glubase.com/images/glubase2.gif); 
  background-repeat: no-repeat
}
.repeat2

  background-image: url(http://www.glubase.com/images/glubase2.gif); 
  background-repeat: repeat
}
.repeat3
{
  background-image: url(http://www.glubase.com/images/glubase2.gif); 
  background-repeat: repeat-x
}
</style>
<div class="repeat1">
    <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
</div>
<div class="repeat2">
    <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
</div>
<div class="repeat3">
    <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
</div>

Output





































  • Comments



#1 sunil
thanks a lot ....
#2 sunil
thanks a lot ....