For instance when flex-direction is row the property for .item-2 is in effect but it is not the case when flex-direction is column. What changes do i incorporate for the same. Thank You
This was in a attempt to undersstand how flexbox works in css as opposed to floats that is why . THanks once again
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Flex Basics</title>
<style>
* {
box-sizing: border-box;
}
body {
font-family: Arial, Helvetica, sans-serif;
}
.flex-container {
background-color: #f4f4f4;
display: flex;
flex-direction: column;
/* Cross axis align */
align-items: stretch;
/* Main axis align */
height: 50vh;
}
.item {
background: #f4f4f4;
border: #ccc solid 2px;
margin: 10px;
padding: 10px;
text-align: center;
border-radius: 10px;
flex: 1;
}
.item-2 {flex: 2}
</style>
</head>
<body>
<div class="flex-container">
<div class="item item-1">
<h3>Item 1</h3>
</div>
<div class="item item-2">
<h3>Item 2</h3>
</div>
<div class="item item-3">
<h3>Item 3</h3>
</div>
</div>
</body>
</html>