nesting tags

Discussion about HTML and XHTML related issues.
Post Reply
hazelpat
Rank 0 - Newcomer
Rank 0 - Newcomer
Posts: 1
Joined: Sat Apr 04, 2009 2:22 pm

nesting tags

Post by hazelpat » Sat Apr 04, 2009 3:09 pm

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

User avatar
CaryD
Rank II - Novice
Rank II - Novice
Posts: 46
Joined: Sun Oct 01, 2006 2:18 pm
Location: CA

Post by CaryD » Sat Apr 04, 2009 7:16 pm

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.

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3429
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Post by Albert Wiersch » Sat Apr 04, 2009 9:46 pm

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>
Image
Albert Wiersch

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3429
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Post by Albert Wiersch » Sun Apr 05, 2009 7:52 am

In case anyone is interested, hazelpat told me that it was the "font" tag that was the problem.
Image
Albert Wiersch

User avatar
CaryD
Rank II - Novice
Rank II - Novice
Posts: 46
Joined: Sun Oct 01, 2006 2:18 pm
Location: CA

Post by CaryD » Sun Apr 05, 2009 1:03 pm

Albert Wiersch wrote:In case anyone is interested, hazelpat told me that it was the "font" tag that was the problem.
Thank you.

worrall
Rank 0 - Newcomer
Rank 0 - Newcomer
Posts: 6
Joined: Sat Aug 25, 2012 8:06 am

Re: nesting tags

Post by worrall » Wed Aug 29, 2012 8:24 am

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.

Post Reply