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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:39:53+00:00 2026-06-12T21:39:53+00:00

Possible Duplicate: why is my content showing outside the div? I have a problem

  • 0

Possible Duplicate:
why is my content showing outside the div?

I have a problem where the background style for a div doesn’t cover everything nested inside the div.

Here is a jsfiddle to show you exactly what I’m talking about

How can I make the grey background style from the div ddg-corner-statements apply to everything inside the div without setting an absolute height?

  • 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-12T21:39:54+00:00Added an answer on June 12, 2026 at 9:39 pm

    This is a common issue when working with floats. There are a couple of common solutions:

    1. Add a div after the floats with clear: both. Example.

      <div style="float: left"></div>
      <div style="float: left"></div>
      <div style="clear: both"></div>
      
    2. Add the two floats into a container with the CSS attribute overflow: auto. Example.

      <div style="overflow: auto">
          <div style="float: left"></div>
          <div style="float: left"></div>
      </div>
      
    3. Make the parent element a float. Example.

      <div style="float: left">
          <div style="float: left"></div>
          <div style="float: left"></div>
      </div>
      
    4. Use the :after CSS pseudo element. Example.

      .parentelement:after {
          content: ".";
          display: block;
          height: 0; 
          clear: both; 
          visibility: hidden;
      }
      
    5. Adding a set height to the parent element. Example.

      <div style="height: 200px">
          <div style="float: left"></div>
          <div style="float: left"></div>
      </div>
      

    Personally, I use option 2 for simplicity and semantics’ sake

    See an updated version of your code here.

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

Sidebar

Related Questions

Possible Duplicate: Detect element content changes with jQuery I have a wrapper div say
Possible Duplicate: Detect element content changes with jQuery I have a div with a
Possible Duplicate: Regex for matching javadoc fragments I have files having content like /**
Possible Duplicate: jquery/ajax load new content when available i have a table named news
Possible Duplicate: PHP Regular express to remove <h1> tags (and their content) I have
Possible Duplicate: Using C# regular expressions to remove HTML tags Extract Content from Div
Possible Duplicate: Getting DIV content with Regular Expression Let me first tell you that
Possible Duplicate: Getting the Specified content into the buffer in c I have a
Possible Duplicate: Parse XML with Namespace using SimpleXML PHP SimpleXML Namespace Problem <?php header(Content-Type:
Possible Duplicate: NSMutableArray Not showing actual values when NSLog in iphone application I have

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.