The easiest, most browser-compatible way to do this is with CSS.
(Coincidentally, this will center your text as well.)
Draw your box, and while it is still selected, make sure the Layer
checkbox is on in the Inspector, and note (or change) the value in the
Inspector’s “Title” field. (Confusingly, this is where the ID is set
for an HTML box.)
Double-click into the box, type and link your link text (but do not
style it at all). Un-check the height attribute for the box.
Now, off to the Styles palette. Click on the cog menu, select New
Style. In the Tag field, enter a # followed by the name of your box, a
space, and an a. For example, if your box was called item4, you would
enter all of this exactly as written in the Tag field:
#item4 a
Tab into the Name field, delete whatever is there, and then tab out
again to make sure it sticks.
Now click the Extended button, and enter the following name/value
pairs. (You will click New for each pair, a sub-sub-dialog will
appear, you will enter the name and value in their respective fields,
then Okay that dialog.)
name |
value |
display |
block |
text-align |
center |
padding |
8px 0 |
background-color |
#ff9 |
Now okay out of the stack of dialogs, and preview. You should see a
yellow box around your link, with 8px padding top and bottom (adjust
this dimension and the color to your liking). The box should be
adjustable for width by dragging the containing HTML box wider.
The rollover part is just adding one more style, exactly the same way
you made the first, but named
#item4 a:hover
And the only property you need to add for this one is the background-
color. (And the font color if you want that to change at the same time.)
This should be the most browser-safe way to get this particular
effect, and since it doesn’t rely on JavaScript, you won’t need to
worry about accessibility issues either.
Walter
On Mar 12, 2009, at 10:17 AM, Bryan Los wrote:
I would like to have a CSS box, with a link in it. When I hover the
mouse over the box, I would like to have the background color of the
CSS box to change to a desired color and change back when the mouse
is moved off.
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options