It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming CSS Forum

Help!!!!

Help!!!!

Postby Pavanne on Thu Sep 28, 2006 1:42 pm

Hi there. I've just started learning CSS and have come across a problem with my first external style sheet.

Its VERY basic so I can't work out what is happening. The contents of my CSS file are below. All commands are carried out on my page except the body set styles.

Can anybody tell me what I'm doing wrong, please?

<style type="text/css">
body{background: black; color: white}
h1{color: teal}
p.copyright{font-family:arial; font size: 12px; color:yellow}
.warning {font-family:arial; font-size: 16px; color:red}
</style>
Pavanne
 
Posts: 10
Joined: Sun Sep 24, 2006 9:16 pm

Postby johneva on Thu Sep 28, 2006 2:37 pm

Yeah a CSS file should not contain any HTML tags.

Remove the style tags and it should work, assuming you have done the HTML file correctly.
Image
Only God Can Judge Me.
User avatar
johneva
500+ Club
 
Posts: 565
Joined: Sat Oct 29, 2005 1:16 pm
Location: Stafford, England

Postby johneva on Thu Sep 28, 2006 2:41 pm

Yeah a CSS file should not contain any HTML tags.

Remove the style tags and it should work, assuming you have done the HTML file correctly.

BTW your also missing the ; from the end of each line.


I also like to arrange my CSS file like so, it makes it so much easyer to read/edit and create.
Code: Select all
body  {
     background: black;
     color: white;
}

h1  {
     color: teal;
}

p.copyright  {
      font-family:arial;
      font size: 12px;
      color:yellow;
}

.warning {
     font-family:arial;
     font-size: 16px;         
     color:red;
}
Image
Only God Can Judge Me.
User avatar
johneva
500+ Club
 
Posts: 565
Joined: Sat Oct 29, 2005 1:16 pm
Location: Stafford, England

Postby Pavanne on Thu Sep 28, 2006 4:01 pm

Brilliant! Thanks!!! It works now.

Am I correct that those style tags and just for internal style sheets?

Thanks again.
Pavanne
 
Posts: 10
Joined: Sun Sep 24, 2006 9:16 pm

Postby johneva on Thu Sep 28, 2006 6:01 pm

Yeah style tags are only needed when making internal style sheets.
Image
Only God Can Judge Me.
User avatar
johneva
500+ Club
 
Posts: 565
Joined: Sat Oct 29, 2005 1:16 pm
Location: Stafford, England


Who is online

Users browsing this forum: No registered users and 1 guest