Nested Flex tutorial in Flexbox CSS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Nested Flex Flexbox CSS</title>
<link rel="stylesheet" href="css/Nested_Flex_Flexbox_CSS.css">
</head>
<body>
<h1>Hello World : Nested Flex Flexbox CSS</h1>
<div class="container">
<div class="items item1">One</div>
<div class="items item2">
<div class="subitem subitem1">A</div>
<div class="subitem subitem2">B</div>
<div class="subitem subitem3">C</div>
</div>
<div class="items item3">Three</div>
</div>
</body>
</html>
Below File is css/Nested_Flex_Flexbox_CSS.css File
body {
font-family: arial, helvetica;
}
h1 {
padding: 0 0 0 40px;
}
.container {
background: #eee;
margin: 50px;
padding: 0px;
border: 3px solid #000;
display: flex;
flex-direction: column;
}
.item1 {
background: #ff4500;
}
.item2 {
background: #9acd32;
display: flex;
}
.item2>.subitem {
background: #f5deb3;
color: #9370d8;
flex-grow: 1;
margin: 5px;
}
.item3 {
background: #9370d8;
}
.items {
color: #ffffff;
font-size: 20px;
font-weight: bold;
text-align: center;
padding: 0px;
height: 100px;
}
.png)
.png)
Comments
Post a Comment