内联元素是否有理由使用padding-top和padding-bottom [英] Is it ever any reason to use padding-top and padding-bottom for inline element

查看:220
本文介绍了内联元素是否有理由使用padding-top和padding-bottom的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据 http://www.maxdesign.com.au/articles/inline/ 内联元素和填充部分说 虽然可以将填充应用于内联元素的所有侧面,但是只有左侧和右侧填充会影响周围的内容.

According to http://www.maxdesign.com.au/articles/inline/ and the section called Inline elements and padding says While padding can be applied to all sides of an inline element, only left and right padding will have an effect on surrounding content.

因此,据此看来,对内联元素使用padding vertical(top,bottom)永远都是没有意义的.

So in accordance with that it seems that it is never ever any point to use padding vertical(top,bottom) for inline elements.

是正确的理解吗?

//托尼

推荐答案

好吧,填充框是覆盖背景色的区域,并在其周围绘制边框,因此更改顶部和底部的填充可以更改内联元素看起来对周围内容没有影响.

Well, the padding box is the area covered with the background colour, and the border is painted around that, so changing the padding top and bottom can change what the inline element looks like even if it has no effect on the surrounding content.

这篇关于内联元素是否有理由使用padding-top和padding-bottom的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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