标题中的浮动跨度
大家好,这是我的一段代码..
...
<caption>
<span class="drawicon"> </span>
I am the Caption Text
<span style="float:right;">Extra</span>
</caption>
...
我目前不明白为什么浮动的跨度会出现在 Firefox 中的标题下方,但不会出现在其他浏览器中。
______________________________________________________________
| [icon] I am the Caption Text |
|______________________________________________________________|
|_____________|<- span that floats
Hi guys this is my piece of code ..
...
<caption>
<span class="drawicon"> </span>
I am the Caption Text
<span style="float:right;">Extra</span>
</caption>
...
I'm currently don't understand why the span that floats will appear below the caption in firefox but not in other browsers.
______________________________________________________________
| [icon] I am the Caption Text |
|______________________________________________________________|
|_____________|<- span that floats
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你能把相关的CSS信息也贴出来吗?
不同的浏览器对 CSS 盒子模型的解释不同,导致关于如何显示内容的不同决定。我相信 Firefox 对边距的解释不同,但我不知道这是否会影响这里的任何内容,因为您没有显示相关的 CSS。
我更喜欢使用 div 设置宽度和高度,并且会切换到此处而不是跨度。但请回顾一下 CSS 盒子模型以及 FF 与其他浏览器相比如何解释它。
Can you post the relevant CSS information as well?
The different browsers interpret the CSS Box Model differently, resulting in different decisions around how to display things. I believe Firefox interprets margins differently, but I don't know if that is affecting anything here as you haven't shown the relevant CSS.
I prefer using div's to set width and height and would switch to those here instead of spans. But review the CSS Box Model and how FF interprets it vs. other browsers.