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 8907061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:48:47+00:00 2026-06-15T02:48:47+00:00

<!Doctype html> <html> <head> <meta charset=utf-8 /> <title>test</title> </head> <body> <div style=float: left; width:

  • 0
<!Doctype html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>test</title>
    </head>
    <body>
        <div style="float: left; width: 200px; height: 150px;
background-color: red;"></div>
        <div style="background-color: gray;">
            <div style="clear: left;"></div>
        </div>
    </body>
</html>

enter image description here

My question: why the red block’s height and gray block’s height equality ?

  • 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-06-15T02:48:48+00:00Added an answer on June 15, 2026 at 2:48 am

    This is basically how a clearfix works.

    The red block is floating to the left while the gray block isn’t floating at all. You have a clearing div as a child of the gray div; since that child is trying to clear the left-floating red block, it needs to be positioned starting at the very bottom of the red block. Because it needs to be moved down, it pulls the height of the gray block down, such that the two blocks become equal in height.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The sample page: <!DOCTYPE html> <html> <head> <meta charset=utf-8> <title>Button test</title> <style> * {
Edit: Entire page (HTML) <!doctype html> <html> <head> <meta charset=utf-8 /> <title>jQuery Ajax Test</title>
<!doctype html> <html lang=en> <head> <meta charset=utf-8/> <style> form:focus{ background:red; } </style> <title>Home, sweet
I have something similar to this: <!doctype html> <html> <head> <meta charset=UTF-8> <title>JQuery Test</title>
This is my page code: <!DOCTYPE HTML> <html> <head> <meta charset="UTF-8"> <title>Marketing Tracking</title> </head>
The code is fully copied below. <!DOCTYPE html> <html> <head> <meta charset=UTF-8 /> <title>Avaliações</title>
<!DOCTYPE html> <html> <head> <meta http-equiv=Content-Type content=text/html; charset=utf-8/> <title>FAQ Section</title> <link rel=stylesheet type=text/css href=styles.css/>
Consider the following rudimentary html code block: <!doctype html> <html> <head> <meta charset=utf-8> <title>iPad
I am testing out slickgrid. HTML CODE <!DOCTYPE html> <html> <head> <meta charset=utf-8> <title>Slick
<!DOCTYPE html> <html lang=en> <head> <meta http-equiv=Content-Type content=text/html; charset=utf-8> <script src=http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js type=text/javascript></script> <script type=text/javascript>

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.