Answer the question
In order to leave comments, you need to log in
How to stretch div by content?
beaten topic, but still, there is such a code
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
</head>
<body>
<div class="mainContainer">
<div class="topMenu"></div>
<div class="container">
<div class="leftMenu floatLeft">
</div>
<div class="information floatLeft">
</div>
</div>
</div>
</body>
</html>
html,body{
margin: 0;
padding: 0;
font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
}
html{
min-height: 100%;
height: 1px;
}
body{
height: 100%;
}
.mainContainer{
min-height: 100%;
height: 1px;
width: 100%;
}
.topMenu{
height: 50px;
width: 100%;
}
.container{
min-height: 100%;
height: 1px;
width: 100%;
}
.leftMenu{
height: 100%;
width: 19%;
padding: 1.5em 1em 1.5em 1em;
margin-right: -2em;
overflow-x: hidden;
}
.information{
position: relative;
height: 100%;
width: 81%;
background-color: #F9F9F9;
border: 1px solid #bbbbbb;
border-right-width: 0;
margin-left: -1px;
}
.floatLeft{
float: left;
}
html{
min-height: 100%;
height: 1px;
}
body{
height: 100%;
}
I think the principle is clear. Answer the question
In order to leave comments, you need to log in
height:auto; ?)
in more detail, then you need to set this property
height:auto; instead of
height: 1px;
to class
to the .container
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question