ال Code الموجود في الدرس
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>CSS</title>
<link rel="stylesheet" href="css/master.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body>
<div class="parent">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
</div>
</body>
</html>
/*
Media Queries
Responsive Design
- Mobile First
- Test Devices
*/
* {
box-sizing: border-box;
margin: 0;
}
.parent {
display: flex;
flex-wrap: wrap;
justify-content: space-evenly;
}
.parent > div {
padding: 20px;
background-color: red;
color: white;
font-size: 20px;
text-align: center;
font-weight: bold;
width: 100%;
margin-bottom: 5px;
}
/* Mobile */
@media (max-width: 767px) {
}
/* Small Screens */
@media (min-width: 768px) {
.parent > div {
width: calc(50% - 10px);
}
}
/* Medium Screens */
@media (min-width: 992px) {
.parent > div {
width: calc(25% - 10px);
}
}
/* Large Screens */
@media (min-width: 1200px) {
}
/* Custom */
@media (max-width: 1199px) {
}