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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:56:40+00:00 2026-05-26T05:56:40+00:00

I get a weird problem with the div tags actually these div tags are

  • 0

I get a weird problem with the div tags actually these div tags are aligned and grouped in a single container but the problem something really stupid here is my code

<html>
<head>
<style>
    body {
        padding: 0 2%;
    }
    #footer {
     width: 100 %;
        clear: both;
        border: 1px solid #CCC;
    }
    #footer .col_one {
        float: left;
        width: 25%;
        border: 1px solid #CCC;
    }
    #footer .col_two {
        float: left;
        width: 25%;
        border: 1px solid #CCC;
    }
    #footer .col_three {
        float: left;
        width: 24%;
        border: 1px solid #CCC;
    }
    #footer .col_four {
        float: left;
        width: 25%;
        border: 1px solid #CCC;
    }
</style>
</head>
<body>
    <div id="footer">
        <div class="col_one">
            &nbsp; something here
        </div>
        <div class="col_two">
            &nbsp; something here
        </div>
        <div class="col_three">
            &nbsp; something here
        </div>
        <div class="col_four">
            &nbsp; something here
        </div>
        <div style="clear: both">
        </div>
    </div>
</body>
</html>

Now in the #footer .col_three when I make the width to 24% they display all the boxes in right order but then I make it 25% the last one goes just below the first box why is that so? The total footer container is 100% and there are four div boxes made 25% each in width where am I wrong hope you understand and sorry for bad english.

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

    That’s because the width you set, is the width of the content, excluding padding, margin and borders. So the total width is 100% + 8px (for 1px borders on each side of 4 divs). Therefor it won’t fit.

    You can solve this by putting extra divs in the div. The outer div you make 25% wide without borders. The inner div, you can give a border, but no explicit width, so it will fill its parent:

    http://jsfiddle.net/GolezTrol/fm7LV/1/

    I took the liberty of modifying the selectors a little by putting separate classes on those divs: col one instead of col_one. That way, you can use the .col selector for all columns and the .col.one selector in case you need to style a specific column. 🙂

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

Sidebar

Related Questions

I've a weird string escape problem with my PHP script. I'm trying to get
I dunno guys, this is a really weird one, but I might just be
Going through a weird problem here. I am trying to get the date of
ive got a really weird problem. i have no clue why its not working.
I yet again have a super weird problem. I get different outputs whether I'm
I am having a weird problem here, and I am really stuck, need to
i have this really weired js problem. in summary, i get a element not
I have a weird problem , below are two simple get calls and returning
I'm working with jQuery's .get() function and I'm having a very weird problem using
I've got a really weird problem with ZF (at least for ZF newbie): I

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.