وصف الدرس
ال Code الموجود في الدرس
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>CSS</title>
<link rel="stylesheet" href="css/master.css" />
</head>
<body>
<h3>Flex</h3>
<div class="flex">
<div>One</div>
<div>Two</div>
<div>Three</div>
<div>Four</div>
<div>Five</div>
</div>
<hr />
<h3>Float</h3>
<div class="float">
<div>One</div>
<div>Two</div>
<div>Three</div>
<div>Four</div>
<div>Five</div>
</div>
</body>
</html>
/*
Flexible Box
For Parent
- display: flex => To Start Flexible Box
- flex-direction: row => Default Value
- flex-wrap: nowrap => Default Value
- flex-flow: [Flex-Direction] + [Flex-Wrap]
---
- justify-content: flex-start => Default Value
*/
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.flex {
background-color: #eee;
width: 600px;
padding: 20px;
margin: 20px auto;
display: flex;
flex-flow: row wrap;
justify-content: center;
}
.flex div {
background-color: #f00;
color: white;
width: 25%;
text-align: center;
padding: 20px;
}
.float {
overflow: hidden;
background-color: #eee;
width: 600px;
padding: 20px;
margin: 20px auto;
}
.float div {
background-color: #f00;
color: white;
float: right;
width: 25%;
text-align: center;
padding: 20px;
}