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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T20:33:41+00:00 2026-05-20T20:33:41+00:00

html { margin:0; padding:0; background-color:#006600; border-style:solid; } /*Dark Green*/ body { margin:0; padding:0; background-color:#660000;

  • 0
html { margin:0; padding:0; background-color:#006600; border-style:solid;  } /*Dark Green*/
body { margin:0; padding:0; background-color:#660000; border-style:dotted; } /*Dark Brown*/

<html>
    <body>
      test
    </body> 
</html>

Why does the background-color of html tag extend the full window but the border-style of the tag remain confined just outside the body box border.

  • 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-20T20:33:42+00:00Added an answer on May 20, 2026 at 8:33 pm

    Specifying the right amount of height and width should solve your problem.
    Try it with appropriate values of height and width.


    See this link : Understanding the HTML versus BODY Element in CSS

    The html and body elements are
    distinct block-level entities, in a
    parent/child relationship.
    The html
    element’s height and width are
    controlled by the browser window.

    The body element is (by default)
    position:static, which means that
    positioned children of it are
    positioned relative to the html
    element’s coordinate system.

    In
    almost all modern browsers, the
    built-in offset from the edge of the
    page is applied through a margin on
    the body element, not padding on the
    html element.

    Hope you get some idea to your doubt.

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

Sidebar

Related Questions

<html> <head> <style type=text/css rel=stylesheet> * {margin:0;padding:0;} div#box {background-color:green;width:1000px;} /* #box {position:absolute;top:0;right:0;} */ /*
<html style=margin:0px 0px 0px 0px;padding:0px 0px 0px 0px;> <body style=height:100%;width:100%;> <div style=height:20px;background-color:red;></div> <div style=background-color:black;></div>
HTML: <div> <p></p> </div> CSS: div { background-color:green; border-top:1px solid white; } p {
<html> <head> <title> Learning CSS </title> <style type=text/css> #header { padding:1px; margin:1px; border:1px solid
<html> <head> <style> * { margin:0; border:0; padding:0; } div { height:500px; } #container
outline-style: none; margin: 0px; padding: 2px; background-color: #eff0f8; color: #3b3a39; font-family: Georgia,'Times New Roman',Times,serif;
With this css .addProblemClass{ width:300px; height:300px; /*width:25%; height:40%;*/ border:solid 1px #000000; margin: 5px; background-color:#FFFFFF;
<div id=content> <div id=header> </div> <div id=main-content> </div> </div> html, body{height:100%;margin: 0px; padding: 0px;
I want to change the background-color of the body of my HTML document. My
In the code below: <html> <head> <style type=text/css> ul { list-style-type:none; margin:0; padding:0; }

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.