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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:10:45+00:00 2026-05-31T18:10:45+00:00

I have two div -elements, the top one has the height of 40% and

  • 0

I have two div-elements, the top one has the height of 40% and the other one 60%.
In my example I have positioned the first one to top: 0; and the second one to bottom: 0;. My issue is that I get a 1px distance between them in Webkit, sometimes!

I have created a jsFiddle that recreates the issue in Webkit (Safari and Chrome, but works fine in Firefox.)

http://jsfiddle.net/bVxDA/ (Resize the window to see the bug in action)

This is the code I’m using.

HTML

<div id="cover-top"></div>
<div id="cover-bottom"></div>​

CSS

html, body {
    background: red;
    height: 100%;
}

#cover-top,
#cover-bottom {
    background: #000;
    position: absolute;
    width: 100%;
}

#cover-top {
    height: 40%;
    top: 0;
}

#cover-bottom {
    height: 60%;
    bottom: 0;
}

​
I would be fine with a solution that uses JavaScript or jQuery.

  • 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-31T18:10:47+00:00Added an answer on May 31, 2026 at 6:10 pm

    If the height of html, body height is an odd number there is a 1px line “remainder”.

    Webkit can’t divide 1px and doesn’t try.

    See: http://jsfiddle.net/iambriansreed/gPu3Y/

    You could make the 1px line disappear if you set the following:

    #cover-bottom {
        height: auto;
        top: 40%;
        bottom: 0;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two div's one has textbox in it and other just plain text.
I have two div elements, box_1 and box_2: <div id="box_1" style="position:absolute;top:0;left:0;width:500px;height:500px;border:1px solid gray;z-index:2;"> </div>
So I have two div elements on my page, one directly on top of
I have two DIV elements. HTML looks like this: <div id=first><div id=second></div></div> The CSS
Hi I have some elements like these: <div id=one>content</div> <div id=two>content</div> and a corrispondent
I have two div elements that are twins (i.e. their dimensions and contents are
The scenario is I have two div s: one is where I select items
I have one parent DIV inside parent DIV i have two DIV one in
I do slider on the website. On one slide I have two div. The
How to wrap one div around another? I have following two div ids: #course

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.