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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:53:51+00:00 2026-06-01T15:53:51+00:00

My div with class name ‘header-body-right’ doesn’t seem to be floating to the left

  • 0

My div with class name ‘header-body-right’ doesn’t seem to be floating to the left of my div named ‘header-body-centre’ and I can’t understand why, here is my HTML,

    <!DOCTYPE HTML>
<HTML>
 <HEAD>
  <TITLE>  </TITLE>
  <meta charset="UTF-8" />
  <link href="main.css" rel="stylesheet" type="text/css">
  <META NAME="Generator"    CONTENT="Notepad">
  <META NAME="Author"       CONTENT="00">
  <META NAME="KEYWORDS"     CONTENT="" />
  <META NAME="DESCRIPTION"  CONTENT="" />
 </HEAD>

 <BODY>

    <div class="header-top">

    </div>

    <div class="header-body">

        <div class="header-body-centre">
            <div class="logo">
            <img src="logo.png" />
            </div>
        </div>

        <div class="header-body-right">
            test
        </div>

    </div>



    <div class="navbar">

    </div>

    <div class="content-container">

    </div>
 </BODY>

</HTML>

The CSS I am using for the code is posted below,

 body
{   
    margin:0px;
    padding:0px;
}

.header-top
{
    height:11px;
    width:100%;
    background-image: url('HeaderTopNav.png');
    background-repeat: repeat-x;
}
.header-body
{
    width:100%;
    height:100px;
}
.header-body-centre
{
    margin: 0 auto;
    height:100%;
    width:70%;
}

.header-body-right
{
    width:15%;
    height:100px;
        float:left;

}

.navbar
{
    height:35px;
    width:auto;
    border: 1px solid green;
}
.logo
{
    margin-top:35px;
    float:left;
}

.quickNav
{
    float:right;

}

.container
{
    margin: 0 auto;
    background-color: #fff;
    border: 2px solid #c9c8c8;
    border-bottom: none;
    height:auto;
    overflow:hidden;
    width: 1000px;
    clear:both;
 }

Can anyone see why? I have tried floating the header-bosy-centre and decreasing the width of the header-body-right but nothing works. Can anyone see what I have done wrong? I am out of ideas. Thanks.

  • 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-01T15:53:52+00:00Added an answer on June 1, 2026 at 3:53 pm

    In order to have the elements side by side you must float both elements. This css Floats .header-body-centre left also, causing the elements to appear side by side.

    .header-body-centre
    {
        margin: 0 auto;
        height:100%;
        width:70%;
        float: left;
    }
    

    Your prior styling did not work because of how floated elements behave. When an element is floated it is taken out of the normal flow of the document. It is shifted to the left or right until it touches the edge of it’s containing box or another floated element.

    https://developer.mozilla.org/en/CSS/float

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

Sidebar

Related Questions

say I have a css class name div.TestClass { float:left;etc// } span.SpanTestClass { float:right;etc//
How can I change a div class name when clicking on it? Eg: <div
I have many DIV with the same class name, let save wmplayer. I want
I need to know, how to fetch class name from div instead of id
I have a form element defined as: <div class=field> <div class=name> <label for=User_LastName> Last
I have something like the following <div id=container> <ul id=name_list> <li class=name> <input type=hidden
How can I get an image to stretch the height of a DIV class?
I have some class like this <div class = student> <div class = name>Adam
In this code: soup=BeautifulSoup(program.Description.encode('utf-8')) name=soup.find('div',{'class':'head'}) print name.string.decode('utf-8') error happening when i'm trying to print
I load in a div with class name .preview image's gallery like this: <img

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.