.container {
display: flex;
}
.item {
background: #ce8888;
flex-basis: 100px;
height: 100px;
margin: 5px;
}
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>
Code Example |
---|
Css :: css ordened list style color |
Css :: login page design html css |
Css :: css class |
Css :: how to change button border color in css |
Css :: progress bar bootstrap border |
Css :: include screen size |
Css :: nprogress css |
Css :: div center |
Css :: double color background css |
Css :: angular css path to assets |
Css :: declare variables for color in css |
Css :: background single line property css |
Css :: blur background image css |
Css :: cs cirlce |
Css :: css padding attribute order |
Css :: two line ellipsed |
Css :: text sliding css |
Css :: css select parent |
Css :: repeating gradient |
Css :: overflow-wrap: anywhere |
Css :: center a block element |
Css :: How to force fully show the keyboard in android |
Css :: max width css |
Css :: css grid example |
Css :: css push div down |
Css :: change image link css |
Css :: centrar imagen flexbox |
Css :: buttons have strange style iOS |
Css :: svg background |
Css :: css font leading |