CSS mystery: Width being set to 0px without any CSS rules?

前端 未结 3 1248
不知归路
不知归路 2020-12-19 23:03

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 elemen

相关标签:
3条回答
  • 2020-12-19 23:45

    It has display: inline property, which makes the element ignore your width,height values, even if they are marked !important

    0 讨论(0)
  • 2020-12-19 23:46

    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.

    0 讨论(0)
  • 2020-12-20 00:01

    Since this is a display: inline element you can't set it's width. Try display: inline-block.

    0 讨论(0)
提交回复
热议问题