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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:40:00+00:00 2026-06-12T22:40:00+00:00

I am learning HTML and CSS, and I want to create a fixed-width page

  • 0

I am learning HTML and CSS, and I want to create a fixed-width page which has a silver background color. I also want the background color outside of the fixed-width area to be black.

The problem is that there is a small black gap above the fixed-width area (above the heading), and I would like to remove this black gap, so that it’s replaced with silver color.

How do I solve this?

HTML:

<!DOCTYPE html>
<html>
    <head>
        <title>Welcome to my Homepage</title>
        <link href="style.css" rel="stylesheet" type="text/css">
    </head>

    <body>
        <div class="main">
            <h1>Welcome to my homepage.</h1>
            <p>This is just a test.</p>
        </div>
    </body>
</html>

CSS:

body {background-color: #000000;}
.main {
    width: 640px;
    margin: 0 auto;
    background-color: silver;
}
  • 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-12T22:40:01+00:00Added an answer on June 12, 2026 at 10:40 pm

    try

    body {padding:0; margin:0; background-color:#000; }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am learning HTML and want to use an external CSS for my site.
I am learning how to use HTML and css, and want to add a
I'm a fairly inexperienced web designer learning css/html on the fly for a company's
I have been learning css & jquery. <!DOCTYPE html> <html> <head> <style type=text/css> #box
I'm learning PHP. The PHP has inline commands in HTML code to produce dynamic
I am learning knokcout.js I was using the example in http://www.knockmeout.net/2011/04/utility-functions-in-knockoutjs.html , which is
I know HTML&Css, Little Javascript & Little PHP. I really want to get in
I just learned ruby, and already have some html/javascript/css background. When i learn rails
Okay so i'm learning html right now and soon css. In my html coding
I'm learning CSS and html and am stuck on retaining the look of the

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.