stupid validation question

Discussion in 'HTML & Website Design' started by dean5000v, Oct 6, 2008.

  1. #1
    well when trying to validate i get this error.

    …eader"><div id="logo"><a href="#"><img src="logo.gif"></a></div></div></div>

    ✉

    The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.

    Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.

    now im guessing it's not likeing me putting a image as a link, i tried doing /> but it didn't work anyone got any ideas ?
     
    dean5000v, Oct 6, 2008 IP
  2. Danives

    Danives Member

    Messages:
    42
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    48
    #2
    What type of validation are you going for? Transistional, Strict etc? I know that sometimes they are funny about img tags, and that they need to have an 'alt' parameter (although I think that may only be strict XHTML). You can leave the parameter blank though, so it would look like:

    …eader"><div id="logo"><a href="#"><img src="logo.gif" alt="" /></a></div></div></div>

    Hope that helps!

    Dan
     
    Danives, Oct 6, 2008 IP
  3. nfd2005

    nfd2005 Well-Known Member

    Messages:
    295
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    130
    #3
    Hi Dean,

    What's the URL of the page you are trying to validate?
     
    nfd2005, Oct 6, 2008 IP
  4. dean5000v

    dean5000v Peon

    Messages:
    201
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    hey im just doing it locally at the moment, heres the source only tiny at the moment.

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
     <HEAD>
      <TITLE> New Document </TITLE>
      <META NAME="Generator" CONTENT="EditPlus">
      <META NAME="Author" CONTENT="">
      <META NAME="Keywords" CONTENT="">
      <META NAME="Description" CONTENT="">
      <STYLE TYPE="text/css">
    body {
      background: url(back.gif) repeat-x #525354;
      padding: 0px;
      margin: 0px; 
      text-align: center;
      display: center;
    } 
      #container {
      width: 760px;
      height: 460px; 
      margin: 0px auto; 
      margin: 0px auto;
    }
    #logo {
    float: left;
    background: url(logo.gif); 
    } 
    #logo a {
    border: 0px; 
    text-decoration: none; 
    }
    img {
    border: 0px; 
    } 
      </style>
     <!--[if IE]>
    <style type="text/css">
    #container{
    	height:100px;
    }
    </style>
    <![endif]-->
    
    
     </HEAD>
    
     <BODY>
     <div id="container">
     <div id="header"><div id="logo"><a href="#"><img src="logo.gif"></a></div></div></div>
      
     </BODY>
    </HTML>
    
    HTML:
     
    dean5000v, Oct 6, 2008 IP
  5. Danives

    Danives Member

    Messages:
    42
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    48
    #5
    </style><![endif]--></HEAD>

    That might be your problem, it should be

    </style>
    <!--[endif]-->
    </HEAD>

    I think thats right :)
     
    Danives, Oct 6, 2008 IP
  6. dean5000v

    dean5000v Peon

    Messages:
    201
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    tried without the if statment still the same !
     
    dean5000v, Oct 6, 2008 IP
  7. nfd2005

    nfd2005 Well-Known Member

    Messages:
    295
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    130
    #7
    Add an ALT tag to your image.
     
    nfd2005, Oct 6, 2008 IP
  8. Danives

    Danives Member

    Messages:
    42
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    48
    #8
    This seems to work fine for me:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML> 
    <HEAD>  
    <TITLE> New Document </TITLE>  
    <META NAME="Generator" CONTENT="EditPlus">  
    <META NAME="Author" CONTENT="">  
    <META NAME="Keywords" CONTENT="">  
    <META NAME="Description" CONTENT="">  
    <STYLE TYPE="text/css">
    body {  
    background: url(back.gif) repeat-x #525354;  
    padding: 0px;  
    margin: 0px;   
    text-align: center;  
    display: center;}   
    
    #container {  
    width: 760px;  
    height: 460px;   
    margin: 0px auto;   
    margin: 0px auto;}
    
    #logo 
    {float: left;background: url(logo.gif); }
    
    #logo a {border: 0px; text-decoration: none; }
    
    img {border: 0px; }   
    
    </style> 
    </HEAD> 
    <BODY> <div id="container"> 
    <div id="header">
    <div id="logo">
    <a href="#"><img src="logo.gif" alt="" /></a></div>
    </div>
    </div>  
    </BODY></HTML>
    Code (markup):
    Did you add the alt and / tag before?
     
    Danives, Oct 6, 2008 IP