What is Divitis?
Divitis refers to the over-use of the div tag for purposes other than dividing a page into meaningful sections. These include:
- wrapping elements in a div in order to insert class and/or id attributes for styling with CSS
- manipulating page structure to accomplish specific visual goals
- using a div tag to mark-up items that don’t seem to match any other HTML element
Why is Div-itis bad?
There are a few reasons:
- It dilutes the separation of presentation from structure.
- It makes the document more complex and more difficult to style using CSS.
- The code becomes more difficult to read and mistakes become more common.
- Non-semantic elements are meaningless to screen readers, search bots, feed readers, and other devices that may need to derive meaning from the content.
- More code makes file sizes larger and slower to download.