锚元素在 HTML5 中变为 display:block,而不是使用 cufon 的 display:inline
我得到了 html4 中的 元素,它们是
display:inline
并且页面显示得很好(就像我想要的那样)。
现在我正在使用新的 html5 更新我的页面,结果 cufon 链接变为 display:block
而不是 display:inline
,这是我不希望的。
我希望它们保持内联,因为它们是 display:block
现在它们根据总高度居中,并且当链接带有下划线时,它会垂直对齐,并且看起来不像同一行中没有下划线的链接。
我想知道可以采取什么措施来保持内联或停止垂直居中对齐。需要明确的是,我希望我的文本具有固定顶部,无论[字母+下划线]。[实际高度]如何。
更新我实际上能够摆脱这种行为。我不知道什么真正有帮助,我注意到在某些页面上相同的链接实际上显示为内联,并且该页面引用了一个小的附加 css。我在有问题的页面上添加了一个 css 参考,它起作用了。然而,我在该 CSS 中看不到任何我可以认为是修复原因的内容。
基本上它所拥有的与所讨论的 html 部分相关的内容是:
body, html, form
{
display:block;
list-style:none;
text-align:left;
}
既然已经有赏金了,我将继续稍微改变一下问题:我想知道这有什么帮助。或者这个和 cufon 到底发生了什么。我有点困惑。
I got <a>
elements that are display:inline
in html4 and page displays fine (like I want it to).
Now I am updating my page with new html5 and as a result following cufon link becomes display:block
instead of display:inline
, which is not desired by me.
I would like them to remain inline though because since they are display:block
now they are centered according to their total height, and when link is underscored for example it aligns vertically and looks not like links in the same row which don't have underscore for example.
I wonder what can be done to either remain inline or to stop from that vertical centered alignment. Just to be clear I want my text to have fixed top, regardless of [letter + underscore].[actual height].
UPDATE I actually was able to get rid of such behaviour. I have no idea what has really helped, I noticed that on some pages same links were displayed as inline actually, and that page was referencing a smallish additional css. I added a css reference on buggy page and it worked. However I cannot see anything in that CSS that I can consider to be the reason of a fix.
basicly all it has which is relevant to part of html in question is this:
body, html, form
{
display:block;
list-style:none;
text-align:left;
}
Since theres already a bounty Ill go ahead and change question a little: I wonder how this helped. Or what is going on actually with this and cufon here. Im puzzled a little.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
添加
display:inline !important
到适当的标签。Add a
display:inline !important
to proper tag.