Expand div when the content overflows
18,172
use stylesheets and change
width:25px;
to
min-width:25px;
AND
height:400px;
to
min-height:400px;
Related videos on Youtube
Author by
Kris van der Mast
Passionate about .NET MVP ASP.NET since 2007 Microsoft ASP Insider aOS ambassador Microsoft Azure Insider Microsoft Extended Experts Team member speaker / teacher involved in several Belgian user groups. moderator on the ASP.NET forums. organizer of CloudBrew, the Belgian Cloud Conference
Updated on April 25, 2022Comments
-
Kris van der Mast about 2 years
I have div with height="400px" and width="25px".How to expand div when the content overflows?
-
cEz almost 14 yearsPerhaps changing "height" and "min-height" may be more suitable?
-
Salil almost 14 years@cez :- Thanks I edit my answer so that it expands vertically as well as horizontally.
-
Chuck Le Butt almost 14 yearsI can't imagine why you'd want it to expand horizontally?
-
Aaron Franke over 4 yearsI have a
main
tag withmin-height
set and noheight
, and hasdiv
children, butmain
is not expanding to contain the children. Instead, the children are just overflowing. Thefooter
is at the top ofmain
's content becausemain
's actual size is tiny.