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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:09:17+00:00 2026-06-14T09:09:17+00:00

A lot of people’s HTML markup looks like this: <html> <body> <div id=wrapper> <p>Stuff

  • 0

A lot of people’s HTML markup looks like this:

<html>
  <body>
    <div id="wrapper">
      <p>Stuff in here</p>
    </div>
  </body>
</html>

And most of the time in examples here, or on the web, people suggest that you should apply width settings to the #wrapper, instead of the <body>.

Is there an underlying reason for that?

For example, in an article on techniques for gracefully degrading media queries, and to give you some context on Technique 1: Do Nothing:

The elephant in the room is Internet Explorer for the desktop.
With a mobile-first solution, large screens will display the content
in one column, resulting in a painful reading experience for the user,
way past the established maximum for comfort: 50 to 75 characters.
It might be worth setting a max-width property in your main container and then upping that max-width in a media query.

And their CSS:

#wrapper {
 _width: 460px; /* Take that, IE6! */
 max-width: 460px;
}

@media only screen and (width) {

#wrapper {
  max-width: 1200px;
 } 
}

Here’s how it’d come together for IE (media query is commented out).

Would there be any difference whereby instead of applying that to #wrapper, we would apply it to <body> — with the standard website in mind?

Any potential bugs? I tried it here, and it seems to be OK. Just what if the layout gets more advanced…

  • 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-14T09:09:18+00:00Added an answer on June 14, 2026 at 9:09 am

    Well, you want to use as few elements as possible I guess. However there are many instances where #page-wrapper and body are not interchangeable. In many situations you need to use the body as the background color instead of the html tag. In these cases (weighted footers for example) you need the body to stretch out the html and you need a wrapper to contain the content, maybe center the content, and force the body to stretch out and contain it.

    So – I guess I would say, that most people use a wrapper because they saw it in their first class or online tutorial. I think that for the most part, it is a habit for many. I would leave the body as is and margin the wrapper to 0 auto and use a max width like you have. It’s just EI 8 and before – can I use media queries ? – maybe you should detect EI 8 and make a unique style sheet. I find that after defining everything for mobil, my media queries are only a few lines of iteration after that –

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

Sidebar

Related Questions

It seems like a lot of people here and on many programmer wikis/blogs/ect. elsewhere
probably there are a lot of people who will smile reading this question... Here's
I see a lot of people specify them like this. protected $myVar; protected $mySecondVar;
This might sound like a trivial question to a lot of people, but since
It seems like a lot of people struggle with date/time issues in PHP, and
Here a lot of people are confused, Normal class stores its data in the
I see a lot of people in blog posts and here on SO either
I see a lot of people doing this Object.prototype.foo = 'HALLO'; var hash =
I see a lot of people have this problem, but none answer I found
I heard a lot of people saying that java is slow comparing .net, like

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.