HTML & CSS
Is it necessary to use a size for a div when it's around a banner?
You probably need to give more info about what you mean by "size". A containing div will expand to width: 100% unless told otherwise.
Okay. I have a Div that is holding a banner that is 800 px wide. It is not wrapped around the width of the banner. The div goes from one end of the interface to the other.
I'll assume the banner is an img. Therefore the image will be left aligned. The div will go 100% width by default. If you want it left aligned then no a width is not necessary. If you want the img centered the width is still not necessary.
Yes, that's what I meant by it stretching to width: 100% by default. There are various things you could do, like giving the div a width of 800px or perhaps even floating it, but we'd really need to see this in context to know what will work best in this case, as there are quite a few variables involved.
Thanks. I'll PM it to you. I just want it centered on the page.
This topic is now closed. New replies are no longer allowed.