CSS:display:block; vs display:table; [英] CSS: display:block; vs display:table;

查看:384
本文介绍了CSS:display:block; vs display:table;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

display:block; display:table; 之间有区别吗?它看起来像显示类型的dom节点包含 table-row table-cell nodes doesn'事情。 MDN说, display:table; 使它表现得像表,但不详细说明什么是行为。这是什么行为?

Is there a difference between display:block; and display:table;? It looks to me like the display type of the dom-node containing table-row and table-cell nodes doesn't matter. MDN says that display:table; makes it behave like a table, but doesn't elaborate on what that behavior is. What is that behavior?

同样, display:inline-block; display:inline-table;

推荐答案

比较两者(块和表),我不知道任何核心差异你会在真空中看到。我相信主要的区别是特别是对儿童。表和他们的孩子有一个非常不同的属性/关系比一个div和它的孩子。

Comparing the two (block and table), I don't know of any core differences (there may be minor ones) you would see within a vacuum. I believe the major differences are specifically to children. Tables and their children have very different attributes/relationships than a div and it's children.

对于inline-block和inline-table参见: inline-block和inline-table有什么区别?

As far as inline-block and inline-table see: What is the difference between inline-block and inline-table?

本文( http:/ /css-tricks.com/almanac/properties/d/display/ )有一些有趣的信息,特别是关于与表相关的所有不同的显示属性。

This article (http://css-tricks.com/almanac/properties/d/display/) has some interesting information, specifically regarding all the different display properties related to a table.

这篇关于CSS:display:block; vs display:table;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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