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

后端 未结 7 989
太阳男子
太阳男子 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:00

    adding to Explosion Pills answer now that its clear what you want, this css should work.

    .box {
        border: 1px solid #555; 
        display: inline-block;        
        float:left;
        clear:both;
    }
    

    Alternatively, you could place some
    tags after each

    block

提交回复
热议问题