محتوى الدورة
Learn CSS In Arabic 2021
وصف الدرس

ال 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>
  </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
  - align-items: stretch => Default Value
  - align-content: stretch => Default Value
*/

* {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}
.flex {
  background-color: #eee;
  width: 600px;
  height: 400px;
  padding: 20px;
  margin: 20px auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  align-content: space-between;
}
.flex div {
  background-color: #f00;
  color: white;
  width: calc(100% / 3);
  text-align: center;
  padding: 20px;
}