How to make Flexbox Layout 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.
/**
Hello Future Developer Thanks for Using learningrobo.com,
Check our website Regularly For New Snippets Post.
Share & Support us
**/
@import url('https://fonts.googleapis.com/css2?family=Poppins&display=swap');
*{
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
margin: 0;
}
.main {
display: flex;
flex-direction: column;
width: 100%;
height: 100vh;
gap: 1vh;
padding: 10px;
}
.sub1{
text-align: center;
height: 33.3vh;
width: 100%;
display: flex;
gap: 10px;
}
.a1{
height: 100%;
background-color: #c61111;
width:10%;
}
.a2{
height: 100%;
background-color: #121212;
color: white;
width:30%;
}
.a3{
height: 100%;
background-color: #e21313;
width:60%;
}
.sub2{
text-align: center;
height: 33.3vh;
width: 100%;
display: flex;
gap: 10px;
}
.b1{
height: 100%;
background-color: #121212;
color: white;
width:10%;
}
.b2{
height: 100%;
background-color: #c61111;
width:30%;
}
.b3{
height: 100%;
background-color: #121212;
color: white;
width:60%;
}
.sub3{
text-align: center;
height: 33.3vh;
width: 100%;
display: flex;
gap: 10px;
}
.c1{
height: 100%;
background-color: #c61111;
width:10%;
}
.c2{
height: 100%;
background-color: #121212;
color: white;
width:30%;
}
.c3{
height: 100%;
background-color: #e21313;
width:60%;
}
@media screen and (max-width: 1024px) {
.sub1, .sub2, .sub3 {
flex-direction: column;
}
.a1, .a2, .a3, .b1, .b2, .b3, .c1, .c2, .c3 {
width: 100%;
}
}
@media screen and (max-width: 630px) {
.sub1, .sub2, .sub3 {
flex-direction: column;
}
.a1, .a2, .a3, .b1, .b2, .b3, .c1, .c2, .c3 {
width: 100%;
}
}
.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.
Post a Comment
Thank you
Learning robo team