Click to See Complete Forum and Search --> : Can <div> tags have backgrounds?


krautinator
10-21-2003, 01:51 PM
does anyone know if <div> tags can have backgrounds?

Jona
10-21-2003, 02:20 PM
Yes, they can. This requires CSS, however, and not JavaScript.


<div style="background-image: url(your_image.jpg);">
<p>Lorem ipsum solor dit amet.</p>
</div>


[J]ona

Webskater
10-21-2003, 02:20 PM
divs can have all sorts of things including scroll bars.

<div style="position:absolute; top:0; left:0; background-color:#E5FFFF; overflow:auto; overflow-x:hidden; width:100%; height:100%; border:1px solid #000066;">