Page 1 of 1

nesting tags

Posted: Sat Apr 04, 2009 3:09 pm
by hazelpat
Hi

I am optimising pages with WebPosition and it does not recognise text in <h4> tags which has font tags and A tags like this :-



<H4><a href="http://www.privatetoursuk.com"><font face="georgia" size="2" >british royal family tours </font></a></H4>



So I altered the position of the <H4> tags to either side of the text like this :-



<a href="http://www.privatetoursuk.com"><font face="georgia" size="2" ><H4>british royal family tours</H4></font></a>



Web Position now accepts this, but the HTML validator says that the <h4> tags should not be inside the A tags and font tags.



Please can you tell me how to write this code correctly. ie where should <H4> tags go ?

Regards Hazel

Posted: Sat Apr 04, 2009 7:16 pm
by CaryD
See if WebPosition works with this:

<h4><a href="http://www.privatetoursuk.com">british royal family tours</a></h4>

That's the way it should be coded, and if WebPosition can work with that then you'll know the font tags are the problem. You will then need to use CSS instead of the font tags if you want the code to both work with WebPosition and validate.

Posted: Sat Apr 04, 2009 9:46 pm
by Albert Wiersch
I would try what CaryD suggests. I am not familiar with WebPosition, but if it is not wanting you to write good HTML, then I wouldn't use it. :D

You could use something like that as well (I added the CSS to what CaryD suggested):

Code: Select all

<h4 style="font-family:georgia,sans-serif"><a href="http://www.privatetoursuk.com">british royal family tours</a></h4>

Posted: Sun Apr 05, 2009 7:52 am
by Albert Wiersch
In case anyone is interested, hazelpat told me that it was the "font" tag that was the problem.

Posted: Sun Apr 05, 2009 1:03 pm
by CaryD
Albert Wiersch wrote:In case anyone is interested, hazelpat told me that it was the "font" tag that was the problem.
Thank you.

Re: nesting tags

Posted: Wed Aug 29, 2012 8:24 am
by worrall
As you are saying that web position is not accepting the line "<H4><a href="http://www.privatetoursuk.com"><font face="georgia" size="2" >british royal family tours </font></a></H4>",but this is the general format and it is correct format to write the code you are not supposed to write the<h4> tag in midst of the link as it gives the error message while validation, so i would like to suggest you to use css which gives better comfort.