How to Day 1: "Getting Started with Flexbox: Easy Layouts with HTML and CSS.[Source Code]
To make this website, you would like to make two files: an HTML file, a CSS file. First, create an HTML file with the name of index.html and remember, you have to create a file with a .html extension.
@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap');
*{
box-sizing: border-box;
}
body{
margin: 0px;
}
.mp{
display: flex;
flex-wrap: wrap;
width: calc(100vw-10px);
height: 100vh;
background-color: rgb(66, 62, 62);
padding: 10px;
gap:10px;
font-family: "Roboto Mono", monospace;
font-optical-sizing: auto;
}
.p1,.p3{
display: flex;
width: 100%;
height: 19%;
align-items: center;
justify-content: center;
background-color: rgb(77, 77, 165);
border-color: black;
border-style: solid;
border-width: 5px;
}
.p2{
display: flex;
width: 100%;
height: 60%;
gap:10px;
}
.p2c1{
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 30%;
height: 100%;
background-color: rgb(93, 201, 186);
border-color: black;
border-style: solid;
border-width: 5px;
}
.p2c2{
display: flex;
flex-wrap: wrap;
width: 70%;
height: 98.4%;
gap:10px;
}
.p2c2g1{
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 50%;
background-color: rgb(79, 79, 211);
border-color: black;
border-style: solid;
border-width: 5px;
}
.p2c2g2{
display: flex;
width: 100%;
height: 50%;
gap:10px;
}
.p2c2g2 > div{
display: flex;
align-items: center;
justify-content: center;
width: 50%;
height: 100%;
background-color: rgb(79, 79, 211);
border-color: black;
border-style: solid;
border-width: 5px;
}
@media screen and (max-width:1024px) {
.container{
width: calc(100vw-10px);
height: 100vh;
}
.p2{
flex-direction: column;
}
.p2c2g2{
height: 47%;
}
.p2 div{
width: 100%;
}
.p1,.p2{
height: calc(20%-10px);
}
}
@media screen and (max-width:630px) {
.p2,.p2c2g2,.p2c2g2-1,.p2c2g2-1{
flex-direction: column;
}
.p2 div{
width: 100%;
}
.mp{
height: 180vh;
}
}
.credit a {
text-decoration: none;
color: #121212;
font-weight: 800;
}
.credit {
color: #121212;
text-align: center;
margin-top: 10px;
font-family: Verdana,Geneva,Tahoma,sans-serif;
}
.credit span{
color:#000;
font-size:20px;
}
Thank you for reading our blog. If you face any problem in Creating a Flexbox Layout Using HTML and CSS., then contact us or comment to us. We’ll try to provide a solution to your problem as soon as possible.
Explore
Press The Key ' p ' and say ' read article ' our voice assistant read our article.
In Our older post it doesnot work we working on that.
In Our older post it doesnot work we working on that.
إرسال تعليق
Thank you
Learning robo team