Is it necessary to use a size for a div when it's around a banner?
| SitePoint Sponsor |
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.
Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form
Try your hand at the new JavaScript Challenge!
If you don't like getting your feet stuck in a bog, avoid Twitter BootsTrap.


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.
Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form
Try your hand at the new JavaScript Challenge!
If you don't like getting your feet stuck in a bog, avoid Twitter BootsTrap.
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.
Bookmarks