Archive for March, 2010

3 Reasons to Never Use Double Break Tags in HTML

  • Mixes presentation with content. (not semantic)
  • Can’t be over-ridden with CSS. (not easily and reliably anyway)
  • No control over amount of space it adds.

So how should you use break tags?

Break tags should only be used inside a block level element such as a paragraph or header in order to break a line of text. Never use them to add space between elements. Use CSS styles instead.

(Be Aware: If you use a general CSS reset to remove default browser styles it’s easy to forget to re-define margins for basic elements such as paragraph tags. This leads to the tempation to insert double break tags as a quick fix to add paragraph breaks instead of using paragraph tags properly. To avoid this, always define your own default margins for all the basic tags whenever you use a reset.)

Comments