填充内联元素的顶部和底部 [英] Padding the top and the bottom of inline element

查看:140
本文介绍了填充内联元素的顶部和底部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


第一个html的报价:

Quote from Head first html:


可以在内联元素的顶部和底部添加填充,但填充不会影响其周围其他内联元素的间距,因此填充将与其他内联元素重叠

You can add padding to the top and bottom of inline element, but the padding doesn’t affect the spacing of the other inline elements around it, so the padding will overlap other inline elements

a)根据我的理解上面的引用,在内联元素的顶部和底部添加填充不会对周围的元素有任何影响,因此对页?!

a) As far as I understand the above quote, adding padding to the top and bottom of inline element doesn’t ( ever ) have any effects on surrounding elements and thus on the look of the page?!

b)但是 padding将与其他内联元素重叠是什么意思?是否可能建议在某些情况下,填充(内联元素的顶部和底部)会对页面外观产生影响?!

b) But what exactly is meant by "padding will overlap other inline elements"? Does it perhaps suggest that in certain circumstances padding ( top and bottom of an inline element ) will have effect on the look of the page?!


thanx

推荐答案

如果我理解正确, http://www.frecial.net/stack-overflow/inline-padding.html =nofollow noreferrer>示例我刚才:

If I understand correctly, and from an example I just made:

a)文本是一个内联元素,所以我添加一个带有顶部和底部填充的跨度不会推动其他行下来

a) the text is an inline element, so me adding a span with top and bottom padding is not pushing the other lines down

b)你可以看到,因为我已经添加了一个颜色跨度,颜色将重叠的其他行。

b) as you can see, since I've added a color to the span, the color will overlap the other lines.

我希望这是正确的,并回答你的问题:D

I hope this is both right, and answers your question :D

这篇关于填充内联元素的顶部和底部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆