Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4054400
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:34:13+00:00 2026-05-20T14:34:13+00:00

This is a general question and something that dawned on me and seemed to

  • 0

This is a general question and something that dawned on me and seemed to make sense. I have seen many people use clearing divs <div class="clear" />and know this is sometimes frowned upon as it is extra markup. I recently started using <hr class="clear" /> as it seams representative of its actual purpose.

Both referencing of course: .clear{clear:both;}

I am looking to get some opinions if an hr tag makes more sense than a div to clear content

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T14:34:14+00:00Added an answer on May 20, 2026 at 2:34 pm

    According to the HTML5 spec, the hr element represents a paragraph-level thematic break (a scene change in a story, or a transition to another topic within a section of a reference book) while the div element is a generic container for flow content that by itself does not represent anything. So I don’t see any justification for choosing one over the other for containing floats.

    However, there’s something you should keep in mind. Read the following excerpt from Eric Meyer’s article Containing Floats:

    div.item {border: 1px solid; padding: 5px;}
    div.item img {float: left; margin: 5px;}
    div.item hr {display: block; clear: left; margin: -0.66em 0;
        visibility: hidden;}
    

    That's not right
    Using a horizontal rule to force expansion

    The negative top and bottom margins
    have the general effect of closing up
    the space that the hr occupies.
    However, this effect is not precise,
    and not necessarily identical across
    browsers. The semi-mysterious nature
    of horizontal rules makes it difficult
    to predict exactly what will happen.
    The effective height of the hr might
    be zero, or a small positive amount,
    or even a negative height

    Therefore, in situations where a
    precise clearing effect is needed,
    authors can use a div instead of an hr
    to create a clearing effect.

    If this didn’t make sense to you, see this fiddle and notice the space below the floated div (IE8).

    That said, there are other ways to contain floats and avoid using structural hacks at the same time:

    1. Float the container: may cause layout problems.
    2. Use .container { overflow: auto; }: If the content exceeds the boundaries of the container, you will see a scrollbar.
    3. Use .container { overflow: hidden; }: If the content exceeds the boundaries of the container, it will be hidden.
    4. Clearfix: To be used when 2 and 3 fail.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have general question regarding the use of pointers vs. references in this particular
This is a general architecture question. I read in many places that in an
This is a general question of sorts, but do you think that it's important
this time I got a more general question. Should I use multiple views rather
This is a very general question that's not related to a specific language. I'm
I have a general question about Hibernate that I'm batteling with. I have class
This will ultimately be used on the iPhone but its a general question that
This is a general question of sorts, but to explain it I will use
This is kind of just a general information question so that I can implement
Not sure if this is a style question, or something that has a hard

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.