Posted by Chris on 12/10/06 13:38
Sorry this prblem seems to apply to backgrounds in general. It's like if the
div has no content the width reduces to 0. Totally confused.
"Chris" <nospam@btinternet.com> wrote in message
news:9ZSdnXZYcNs0fubYnZ2dnUVZ8q6nnZ2d@bt.com...
>I have a page in which many of the images are set as background images in
>css for empty divs. This works fine in IE 6 and Firefox. I look at it in IE
>and some of them disappear but if I write some text in the div the
>backgroud appears for the length of the text. This is the strange thing the
>backgrond images appear on some empty divs. Here is some sample code I am
>using to create a curved top half of a box. #tl and #tr appear but
>contenttopbg doesn't. Can anyone help? Regards, Chris.
>
> <div id="tl"><div id="tr">
> <div id="contenttopbg"></div>
> </div></div>
>
>
> #contenttopbg
> {
> display:block;
> height:10px;
> margin-left:9px;
> margin-right:9px;
> background-color:#ffffff;
> border-top:solid 1px #3A5B0A;
> }
> #tl {height:10px;background: url(images/topleft.gif) 0 0 no-repeat; width:
> 100%}
> #tr {height:10px;background: url(images/topright.gif) 100% 0 no-repeat;}
>
[Back to original message]
|