There are several HTML elements that I have not introduced to this point because without CSS they have little point, and almost no meaning. These elements include span and div.
div is arguably the most overused and misunderstood element of the HTML specification, so let’s try to kill a few common mistakes right off the bat:
- In CSS, anything you can do to a
divyou can do to any other tag. divis not special in that regard. You do not need to use adivin order to access advanced CSS such as positioning.- A
divshould almost never contain a single element. Because anything you can do to a
divyou can do to any other element, wrapping adivaround a single element is almost always redundant and unnecessary.- A div is not a substitute for, or addition to, a block element.
An unordered list, for example, already has a container element:
<ul>. Wrapping a<div>around the<ul>is redundant.- A div is not necessary to add an extra border to an element.
Use the
outlineproperty or a CSS3 trick withbox-shadowto achieve the effect instead.- Avoid setting
heighton divs (in fact, avoid setting aheighton all elements other than images). Other than uses of
height: 100%, allow divs to find their own height, judged by their content.
Haha, that is actually incredibly clever.
![Prometheus: Collector's Edition (Bilingual) [Blu-ray 3D + Blu-ray + DVD + Digital Copy] Prometheus: Collector's Edition (Bilingual) [Blu-ray 3D + Blu-ray + DVD + Digital Copy]](http://ecx.images-amazon.com/images/I/5192I1rtYnL._SL160_.jpg)

