WC3 Validator give error, how to solve it?

Discussion in 'CSS' started by kuman, Mar 27, 2008.

  1. #1
    this is my first post here.. be gentle ok guy.. :D

    ok guys...

    i manage to solve some of the error .. But now I’m left with 5 errors that i have no idea on how to solve it...

    Here is the link to the WC3 Validator for my page http://validator.w3.org/check?uri=http%3A%2F%2Fkumanworks.110mb.com%2FVersion2%2Findex.htm&charset=%28detect+automatically%29&doctype=Inline&group=0


    below is the html and the css for the particular error..

    HTML
    				 <div id="newsbox">
    				 <div id="datebox">
    				 <div align="center">Mar 25, 2008</div>
    		     	 </div>
    				 <div align="center"><strong>NEWS</strong></div>
     		For starters, i'm in the process of re-doing/converting all my previous website content to the current format. 
    		Hopefully this wont take that long else you guys will be bored to death from waiting for the updates.
    		     	 </div>
    
    				 <div id="newsbox">
    				 <div id="datebox">
    				 <div align="center">Mar 25, 2008</div>
    		     	 </div>
    				 <div align="center"><strong>NEWS</strong></div>
     		For starters, i'm in the process of re-doing/converting all my previous website content to the current format. 
    		Hopefully this wont take that long else you guys will be bored to death from waiting for the updates.
    		     	 </div>
    Code (markup):
    the CSS
    #newsbox {
    background-image: url('images/updatebox.png');
    background-repeat: repeat-x;
    float:none;
    margin-top:20px;
    margin-right: 20px;
    margin-bottom: 20px;
    width: 865px;
    border:2px solid #3aa2f9; /*#d2d7e4*/
    text-align:center;
    font-size:80%; /* font size in the box */
    }
    #newsbox strong{
    color:#FF0033;
    }
    
    
    #datebox {
    float:left;
    margin-top:20px;
    width: 70px;
    height:50px;
    text-align:left;
    font-size:80%; /* font size in the box */
    font-weight:bold;
    color:#FF0000;
    border-right:1px solid #FF0000;
    }
    Code (markup):
    and the website...
    http://kumanworks.110mb.com/Version2/index.htm

    all the help is greatly appreciated.

    thanks guys

    kuman;)
     
    kuman, Mar 27, 2008 IP
  2. blueparukia

    blueparukia Well-Known Member

    Messages:
    1,564
    Likes Received:
    71
    Best Answers:
    7
    Trophy Points:
    160
    #2
    Replace id="" with class="". Then in your CSS, find any mention of "#newsbox", "#datebox" and #updatebox and replacethem with ".newsbox", ".datebox" and ."updatebox".

    Id's can only be used ONCE, classes can be used multiple times.
     
    blueparukia, Mar 27, 2008 IP
  3. kuman

    kuman Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thank you very much!!:):D

    such a fast reply and it helps...

    now i know the difference between "id" and "class"

    now its already ok and thank you so much again for the help..

    i'll be back with more questions since i just started using CSS last couple of weeks..

    :D
    cheers

    kuman
     
    kuman, Mar 27, 2008 IP
  4. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #4
    The general rule of thumb goes something like this:

    The big main boxes on your page, of which there's only one of (like, header, main, wrapper, sidebar, footer, menu) generally get an id, while a class is when you have a group of things (like li's inside a ul) and you want one or more of them to do something or show something different. Be aware that if everything or almost everything in a box has a class, esp the same class, you're prolly doing something wrong (although it will work). : )
     
    Stomme poes, Mar 27, 2008 IP