CSS神秘:宽度设置为0px没有任何CSS规则? [英] CSS mystery: Width being set to 0px without any CSS rules?

查看:135
本文介绍了CSS神秘:宽度设置为0px没有任何CSS规则?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,请查看上。


So, check out this screenshot of a page I'm working on in Chrome Developer Tools:

The top rule in 'Matched CSS Rules' suggests that the width of the element should be 160px.

But in 'Computed Style' the width is actually 0px.

If you click on the '0px', it again shows the rule suggesting that the width should be 160px. But it's not.

What's going on? What is setting the width to 0px that is invisble to Chrome Developer Tools?

And how can I debug this?

解决方案

the link uses display: inline;. You want either display: inline-block; or display: block; (if you need IE6-7 support).

You may want to read the spec on the display property.

这篇关于CSS神秘:宽度设置为0px没有任何CSS规则?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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