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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:40:44+00:00 2026-06-05T05:40:44+00:00

.block { width:540px; margin:20px; padding:10px; border:1px solid Gray; } <div id=header class=block> <div id=pe

  • 0
               .block    
               {
                width:540px;
                margin:20px;
                padding:10px;
                border:1px solid Gray;
               }

              <div id="header" class="block">
                <div id="pe" class="text">
                  <b>Name :</b> <span>King</span><br />
                  <b>Surname :</b> <span>Kong</span>
                </div>
                <div id="area" class="text">
                  <span id="city">Abcs</span><b>/</b>
                  <span id="state">Bcsdf</span>
                </div>
              </div>​

If u run the above code in Jsfiddle, then it shows a border around the text and the important thing is that the height of the block class is auto, so it automatically adjust its height.

But the problem comes when i added the following css :

 #pe
 {
  float:left;
 }
 #area
 {
   float:right;
 }​

Now the height of div.block is not set automatically. Can anybody tell me the problem?

  • 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-05T05:40:45+00:00Added an answer on June 5, 2026 at 5:40 am

    Now You need a Clearfix for it

    .clearfix:after{
    clear:both;
    line-height:0;
    height:0;
    display:block;
    background-color:transparent;
    border:none;
    content: ".";
    visibility:hidden;
     }
    
    html[xmlns] .clearfix {
    display: block;
    }
    
    * html .clearfix {
    height: 1%;
     }
    

    you add it like this

    "<div id = "header" class="block clearfix"></div>"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

label { display: block; width: 156px; cursor: pointer; padding-right: 6px; padding-bottom: 1px; } <label
As I understand, width/padding/margin properties only work on block level elements. However, on INPUT
I've run into a problem. My code now: <div style=width: 500px; margin: auto; border:
my CSS code .child{ width:100px; height:100px; display:inline-block; } my HTML code <div id=parent> <div
my code is something like this //css li{display:inline-block} //html #li margin and width are
My current CSS: .DataForm input { margin-right:9px; display: inline-block; width:21%; min-width:30px; } works fine
I have a page like below; <style type=text/css> #test a{ display: block; width: 150px;
For example: <v:roundrect style=display:block;width:100px;height:100px; fillcolor=#eee> Hi <v:roundrect style=display:block;width:50px;height:50px; fillcolor=#c00> Hey </v:roundrect> </v:roundrect> I can't
HTML: <div content> <div post> <div post> ... </div> CSS: .post { margin: 0;
I have a few nested divs: <div id=wrapper> <div id=header> <!-- a bunch of

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.