1、如图所示,在span中,默认并不会保留上下外边距和内边距。
2、在span对应的类中添加display: inline-block;。
3、添加该样式之后,span元素就可以设置内外边距和宽高。
4、具体原理如图。