OpenMacNews wrote:

> i'm trying to get an inline-css rollover to behave.
>
> i've got an <a> tag of:
>
> <a class="menuButton"
>   style="{background-image: url($image_name);}
> :hover{background-image: url($image_name_hvr);}">
> </a>

Did you try validating that?

> the goal, of course is, when hover over the <a> block's
> background image, flip the display to the hover-image.
>
> in this form, this *has* to be done inline as $image_name &
> $image_name_hvr are *dynamically* generated in a parent, php
> loop ...

"has to be done" - what if it can't?
Hint: it can't.

> problem is, $image_name display correctly.  but i can't get
> that silly second, hover image to display ...

Because :hover is the selector, not the style. Inside the style 
attribute, you can only write styles, not selectors.

> i'm guessing it's either a syntax problem with my inline-css,

HTML validator is your friend:
http://validator.w3.org/

> or i'm approaching this all wrong ...

Can't you generate this second image name into the head of the 
document?
Like so:

<style type="text/css">
a.menuButton{
    background-image: url($image_name);
}
a.menuButton:hover{
    background-image: url($image_name_hvr);
}
</style>
</head>
<body>
...
<a class="menuButton">...</a>

-- 
Els
http://locusmeus.com/
http://locusoptimus.com/

______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to