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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:20:08+00:00 2026-05-16T22:20:08+00:00

The box model ought to be simple enough, but I just don’t grok it.

  • 0

The box model ought to be simple enough, but I just don’t grok it.

Here’s a meaningless form

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Box model test</title>
<link type="text/css" rel="stylesheet" href="test.css"> 
</head>
<body style="position:relative; top=0px; left=0px">
<form action="for_submitted.php" method="post">

<fieldset style="top:0px; left: 0px; width: 128px; height: 64px;">
  <legend> </legend>
  <div class="label" style="top:24px;  left: 16px; width: 81px; height: 14px;">Box 1</div>
</fieldset>

<fieldset style="top:0px; left: 128px; width: 128px; height: 64px;">
  <legend> </legend>
  <div class="label" style="top:24px; left: 64px; width: 22px; height: 14px;">Box 2</div>
</fieldset>

<div class="submit_button" style="top:64px; left:64px;"><input type="submit" name="submitButton" 

value="Submit"></div>

</form>
</body>
</html>

and its CSS

body
{
  background-color: white;
  width: 100%;
  position: relative;
}    

.panel, .label, fieldset
{
  position: absolute;
  font: 8px Arial; 
}

.submit_button
{
  position: absolute;
}

and I expect it to show

.---------..---------.
| box 1   | box 2    |
.---------..---------.

but in MSIE8 (which I am compelled to use) and in FireFox, it shows

.--------..--------.
| box 1  || box 2  |
.--------..--------.

why do they overlap?

  • 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-16T22:20:08+00:00Added an answer on May 16, 2026 at 10:20 pm

    There are several problems here. First of all, you need a reset CSS to remove the margin and padding added by the browser’s User Agent stylesheet. Something like Eric Meyer’s will do.

    Secondly, after adding in the reset CSS there still will be some overlapping. This is caused by the borders, the widths of which are not part of width. outline is not affected by this, so I’m using that in the demo below to show that the elements are not actually overlapping, but I won’t recommend using that in place of border. Instead, you should take into account the width of the border when doing your calculations.

    See: http://jsbin.com/ofusa3/edit

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

Sidebar

Related Questions

No related questions found

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.