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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:04:10+00:00 2026-06-13T06:04:10+00:00

I am new to CSS so please don’t be to harsh on me. I

  • 0

I am new to CSS so please don’t be to harsh on me. I am trying to place the yellow background DIV right below the “Header” DIV, but for some reason, it seems to place a padding before and after and I don’t really understand why. If I remove the list, than the problem disappears.

This is the HTML code:

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CSS</title>
<link rel = "stylesheet" type="text/css" href="css.css" />
</head>
<body>
<div id="headerDiv">
    <p>Header</p>
</div>
<div id="listDiv">
    <ul>
<li>Menu item 1</li> 
      <li>Menu item 1</li> 
      <li>Menu item 1</li> 
      <li>Menu item 1</li> 
    </ul>
</div>
<div id="mainviewDiv">
Main View
</div>
<div id="footerDiv">
Footer
</div>

</body>

And this is the CSS:

@charset "utf-8";
/* CSS Document */

div#headerDiv { background-color:#F00;
         height:100px;
         position:relative;
         }

div#listDiv {background-color:#FF0;
        }

div#listDiv ul {list-style-type:none;}

div#listDiv li { display:inline;}

div#mainviewDiv {background-color:#060;}

div#footerDiv {background-color:#999;}

enter image description here

  • 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-13T06:04:10+00:00Added an answer on June 13, 2026 at 6:04 am

    I don’t know if you have tried this, but adding this to the top of your CSS file might help you out:

    *{
        margin:0;
        padding:0;
    }
    

    But when you publish your website use Eric Myers CSS reset

    And like Maxime Morin said, you might want to check out http://nicolasgallagher.com/about-normalize-css/

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

Sidebar

Related Questions

Hi I am new to css media queries so please bear with me, but
I am new in CSS so please help me in this problem. I hope
I am new to css and web design so please be gentle ;-) I
I'm new to CSS and I'm trying to read the code that comes with
I am pretty new at CSS but have been learning, doing my moms small
I am quite new to the world of CSS, and I've been trying to
I'm trying to place images from a div to a span . The result
I'm extremely new to using jQuery/JavaScript, so please don't judge me if this is
I am very new to CSS/Jquery so please forgive the assumed simplicity of this
How to add new css class or id and then write properties for 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.