Results 1 to 6 of 6

Thread: Hello im new to CSS can you check this code?

  1. #1
    Join Date
    Mar 2009
    Posts
    6
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default Hello im new to CSS can you check this code?

    I cant seem to get my p.important { color: red;} to work in the html its <p class = "important">
    p {
    color: blue;

    }

    Body {
    background-color: gray;
    font=family: sans-serif;
    }

    h1 {
    border-bottom: 2px double black;
    }

    h2 {
    Color: blue;
    font=family: sans-serif;
    }
    h3.important {
    background-color: silver;
    color: red;
    font=family: sans-serif;
    }

    ol {
    background-color: silver;
    color: red;
    font=family: sans-serif;
    }

    q {
    color: purple
    }


    em {
    color: aqua;
    }

    strong{
    color: aqua;

    {

    li {
    background-color: silver
    color: red;
    font=family: sans-serif;
    }

    p.important {
    background-color: silver
    color: red;
    font=family: sans-serif;

    }

    p.footer {
    background-color: silver
    color: black;
    font=family: sans-serif;

    }
    Last edited by PSG1JOHN; 03-08-2009 at 04:16 PM.

  2. #2
    Join Date
    Jan 2008
    Posts
    4,167
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    It should be font-family, not font=family.
    Jeremy | jfein.net

  3. #3
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    There were quite a few errors, this should work:
    Code:
    p {
    	color: blue;
    }
    body {
    	background-color: gray;
    	font-family: sans-serif;
    }
    h1 {
    	border-bottom: 2px double black;
    }
    h2 {
    	color: blue;
    	font-family: sans-serif;
    }
    h3.important {
    	background-color: silver;
    	color: red;
    	font-family: sans-serif;
    }
    ol {
    	background-color: silver;
    	color: red;
    	font-family: sans-serif;
    }
    q {
    	color: purple;
    }
    em {
    	color: aqua;
    }
    strong {
    	color: aqua;
    }
    li {
    	background-color: silver;
    	color: red;
    	font-family: sans-serif;
    }
    p.important {
    	background-color: silver;
    	color: red;
    	font-family: sans-serif;
    }
    p.footer {
    	background-color: silver;
    	color: black;
    	font-family: sans-serif;
    }
    You can run your CSS code though the W3 validator to make sure you don't have any errors.

    Good luck!
    Eddy Proca
    I love Dropbox. Get it through my girlfriend's referral link (I reached my limit) and both you and her get 500 MB extra! Thanks and you're welcome!

  4. #4
    Join Date
    Mar 2009
    Posts
    6
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    Thanks a lot you guys for the fast reply on help Smookerman and Nile!

  5. #5
    Join Date
    Jan 2008
    Posts
    4,167
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Glad to help you! Your welcome!
    It seems your topic is solved... Please set the status to resolved.. To do this:
    Go to your first post ->
    Edit your first post ->
    Click "Go Advanced" ->
    Then in the drop down next to the title, select "RESOLVED"
    Jeremy | jfein.net

  6. The Following User Says Thank You to Nile For This Useful Post:

    PSG1JOHN (03-12-2009)

  7. #6
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    You're welcome, glad to help!
    You can go to your first post in this thread, click then click Go Advanced and add the Resolved prefix to the thread title.
    This will let other users know the problem has been solved.

    Also, you might be interested in this CSS tutorial: http://www.howtocreate.co.uk/tutorials/css/introduction

    Good luck!
    Eddy Proca
    I love Dropbox. Get it through my girlfriend's referral link (I reached my limit) and both you and her get 500 MB extra! Thanks and you're welcome!

  8. The Following User Says Thank You to Snookerman For This Useful Post:

    PSG1JOHN (03-12-2009)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •