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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:13:36+00:00 2026-06-05T12:13:36+00:00

My HTML: div.container My CSS: html, body { height: 100%; background-color: red; padding-left: 0px;

  • 0

My HTML:

div.container

My CSS:

html, body {
  height: 100%;
  background-color: red;
  padding-left: 0px;
  padding-right: 0px;
}    
.container {
  height: 100%;
  background-color: blue;
  margin-top: 5px;
  *zoom: 1;
}

I want to use height=100% and DO NOT want to use overflow=hidden.

Which CSS properties I should use above so that I can have EFFECT OF margin-top for container div above which will not create vertical scroll-bar.

Just Imagine:

* Body with color red
* A div container in body and I want to see the margin of "x" px on top bewteen body and conatiner
* Color of div container blue
* No scrollbars and No overflow="hidden"

Please help

How can I accomplish this? Please help

  • 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-05T12:13:39+00:00Added an answer on June 5, 2026 at 12:13 pm

    Try this CSS

    *{
        margin:0;
        padding:0;
    }
    html, body {
        -moz-box-sizing:border-box;
        -webkit-box-sizing:border-box;
        box-sizing:border-box;
        height: 100%;
        background-color: red;
        padding-top:5px;
    }    
    .container {
        height: 100%;
        background-color: blue;
        *zoom: 1;
    }
    

    First reset all margin and padding.
    box-sizing:border-box; means the size of an element will stay the same no matter how much padding you add to it.

    You could also use an absolute positioned div for the red bar.

    HTML

    <div class="red-bar"></div>
    <div class="content"></div>  
    

    CSS

    .red-bar{ position:absolute; width:100%; height:5px; top:0; background:red; }
    .content{ height:100%; background:blue; }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given the following HTML: <body><div class=container></div></body> and CSS: body { background-color: #e9f9e9; } .container
The following html and css shows two divs inside a container. The left div
<html> <head> <style type=text/css> body { background-color: #000000; font-family: Arial, Helvetica, sans-serif; font-size: 20px;
Here's a puzzle. Basic page, one element: http://jsfiddle.net/PZj6t/ HTML: <div id=container></div>​ CSS: body, html
I am using the following CSS for a container DIV with height of html
i'm trying to insert an image in a div container using css and html,
http://subzerostudio.com/temp/verticalscroller/temp.html I want this scroll to effect the div#container instead of the body,html but
I have a two column layout: <html> <head></head> <body> <div id=container> <div id=header></div> <div
Here is the html: <body> <div id=container> <div id=banner> </div> <div id=navigation> <a href=index.html><img
Can anyone please tell me how to write a small div container in HTML

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.