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

  • Home
  • SEARCH
  • 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 145007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:20:49+00:00 2026-05-11T08:20:49+00:00

I have the following HTML and I would like to display a blue background

  • 0

I have the following HTML and I would like to display a blue background behind the buttons and text. Unfortunately, with the following code, the blue background disappear. If I remove the CSS for the ids buttons and text, the background is back.

What am I doing wrong?

Thanks!

<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'> <html xmlns='http://www.w3.org/1999/xhtml' > <head>     <title>Untitled Page</title>     <style>       #actions     {         background: blue;     }      #buttons     {         float: left;     }      #text      {         float: right;     }      </style> </head> <body>          <div id='actions'>             <div id='buttons'>                 <input type='button' id='btnOne' value='Bla bla' />                 <input type='button' id='btnTwo' value='Bla bla bls' />             </div>             <div id='text'>Bla bla bla</div>         </div>  </body> </html> 
  • 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. 2026-05-11T08:20:50+00:00Added an answer on May 11, 2026 at 8:20 am

    You have to ‘clear’ your floats. Floating elements takes them out of the normal block positioning of the page, so an element that is floated right breaks out of the parent container, collapsing the div. You can clear them, or the more concise and clever way is to add ‘overflow: auto’ to the parent container:

    #actions {     background: blue; overflow: auto; }  #buttons {     float: left;     overflow: hidden; }  #text  {     float: right;     overflow: hidden; } 

    Since ‘overflow: auto’ can produce scrollbars in certain instances, I usually explicitly prevent that by specifying ‘overflow: hidden’ on children elements. This works reliably in my experience.

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

Sidebar

Related Questions

So I have some HTML text that I would like to display in a
I have the following HTML: <div id=mydiv> </div> I would like to load content
I would like to have the following kind of HTML: <header></header> <div id='main'></div> <footer></footer>
I have the following html code: <input type=text id=theInput value=/> <a href=# id=theLink>Click me</a>
I have the following HTML/CSS code in which a line of text is shown
I have following HTML: <div class=olympics style=display: block; position: absolute; left: 250px; top: px;>
I have the following html : <div class=mainmenu> <ul class=blue> <li class=><a href=tst/ id=a1_up><span
I have the following html and css code: <!DOCTYPE HTML> <html> <head> </head> <body>
I have the following html code: <div class=outer ui-draggable style=position: relative;> <div class=inner>Foo bar</div>
I would like to have a list of clients in a separate HTML file

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.