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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:14:22+00:00 2026-06-12T08:14:22+00:00

I have the following DIV structure: <style> #header{border-bottom:1px solid blue;} #footer{botter-top:1px solid blue;} #header,#footer{height:15%;}

  • 0

I have the following DIV structure:

<style>
#header{border-bottom:1px solid blue;}
#footer{botter-top:1px solid blue;}
#header,#footer{height:15%;}
#content{height:70%;}
#header,#footer,#content{width:100%;}
</style>

<div id="header"></div>
<div id="content"></div>
<div id="footer"></div>

What I’m noticing is that in desktop browsers, there is an expected overflow with a 2px+ offset from 100%
However, in mobile browsers, there does not seem to be any overflow / scrolling.

  • Do mobile devices count borders as part of the 100% height/width calculations?

If so:

  • Is there a way to invoke this behavoir through CSS for desktop browsers?
  • Is there a way to reverse this behavoir through CSS for mobile browsers?
  • 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-12T08:14:23+00:00Added an answer on June 12, 2026 at 8:14 am

    So yes, desktop browsers will see a 2px offset, because the spec says take 100% of the parent + border + margin. The mobile browsers don’t seem to be affected, but mostly because they are trying to autofit content to the window to eliminate scrolling.

    There are 2 css3 fixes, the first being to use the new box-sizing property, and setting it to border-box. The second is to use the flexbox model. But unfortunately older browsers may not support either of these solutions.

    So I would use box-sizing, but put an IE conditional statement in to account for IE7 and back, and just use javascript or a css hack to fix it.

    edit

    here is the solution using box-sizing http://jsfiddle.net/aaFHZ/

    body, html {height:100%; width: 100%;}
    #header{border-bottom:1px solid blue;}
    #footer{border-top:1px solid blue;}
    #header,#footer{height:15%;}
    #content{height:70%;}
    #header,#footer,#content{width:100%; box-sizing:border-box;}
    

    and here is the solution with flexbox (note: this will only work on the most current browsers) http://jsfiddle.net/YkSYN/1/

    <style>
    body, html {height:100%; width: 100%;}
    #header{border-bottom:1px solid blue;}
    #footer{border-top:1px solid blue;}
    #header,#footer {
        -webkit-box-flex: 15;
        -moz-box-flex: 15;
        box-flex: 15;}
    #content {
        -webkit-box-flex: 70;
        -moz-box-flex: 70;
        box-flex: 70;}
    #header,#footer,#content{width:100%;}
    #wrapper {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        display: -moz-box;
        -moz-box-orient: vertical;
        display: box;
        box-orient: vertical;
        width: 100%; 
        height:100%;}
    </style>
    <div id="wrapper">
        <div id="header"></div>
        <div id="content"></div>
        <div id="footer"></div>
    </div>​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following html structure <div style=overflow-x:auto;overflow-y:hidden;position:relative> <div style=position:absolute; top:0;bottom:0;padding-top:30px> </div> </div> When
I have the following structure in my html : <div style='position:absolute; top:40px; left:0; height:cH;
Say I have the following structure: <div id=top style=width:960px; height:400px; margin 0 auto; background-color:#F00;>
I have a following div structure <div id=wrapper> <div id=header> <div id=storeFinder> /* html
I have the following structure: <div id=content-header> <h1 id=title>Athletics Calendar</h1> </div> and the following
I have the following structure: <div id=container> <div id=someid1 style=float:right></div> <div id=someid2 style=float:right></div> <div
I have the following structure: <div class=feed-item style=position:relative; id=feed-611 onmouseover=showDelete() onmouseout=hideDelete()> <div class=feed-avatar> AVATAR
i have following html structure. <p class=expandableContent ><span class=label>Computer and Laptop Repairs</span></p> <div style=clear:
I have following html site structure: <body> <div id=header></div> <div id=container> <div id=util_header></div> <div
I have some HTML with the following approximate structure and positioning: <div class=grand-parent style=position:

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.