How to make a div grow with content?

后端 未结 5 718
再見小時候
再見小時候 2021-02-05 01:40

Pertaining to html, how do I make a div container grow with the content instead of manually defining a width and height.

5条回答
  •  不知归路
    2021-02-05 02:04

    If you don't define width and/or height, the div element grows along with its content. Unless his content is set to absolute! If the content is set to float, you have to set to the container

    overflow:hidden
    

    in order to let it grow!

提交回复
热议问题