如何让div与内容一起成长? [英] How to make a div grow with content?

查看:202
本文介绍了如何让div与内容一起成长?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

与html相关,如何让div容器与内容一起增长,而不是手动定义宽度和高度。









无论徽标的尺寸是多少,容器都不会随之增长:(...我如何解决这个问题(或者可以解决这个问题)?

如果你没有定义宽度和/或高度,div元素会随着它的内容一起增长如果内容设置为浮动,您必须设置为容器

  overflow:hidden 

为了让它成长!


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

No matter what the dimensions of logo are, container does not grow with it :(...how would I fix this (or can it be fixed)?

解决方案

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!

这篇关于如何让div与内容一起成长?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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