[thelist] site help

Sarah Sweeney mr.sanders at designshift.com
Thu Jun 24 19:28:45 CDT 2004


Alex Beston wrote:
> Sarah
>>
>> If you combine the CSS
>>   h1 a { display: block; }
>> and moving the <a> tag /inside/ the <h1> tag, it will validate.
>>
> http://www.manderstam.com/preview/
> 
> im trying to get the hover state to be a green box from white. the h1 
> has to be included in the "a". to put it inside would mean overlapping 
> tags to pick up the h1 text.
> i could be wrong though.
> 
> thanks for trying anyway,
> 
> Alex

Now I see what you're trying to do. Probably the easiest thing to do is 
forget about using <h1> tags altogether, using <span> tags instead to 
style the text, and then it will be ok to wrap everything in the box in 
the <a> tag. Some might argue the sematics of this are not correct... or 
maybe they are. Regardless, I think that's the easiest and most 
cross-browser friendly way to do it.

Alternatively, you could use JavaScript to change the style of the box 
using the onmouseover event. The drawback here being that it won't work 
if a user has JavaScript disabled.

And if you don't care about IE, you could just put the :hover on the 
<div> itself. But I bet you do care about IE, as we are all forced to :)

-- 
Sarah Sweeney
Web Developer & Programmer
Portfolio:  http://sarah.designshift.com
Blog, etc:  http://hardedge.ca
My family:  http://geekjock.ca


More information about the thelist mailing list