开发者

Strange jump of list-item height when hidden nested span is displayed on hover in Chrome

I have a list of links that are using nested span elements as a rollover with extra information on hover.

See this page: http://kenbrookyouth.com/summercamp11/

So in firefox everything in that list (see the list of camps in the "Summer Camp" section of the page, just below the two descriptions; there are two lists - one of the left and the right) looks fine, including when you hover over the list items (camp names). Doing so produces the desired effect of the hidden nested spans appearing with the age info for each camp.

However in Chrome and Safari the list items have a strange jump-glitch on hover, such that it appea开发者_开发知识库rs the hidden nested span is actually being displayed as block, but not floated as it should.

Any tips on this one?


The problem can be solved by wrapping the text in your links in <span> tags (for instance "Adventurers" in the first one). For some reason (don't know the exact reason), floats behave best when other elements around them have widths or are also floating or both. Text also becomes unpredictable when it's not immediately surrounded by a tag, so I try to keep all text in spans (or h1, h2 or any other text-appropriate tag).

Another way to fix it was to add width to the <a> tag, but you'd have to give different widths for each link, so just use the span tags.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜