PDA

View Full Version : many validation errors



utnalove
Oct 18th, 2008, 11:10 AM
Why I am getting so many validation errors?

http://validator.w3.org/check?uri=http%3A%2F%2Fwww.erasmusinpoland.com%2Fblog&charset=(detect+automatically)&doctype=Inline&group=0

The code is the following:

<div id="rightcolumn">

<ul id="sidebar">

<li>
<div class="about">
<h3>Erasmus in Poland</h3>
<p><img src="<?php bloginfo('template_url'); ?>/images/author.jpg" alt="" />

Everything you need to know about the events in Warsaw, news and help to study, have fun and finding a job. We will keep you up-to-date, you can ask us questions, and we will reply with the best effort to make you like Poland and the life here.

<br />
<br />
<p style="text-align:center; font-weight:bold;"> You will be proud to say:</p>
<br />
<p style="text-align:center; font-weight:bold; text-decoration:underline;"> "I was Erasmus in Poland". </p>
<br /><br />


<a href="http://feeds.feedburner.com/ErasmusInPoland">
<img src="<?php bloginfo('template_url'); ?>/images/feed-icon-blue.png" alt="" />
<p align="left"></a>
<font color="#009FBF"> We will add here every news! The best way to get them all is to subscribe to our Feed RSS. <br /><br /> </font> <font color="#black"> >> </font>

<a href="http://feeds.feedburner.com/ErasmusInPoland">
<font color="#009FBF"> <b> Be our usual reader, take the feed and use it with your favourite browser! <b/> </font> </p></a>




</div>
<div class="about_bottom"></div>
</li>

<li class="widget_search">
<form id="searchform" action="<?php bloginfo('url'); ?>" method="get">
<div>
<input id="s" type="text" size="15" name="s" /><br />
<input type="submit" value="" />
</div>
</form>
<div class="clear"></div>
</li>

<li class="widget">
<?php include("tabs.php"); ?>
</li>



<?php /* Widgetized sidebar, if you have the plugin installed. */
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>

<?php endif; ?>
</ul>
<!-- end #sidebar -->

</div><!-- end #rightcolumn -->

VIPStephan
Oct 18th, 2008, 11:28 AM
Itís pretty obvious, actually: Your code is not well formed.

First two errors about paragraph not being allowed comes because you forgot to close a paragraph before:


<p><img src="http://erasmusinpoland.com/blog/wp-content/themes/evolution/images/author.jpg" alt="" />
Everything you need to know about the events in Warsaw, news and help to study, have fun and finding a job. We will keep you up-to-date, you can ask us questions, and we will reply with the best effort to make you like Poland and the life here.
<br />
<br />
<!-- you need to close the above paragraph before you can start a new one -->
<p style="text-align:center; font-weight:bold;"> You will be proud to say:</p>


The third error comes for the same reason but caused by a different nesting error:


<a href="http://feeds.feedburner.com/ErasmusInPoland">

<img src="http://erasmusinpoland.com/blog/wp-content/themes/evolution/images/feed-icon-blue.png" alt="" />
<p align="left"></a>
<font color="#009FBF"> We will add

What is this??

Also note that the <font> element should never ever be used again. Itís old and outdates. And although elements like <b> and <i> are still valid, they shouldnít be used as well since their only purpose is presentation, and it has no semantic (http://boagworld.com/technology/semantic_code_what_why_how/) value.

Then, lastly, you have a <ul></ul> combination (list without list items) which isnít valid. A list must have at least one list item. The other errors are all dependencies of these four errors and will be gone once you fix those.

utnalove
Oct 18th, 2008, 01:00 PM
Now there is one error left:
http://validator.w3.org/check?uri=http%3A%2F%2Fwww.erasmusinpoland.com%2Fblog&charset=(detect+automatically)&doctype=Inline&group=0

The <ul></ul> combination has the <li> items, no? What items do you mean? Can you please give an example?

What can I use instead of font, b and u? Css font:style?

This is the code now:

<div id="rightcolumn">
<ul id="sidebar">


<li>
<div class="about">
<h3>Erasmus in Poland</h3>
<p><img src="<?php bloginfo('template_url'); ?>/images/author.jpg" alt="" />

Everything you need to know about the events in Warsaw, news and help to study, have fun and finding a job. We will keep you up-to-date, you can ask us questions, and we will reply with the best effort to make you like Poland and the life here. </p>

<br />
<br />
<p style="text-align:center; font-weight:bold;"> You will be proud to say:</p>
<br />
<p style="text-align:center; font-weight:bold; text-decoration:underline;"> "I was Erasmus in Poland". </p>
<br /><br />

<!--
<a href="http://feeds.feedburner.com/ErasmusInPoland"><img src="http://erasmusinpoland.com/blog/wp-content/themes/evolution/images/feed-icon-blue.png" </a>
-->

<p align="left">
We will add here every news! The best way to get them all is to subscribe to our Feed RSS. <br /><br /> >>


<a href="http://feeds.feedburner.com/ErasmusInPoland">
Be our usual reader, take the feed and use it with your favourite browser! </a> </p>




</div>
<div class="about_bottom"></div>
</li>

<li class="widget_search">
<form id="searchform" action="<?php bloginfo('url'); ?>" method="get">
<div>
<input id="s" type="text" size="15" name="s" /><br />
<input type="submit" value="" />
</div>
</form>
<div class="clear"></div>
</li>

<li class="widget">
<?php include("tabs.php"); ?>
</li>



<?php /* Widgetized sidebar, if you have the plugin installed. */
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>

<?php endif; ?>

<!-- end #sidebar -->
</ul>
</div><!-- end #rightcolumn -->

If I remove the <ul></ul> I get more errors.


What was wrong here?
<a href="http://feeds.feedburner.com/ErasmusInPoland"><img src="http://erasmusinpoland.com/blog/wp-content/themes/evolution/images/feed-icon-blue.png" </a>

VIPStephan
Oct 18th, 2008, 02:04 PM
Now there is one error left:
http://validator.w3.org/check?uri=http&#37;3A%2F%2Fwww.erasmusinpoland.com%2Fblog&charset=(detect+automatically)&doctype=Inline&group=0

The <ul></ul> combination has the <li> items, no? What items do you mean? Can you please give an example?



An unordered or ordered list (ul/ol) need to have list items (li) in order to validate. Yours is empty (i. e. lacking the <li> elements). I see that this might be coming from a badly coded plugin or you need to check if you can change the settings to not produce list items but also enclose it with a <ul>.
For example, some Wordpress template tags take parameters for “before” and “after”, like: <?php the_title('before', 'after', display); ?> where you can choose what should be printed before and after the text. If there is the possibility of that being empty it might be better to use something like <div></div> rather than lis enclosed in a hard coded list.

I hope you get what I mean? But this is just an assumption because I don’t know how the recent comments template tag looks like.



What can I use instead of font, b and u? Css font:style?


Yeah, kind of. You can give a certain paragraph that you wanna style differently a class and address that class in the stylesheet to style the paragraph. If you just have a few words within some text that should look different, you would use the span element to give it a different look. However, you should determine if the text would have a strong emphasis (like when you’re saying something more important than the rest of the text). In that case you would use <em> for normal emphasis which usually displays text oblique (italics) or <strong> for really strong emphasis which usually displays text in bold letters. But you shouldn’t use these elements just because you want something printed in bold. If you don’t have any certain emphasis and still wanna have bold text you can use the semantically neutral <span> element and style it as I said earlier.




What was wrong here?
<a href="http://feeds.feedburner.com/ErasmusInPoland"><img src="http://erasmusinpoland.com/blog/wp-content/themes/evolution/images/feed-icon-blue.png" </a>

How could you fix it without knowing what was wrong? :confused:
I can tell you what was wrong: It was wrongly nested. You had an opening paragraph inside that link which isn’t allowed (besides the fact that it hasn’t even been closed).

utnalove
Oct 18th, 2008, 05:50 PM
How could you fix it without knowing what was wrong?

I fixed it with <!-- -->, in other words I deleted it.
I am just a beginner and I apologise for those question for you obvious, but I am learning very fast :D

If you don't mind I have some other requests of that kind :p



It is better to use one <p></p> for a 2 phraes text, with links inside, and separated those setences with <br /> or is better to create a <p> for each sentence and but the <br /> between the <p>s?

Could you please give me an example on how to use the <span> and <em> in a text?

If in a text there is also an image, and both text and images should redirect to a link when clicked. Is better to put a href to the image and one to the text, or 1 for all the paragraph?