You are here: Re: Anchor outside div not validating « HTML « IT news, forums, messages
Re: Anchor outside div not validating

Posted by Sean on 01/08/08 22:41

On Tue, 08 Jan 2008 21:38:43 +0000, Beauregard T. Shagnasty wrote:

>> Make the header a link instead of its container. Changing color and
>> text can easily be done through css.
>
> Easily, yes. Valid? You have to stop and think. <g>

Changing color through css is most definitely valid. I do it at my site
and it validates perfectly with W3C's xhtml validator and css validator.
Why would specifying this in css not be valid?

>> <!-- I'm assuming you want both the image and heading linked -->
>> <a href="page.html" title="">
>> <img src="image.jpg" alt="" />
>> <h2>Heading</h2></a>
>
> That is not valid HTML. You can't stick an <hx> inside an anchor, only
> inline elements.

You're absolutely right. Block elements inside inline elements = bad. I
should have said:

<a href="page.html" title="">
<img src="image.jpg alt="" /></a>
<h2><a href="page.html" title="">Heading</a></h2>

>
>> ===example.css===
>> .container h2:hover {
>> color: orange;
>> }
>> ===end===
>
> ..and that hover won't work in IE.

It may not work in IE6 (it only supports a:hover), but it does in IE7.
This is just a basic example, and you can change it around to make sure
it works with IE6.

..container h2 a:hover {}

>> You can do the same with the text if you wish.
>
> Ummm?

..container p:hover {}

And yes, I already know that won't work in IE6. But seriously, I look at
my site statistics and see less than .5% of my visitors still using IE6,
so I no longer make concessions for it. Of course statistics can vary
greatly from site to site, so if you still have people visiting your site
with IE6, then by all means design for it. I'm more than happy to be
done with limiting my site and hacking together conditional css to make
IE6 happy.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация