CSS:显示属性差异 [英] CSS: Display Properties differences

查看:81
本文介绍了CSS:显示属性差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

display:block和display:inline有什么区别

What is the difference between display:block and display:inline

推荐答案

block元素通常会垂直堆叠,而inline元素会垂直堆叠水平排列。

Block elements will typically stack vertically whereas inline elements will line up horizontally.

两个Div会堆叠在一起,但是如果您将它们设置为display:inline,它们将在水平方向上彼此相邻。反之亦然,带有Span标签。

Two Divs will stack on top of each other, but if you set them to display:inline, they will be next to each other horizontally. Vise-versa with Span tags.

这篇关于CSS:显示属性差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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