开发者

what are the problems with display:table? [duplicate]

开发者 https://www.devze.com 2023-03-12 15:20 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: Is there a disadvantage of using display:table-cellon divs?
This question already has answers here: Closed 11 years ago.

Possible Duplicate:

Is there a disadvantage of using display:table-cellon divs?

I think display:table is a easy way of managing the layout of a webpage, at least a general开发者_如何学运维 layout. But it looks like it is not widely used. I know it is unsupported or has issues wit ie6 and ie7 but for sites not trying to be compatible with those browsers there is any drawback from using display:table?


You may be thinking of this in terms of the table element within html. To answer your question in that sense, yes. Positioning elements with display:table in css is more or less just a way of forming a table-like display to correctly position an element. It requires less hassle in the way of floating div's and such. As long as you are just forming a display that will correctly position your elements, it is perfectly fine, you should NOT obstruct the html code though by using a table to perform the same tasks that you would use display:table for. The only downside of using css display:table is that a cell can still stretch to fit the content contained within it compared to setting a height and width in a specific div.

0

精彩评论

暂无评论...
验证码 换一张
取 消