Digital UK Design Blog

">My hatred of

June 16, 2009 | CSS | Gary Hartley | 9 Comments »

Do you like this story?

This post is aimed at all web designers and developers that insist on using the dirty hack <br clear="all"> within their website builds. Most people won’t understand my rage for <br clear="all"> because it takes a certain level of web geekness to fathom what it is and why it’s so god damn unnecessary.

br clear="all" - *** you!

<br clear="all"> is typically used by crap developers who hold no appreciation for web semantics nor accessibility. Ironically these culprits are usually the smart a**** that are the first to point out others mistakes, no matter how minor. They build websites that are both bloated, slow and unstable cross-browser. <br clear="all"> to me acts as the ultimate professional insult to those that have crafted for years, through changing technologies and user demands. <br clear="all"> is like a bird crapping on your freshly washed and polished hatchback, a minor little thing that really p***** me off when I encounter it.

Like the story ‘The Princess and the Pea’, no matter how much preparation and effort you put into something, all it takes is a stupid little pea to annoy you and reduce a potentially relaxing nights sleep to an unexpected search for the very thing that shouldn’t be there in the first place, the <br clear="all">.

Dear Website Developer,

If you need to clear a floated element, please don’t use <br clear="all">. As a last resort use a simple CSS class on the element you want clearing. In your bloated, unstructured CSS file, which more than likely will be inline, create a class:

.clear{
     clear:both;
}

and remember you can add multiple classes to an element, like:

<div class="className className clear">
I'm a clever little developer aren't I
</div>

As Borat would say, this is ‘unbelievable’!!!

<br clear="all">

<div class="className">
Hack hack hack
</div>

<br clear="all">

<div class="className">
Hack hack hack
</div>

So next time to quickly quack in <br clear=”all”>, think, you’re a dirty little bugger! One last thing, if you write <br clear="all">, it should be <br clear="all" />, but I guess you don’t care do you?

Related posts:

  1. Poll: Shortest search phrase a visitor found your website with

Author : Gary Hartley

Gary (aka Frog) is the co-founder of The Floating Frog and has written in excess of 200+ articles on all things design and web related. If you'd like to guest post on The Floating Frog on a subject you are really passionate about then please get in touch. For more information head over to our write for us page.

9 Responses so far

  1. Lauren Says:


    Interesting. I’ve seen my share of terrible web sites, but I’ve never come across this method of clearing before. I suppose I should feel fortunate?

    Just a note: self-closing tags, as you mention in your last paragraph, are valid only in XHTML and not in regular HTML.


  2. frog Says:


    @Lauren Hi Lauren, This clearing method seems common in CSS based layouts with floated elements, and not so in tablular based layouts.
    is the title of the post so I thought I’d mention the closing
    for xHTML coders, as I presumed web geeks would mention it, good spot though :)


  3. dh Says:


    how about :D , does it bother you too ?


  4. frog Says:


    @dh Of course not, it’s not even in the same context of where my anger resides ;-)


  5. My hatred of <br clear=”all”> | Design Newz Says:


    [...] My hatred of <br clear=”all”> [...]


  6. Thibaut Allender Says:


    I’m 200 percent with you but your CSS code is wrong…
    clear: all is not valid, while clear: both is ;-)


  7. frog Says:


    @Thibaut You’re completely right. In my haste I lost focus and became my own worst enermy. Good spot, I’ll correct it


  8. Eric Peacock Says:


    I’ve never noticed or used the method, but I have done my fair share of complex floated layouts that had to use a null spacer class.

    I learned about from an older article on A List Apart. The usage has evolved sinc that article was published, but using a non-semantic class is sometimes still necessary with complex nested floats.


  9. Douglas Says:


    I Use ‘all’ the time, it’s great! What’s the problem?

    Regards D.Radburn

    P.S Your submit comment button looks funny in IE8, try clearing the elements below it, you could use a line break tag then add a clear attribute with a value of ‘all’. That should do the trick!




Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.

©2006 - 2009 The Floating Frog