Stop Misusing the Break Element
posted by Kravvitz at 10:25 PM on Jan. 22nd, 2009
Categories: HTML, Semantics 6 commentsThe break element (<br>) has one purpose and one purpose only, which is to force a line break between lines of text. To use it to add vertical spacing between elements or as a clearing element are clearly misuses of it. Use margins and padding to add vertical spacing between elements. If you really have to add an element as a clearing element, add a <div>. Many times you can make an existing element into a clearing element or take advantage of the float or overflow properties to contain floated elements. You can also use the PIE/Aslett approach for containing floats, which I often use.
Another common misuse of the break element is to place each link in a navigation menu on its own line. That's wrong because an unordered list (<ul>) should be used to mark up the links instead.
So please stop littering your documents with this poor overused element.
Time to fix clearfix?
Arem 4:38 AM on Feb. 24th, 2009THANK YOU
EricReese 1:56 PM on May. 24th, 2009Login or Register to post a comment