/    Sign up×
Community /Pin to ProfileBookmark

rollover: <li> or <a>????

Hi guys,

I’m setting up a nav list with rollovers. By using the hover pseudo class, I’m changing the background image (which is made to look like a bulleted item). My problem lies in having the image as the background in the href. Whenever the text of the list item is long it obviously has to wrap. When it wraps I’d like the text to indent. Is there a way to have the text indent over so it’s not below the image?

This problem could easily be solved if I use the hover class on the list item <li>. BUT THAT OBVIOUSLY DOESN’T WORK IN IE BECAUSE THE PSEUDO CLASSES ONLY WORK FOR THE ANCHOR TAG :rolleyes:

[URL=http://www.itgco.com/testsites/css/list_rollover.html]Go here to get a better idea of what I’m trying to do.[/URL]

I’d appreciate anyone’s input on this. Thanks!

to post a comment
CSS

3 Comments(s)

Copy linkTweet thisAlerts:
@SamJun 02.2004 — give your anhors display:block;
Copy linkTweet thisAlerts:
@toicontienJun 02.2004 — [i]Originally posted by Sam [/i]

[B]give your anhors display:block; [/B][/QUOTE]

There is a bug in IE/Win that places a ~1em margin between the LI tags when you've got a block-level <A> tag in it. Set the <LI> tags to display: inline to get around this bug.
Copy linkTweet thisAlerts:
@ajimenezauthorJun 02.2004 — Thank you, guys!

It works perfectly now!
×

Success!

Help @ajimenez spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...