Jump to content

Recommended Posts

Posted

Hi all!

 

I am a newbie with CSS and actually not very asvvy.

I got this new full css template and would like to be able to change the background color on which the website "sits".

 

Originally the background color was within the html coding of every page like this: (I have deleted this, because I thought it is otherwise over writing the stylesheet command for the color?)

 

 

Now I would like to put the background color into the style sheet, so I can change the color site-wide, if required. The code in the style sheet is:

#container {

width: 950px;

margin-right: auto;

margin-left: auto;

background-color: white;

border: thin;

border-color: #a9a9a9;

border-style: solid;

}

#body{

margin: 0px;

padding: 0px;

font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;

font-size: 13px;

color: black;

}

 

What needs to be altered in the style sheet and what would I need to put onto the page source code??

 

Thanks in advance for your help and advice,

 

new-to-css

Posted

i think all you have to do is add background-color to #body.

 

#body{

margin: 0px;

padding: 0px;

font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;

font-size: 13px;

color: black;

background-color: silver

}

 

 

and to link a web page to the style sheet, you need to add:

 

 

where style.css is the name of your css file. this line needs to go the head tags. for example:

 

Your Page

 

 

hope this helps. you should check out w3school's site. it is full of helpful tutorials.

Posted

1st) Remove (background-color: rgb(255, 255, 0); direction: ltr;) from your

tag in the html.

 

2nd) Add it to your style sheet......... body {background-color: rgb(255, 255, 0);} you should not need the direction: ltr;

 

As jlhaslip mentioned, remove the hash mark from in front of body. Do you have an id set for container, if not remove the hash mark there also.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...