How to make Responsive Web Design with Flexbox Using 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&family=Rubik:ital,wght@0,300..900;1,300..900&display=swap');
/* DESKTOP VIEW */
body {
margin: 0px;
}
.main {
display: flex;
flex-direction: column;
background-color: rgb(73, 255, 197);
width: calc(100%-2vh);
height: 700px;
gap: 1vh;
font-family: "Rubik", sans-serif;
font-optical-sizing: auto;
}
.mp1 {
height: 20vh;
}
.mp2 {
display: flex;
width: 100%;
background-color: rgba(0, 0, 0, 0);
height: 200vh;
gap: 1vh;
/* flex-wrap: wrap; */
}
.p2c1 {
display: flex;
height: 99%;
width: 15%;
gap: 2vh;
}
.p2c2 {
display: flex;
height: 100%;
width: 69%;
gap: 1vh;
flex-direction: column;
}
.p2c21 {
display: flex;
flex-direction: column;
width: 99%;
height: 30%;
gap: 1vh;
}
.p2c22 {
display: flex;
flex-direction: column;
width: 99%;
height: 68%;
gap: 1vh;
}
.p2c3 {
display: flex;
width: 15%;
height: 99%;
gap: 1vh;
}
.mp3 {
display: flex;
height: 30vh;
gap: 1vh;
}
.mp1,.mp3,.p2c1,.p2c21,.p2c22,.p2c3{
border: 4px solid rgb(0, 0, 0);
}
.mp1,.mp3,.p2c1,.p2c21,.p2c22,.p2c3{
display: flex;
justify-content: center;
align-items: center;
}
/* TABLET VIEW */
@media screen and (max-width:1024px) {
.main {
background-color: rgb(207, 156, 255);
}
.mp2 {
flex-direction: row;
display: flex;
}
.p2c21 {
flex-direction: column;
width: 98.5%;
order: 2;
}
.p2c1 {
width: 15%;
height: 99%;
order: 1;
}
.p2c22 {
width: 98.5%;
height: 99%;
order: 3;
}
.p2c3 {
flex-direction: row;
width: 15%;
height: 99%;
order: 3;
}
}
/* MOBILE VIEW */
@media screen and (max-width:600px) {
.main {
height: 670px;
background-color: rgb(177, 209, 238);
}
.mp1 {
width: 98%;
height: 10vh;
}
.mp2 {
flex-direction: column;
display: flex;
}
.p2c2 {
width: 98%;
}
.p2c21 {
width: 100%;
order: 1;
height: 10vh;
}
.p2c1 {
width: 98%;
order: 2;
height: 10vh;
}
.p2c22 {
width: 100%;
order: 3;
height: 30vh;
}
.p2c3 {
width: 98%;
order: 4;
height: 10vh;
}
.mp3 {
width: 98%;
height: 10vh;
}
}
.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 Responsive Web Design with Flexbox 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.
Post a Comment
Thank you
Learning robo team