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: 0px;
}
.main{
height: 100vh;
width: 100vw;
display: flex;
gap: 5px;
padding: 5px;
}
.submain{
height:100%;
width: 66.6%;
display: flex;
flex-direction: column;
gap: 5px;
}
.submain0{
height: 75%;
width: 100%;
flex-direction: column;
display: flex;
}
.item1{
display: flex;
flex-direction: column;
height: 100%;
width: 100%;
background-color: #f08181;
text-align: center;
justify-content: center;
}
.submain1{
height: 25%;
width: 100%;
display: flex;
flex-direction: row;
gap: 5px;
}
.item5{
display: flex;
flex-direction: column;
text-align: center;
justify-content: center;
height: 100%;
background-color: rgb(199, 53, 24);
width: 50%;
}
.item6{
display: flex;
flex-direction: column;
text-align: center;
justify-content: center;
height: 100%;
background-color: rgb(199, 53, 24);
width: 50%;
}
.submain2{
height: 100%;
display: flex;
flex-direction: column;
width: 33.3vw;
gap: 5px;
}
.item2{
display: flex;
flex-direction: column;
text-align: center;
justify-content: center;
height: 25%;
width: 100%;
background-color: rgb(199, 53, 24);
}
.item3{
display: flex;
flex-direction: column;
text-align: center;
justify-content: center;
height: 25%;
width: 100%;
background-color: rgb(199, 53, 24);
}
.item4{
display: flex;
flex-direction: column;
text-align: center;
justify-content: center;
height: 25%;
width: 100%;
background-color: rgb(199, 53, 24);
}
.item7{
display: flex;
flex-direction: column;
text-align: center;
justify-content: center;
height: 25%;
width: 100%;
background-color: rgb(199, 53, 24);
}
@media screen and (max-width: 1024px) {
.main {
flex-direction: column;
height: 150vh;
width: 100%;
}
.submain0, .submain1,.submain2 {
width: 100%;
height: 100%;
}
.item1, .item5, .item6{
width: 150%;
}
.submain0, .submain1, .submain2 {
flex-direction: column;
}
}
.credit a {
text-decoration: none;
color: #121212;
font-weight: 800;
}
.credit {
color: #121212;
text-align: center;
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