Jump to content

HTML Validation


Cetanu

Recommended Posts

http://validator.w3.org/check?uri=http%3A%2F%2Fmythscape.freezoka.com&charset=%28detect+automatically%29&doctype=Inline&group=0

 

 

 

I have a couple of questions:

 

Why doesn't my site validate? I don't understand W3C's rules. For example, "#

 

# Error Line 38, Column 3: document type does not allow element "p" here; missing one of "object", "ins", "del", "map", "button" start-tag"

 

Well what does that mean?! I read their explanations, but it doesn't make sense. Am I using <p> wrong?

 

It says that sort of thing a lot, and I just don't get it. Help?  :D

Link to comment
Share on other sites

No, but I'll give you a snippet it declares wrong (sorry I forgot  :P ).

 

...ottom:1px solid #000; padding: 5px;"><a href="/demon/dmain.php">>>Demonology

 

For this it tells me:

 

document type does not allow element "div" here; missing one of "object", "ins", "del", "map", "button" start-tag

 

 

Other than that, in the validation results it shows the little bits of code it scrutinizes and then tells you why, but I don't get their stupid reasoning.  :facewall:

Link to comment
Share on other sites

I use the >> for the link to appear like >>Demonology..

 

I'll just paste in a lot of the code that doesn't validate XD

 

<div style="width: 100%; border: 1px dashed #999; padding: 5px; margin: 10px;">

 

document type does not allow element "div" here; missing one of "object", "ins", "del", "map", "button" start-tag

 

<p>Cryptids, animals that haven't been....

 

document type does not allow element "p" here; missing one of "object", "ins", "del", "map", "button" start-tag

 

<label for="username">Username</label>

document type does not allow element "label" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag

 

Stuff like that shizen. :D

Link to comment
Share on other sites

Haku is right.  We need blocks of code.  The lines you give may not actually hold the error, it could be before or after that line. 

 

For this one:

<label for="username">Username</label>

 

This is an inline element it needs to be nested inside of a block element.

 

Example:

<td><label for="mname">MI</label><br />
            	<input type="text" name="mname" id="mname" class="textbox" maxlength="2" size="4" value="" />
            </td>

 

<td> tags are inside a <table> tag.  Another example:

 

<p>Hi I am <label for="joe">joe</label>.</p>

Link to comment
Share on other sites

        <div style="margin-left: 70%; padding: .555em;"><a href='registration.php'>Register Today!</a>	</div>
<div id="content">
<div id="page">
<p style="text-align: right;">
<div style="width: 100%; border: 1px dashed #999; padding: 5px; margin: 10px;">


<a href="linkus.php">Contribute to MythScape by linking us to your website, blog, signature, etc.! You can join in and help, and we will also advertise your site here. Just 
click this line of text!</a>  </div>

 

<div style="width: 100%; border: 1px dashed #999; padding: 5px; margin: 10px;">

 

PS I think I had the wrong idea of <label>

Link to comment
Share on other sites

        
<div style="margin-left: 70%; padding: .555em;">
<p><a href='registration.php'>Register Today!</a></p>
</div>

<div id="content">
<div id="page">
<p style="text-align: right;"></p>
<div style="width: 100%; border: 1px dashed #999; padding: 5px; margin: 10px;">

<p><a href="linkus.php">Contribute to MythScape by linking us to your website, blog, signature, etc.! You can join in and help, and we will also advertise your site here. Just 
click this line of text!</a></p>
</div>
</div>
</div>

 

Try this.  Further, the 'a' element is inline it MUST be in a block element.  Suggestion: put your styles in a css, either internal or external whichever.  And the 2nd p with link that starts "Contribute..." make only one or two words actually link, not the whole paragraph.  It's tacky.  ;)

 

Hope this helps.

 

Also-

 

<a href='registration.php'>

 

use double quotes ""

Link to comment
Share on other sites

        
<div style="margin-left: 70%; padding: .555em;">
<p><a href='registration.php'>Register Today!</a></p>
</div>
<div id="content">
<div id="page">
<p style="text-align: right;"></p>
<div style="width: 100%; border: 1px dashed #999; padding: 5px; margin: 10px;">

<p><a href="linkus.php">Contribute to MythScape by linking us to your website, blog, signature, etc.! You can join in and help, and we will also advertise your site here. Just 
click this line of text!</a></p>
</div>
</div>
</div>

 

Try this.  Further, the 'a' element is inline it MUST be in a block element.  Suggestion: put your styles in a css, either internal or external whichever.  And the 2nd p with link that starts "Contribute..." make only one or two words actually link, not the whole paragraph.  It's tacky.  ;)

 

Hope this helps.

 

Also-

 

<a href='registration.php'>

 

use double quotes ""

 

Okay, thanks for that. I'll fix those sorts of problems and then try and validate.

Link to comment
Share on other sites

Great news!

 

Thanks to sawade I have managed to get the home page down to 5 errors.

One error is because it won't let me use target="_blank", but I don't plan on getting rid of that so screw them. :P

 

The other four are because my free host inserts a javascript thing at the bottom of all my pages and they have some errors in their code. W3C doesn't like their code so I'll have to live with the never-able-to-be-valid code. :'(

 

BUT THANKS! Now I know what I was doing wrong. :)

Link to comment
Share on other sites

Please don't use target, it's really annoying for users. You should let the user decide if they want to open the link in a new window, you shouldn't decide for them.

 

It's for my RSS feed because there's no way of returning to my website if you click on the button....except the back button, but that could potentially mess with logging in (resending information, etc.)

 

I only use it once on the whole site.  :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.