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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:42:30+00:00 2026-06-04T05:42:30+00:00

Simple problem: By default, for example, when I have a file like this: <html>

  • 0

Simple problem:

By default, for example, when I have a file like this:

<html>
  <div style="backgroundcolor:red;height:25px;width:100%;">
  </div>
</html>

I get a div that has margins of about 10px from the edges of the window – there is white space that basically cannot be filled even with text.

But when I do this:

<html>
  <div style="backgroundcolor:red;height:25px;width:100%;position:absolute;top:0;left:0;">
  </div>
</html>

I have it touching the edges of the window – no white space.

I want to get rid of the white space because I have a centered window that grows to 100% width and because of the invisible margin on the left, it extends farther to the right and causes the white space on both sides to be asymmetrical.

I don’t want to use absolute positioning because the div I am expanding is centered, and absolute positioning in general is pretty messy.

  • 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-04T05:42:32+00:00Added an answer on June 4, 2026 at 5:42 am

    The body element (which is present whether you explicitly include it or not) typically has a default margin applied to it, which can be removed with this CSS:

    body { margin: 0; }

    You should also start your source with a doctype declaration, such as <!doctype html>, and ensure your HTML is valid, as well as your CSS.

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

Sidebar

Related Questions

I have an xml file which looks like the below example <Ids> <Id> <set>ai</set>
I'm new on boost.asio. I have a problem when I try a simple example.
I have this two lines of html code... <div id=slider1 data-param1=XXX data-param2=XXX></div> <script src=script.js
simple problem with a simple question. I have a string, in C# i can
This simple problem is kiling me. I posted something earlier about trying to clean
I got a simple problem in SQLAlchemy. I have one model in a table,
This is such a simple problem, but I can't find an answer anywhere... I
I have a very simple problem but cannot find a nice solution. I have
a possibly simple problem, but weird why I have no idea how to do
I have a seemingly simple problem whereby I wish to reconcile two lists so

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.