CSS: I can't set width to “auto” always appear 100%

后端 未结 7 886
太阳男子
太阳男子 2021-01-28 16:56

for some reason

the width of the div is 100% and if i set it to auto, nothing changes. tried display: block; and still nothing.

what I have in

7条回答
  •  被撕碎了的回忆
    2021-01-28 17:17

    Width display: block, the elements will always use as much width as is available. It seems like you want to use display: inline-block

    http://jsfiddle.net/HpMSU/

提交回复
热议问题