multiple divs next to each other
.container {
display: flex;
}
.item {
background: #ce8888;
flex-basis: 100px;
height: 100px;
margin: 5px;
}
multiple divs next to each other
.container {
display: flex;
}
.item {
background: #ce8888;
flex-basis: 100px;
height: 100px;
margin: 5px;
}
place two div elements next to each other
In this solution we use display:
flex style property for our wrapping <div> element,
so in both children divs we can set flex: property
value with 1 to display two equal size <div> elements n
ext to each other.
ex :
<html>
<head>
<style>
div {
border: 1px solid red;
}
div.container {
display: flex; /* <---------- required */
}
div.child {
flex: 1; /* <---------------- required */
}
</style>
</head>
<body>
<div class="container">
<div class="child">1</div>
<div class="child">2</div>
</div>
</body>
</html>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us