Answer the question
In order to leave comments, you need to log in
How to arrange divs in a row and not in a column?
Hello, please tell me how to arrange a div in a row, this code does not work
<!DOCTYPE html>
<body>
<div id="container">
<div class="block"></div>
<div class="block"></div>
<div class="block"></div>
<div class="block"></div>
</div>
</body>
<style>
#container {
width: 30vmin;
height: 30vmin;
background: green;
display: inline-block;
}
.block {
width: 10vmin;
height: 10vmin;
background: red;
}
</style>
</html>
Answer the question
In order to leave comments, you need to log in
You can use flex:
#container {
display: flex;
flex-direction: column;
justify-content: center;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question