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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:31:31+00:00 2026-06-03T21:31:31+00:00

I have been coding a website using html and css, and recently I’ve come

  • 0

I have been coding a website using html and css, and recently I’ve come to need a div element with a background color. I put in background-color: gray;, but that didn’t work. I used the inspect element feature of Google Chrome, and it says that Chrome doesn’t recognize the element. I used the same feature in Firefox, and it fails to recognize the css element either. The div contains three floating sections, but it uses overflow: auto, so that is not the problem. Can someone explain to me why I can’t add background color to my divs?

html:

<div id="main">
        <header>
        <h1>LOGO</h1>
        <nav>
            <a href="index.html" title="Home">Home</a>
            <a href="about.html" title="About">About</a>
            <a href="features.html" title="Features">Features</a>
            <a href="specs.html" title="Specifications">Specs</a>
            <a href="updates.html" title="Updates">Updates</a>
            <a href="contact.html" title="Contact Us">Contact</a>
        </nav>
        </header>

        <section class="left">
        <h2>NEWS</h2>
        <p>Itate eaquid quodit, utem dolorenihit ullore ides est faccum simaiorrum accaerf erfercim voloremod ut volectem con cus, temoluptatur as disquatent.</p>
        </section>

        <section class="right">
        <h2>SOMETHING</h2>
        <p>Itate eaquid quodit, utem dolorenihit ullore ides est faccum simaiorrum accaerf erfercim voloremod ut volectem con cus, temoluptatur as disquatent.</p>
        </section>

        <section class="right">
        <h2>SOMETHING</h2>
        <p>Itate eaquid quodit, utem dolorenihit ullore ides est faccum
simaiorrum accaerf erfercim voloremod ut volectem con cus,
temoluptatur as disquatent.</p>
        </section>
    </div>

css:

#main {
    backgound: gray;
    layer-background: gray;
    overflow: auto;
    border: 2px dashed black;

    border-radius: 15px;
    -moz-border-radius: 15px;
}

section {
    background-color: green;
    text-align: justify;
    margin: 5px;
    padding 10px;

    border-radius: 10px;
    -moz-border-radius: 10px;
}
  • 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-03T21:31:32+00:00Added an answer on June 3, 2026 at 9:31 pm

    In this part of your CSS:

    #main {
        backgound: gray;
        layer-background: gray;
    
        /* .. */
    }
    

    backgound should be background, and layer-background is not a CSS property.

    With those mistakes fixed, what you have works.

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

Sidebar

Related Questions

I've been coding a website for the past 6 months using HTML/CSS/PHP/MySQL/Javascript. I'm coding
I have been recently overhauling a website I built for the company I work
I've just recently started learning HTML/CSS and I've been trying to teach myself sound
I am using a separate print css on our website. It's been requested that
Recently, I have been building a website and I really want to have a
I have been heavily relying on CSS for a website that I am working
Lately I have been designing and coding a website for one of my clients.
I have been coding regurlarly in C++ in the past months. I am getting
Ive never heard of this before, and I have been coding in PHP for
I've been coding a very sizable project and I have run into trouble with

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.