1
Guys, I’m lined up a few div
as columns inside another that serves as container. What I wanted to know is how do I make it in certain width of itself div
or from the page they group together on top of each other in a vertical flow?
HTML
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="utf-8">
<title>Layout Responsivo</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<div class="container" class="clearfix">
<div class="header clearfix">
<div class="logo">
logo
</div>
<div class="menu">
menu
</div>
</div>
<div class="content clearfix">
<div class="col" style="background: red;">
</div>
<div class="col" style="background: yellow;">
</div>
<div class="col" style="background: cyan;">
</div>
</div>
</div>
</body>
</html>
CSS
html, body{
padding: 0;
margin: 0;
}
.clearfix:before,
.clearfix:after {
content: " ";
display: table;
}
.clearfix:after {
clear: both;
}
.clearfix {
*zoom: 1;
}
.container{
margin: 0 auto;
margin-top: 0;
width: auto;
height: 900px;
/*...*/
background-color: #876;
}
.header{
width: 100%;
margin: 0 auto;
height: auto;
margin-bottom: 3.6em;
background-color: #2C82C9;
}
.logo{
width: 100%;
height: 160px;
/*...*/
background-color: transparent;
}
.menu{
width: 100%;
height: 70px;
/*...*/
background-color: #456;
}
/*Content*/
.content{
margin: 0 auto;
width: 88%;
height: 400px;
/*...*/
background-color: #546;
}
.col{
width: 33.33333333333333%;
float: left;
display: inline;
height: 300px;
}
Enter the code you already have, or the attempts you made that didn’t work.
– Guilherme Lopes
Which Divs do you want to align vertically? O
.header
and the.content
?– Samir Braga
@Samirbraga these three with the
class=col
– Mike
Group one on top of the other, do you mean overlap the Divs? And overlap in vertical flow? I don’t quite understand what you want...
– Guilherme Lopes
@Guillermo does not overlap. I want that when it reaches a certain size of the broswer window, for example, they stop being aligned and stay below each other. But the problem has been solved
– Mike