Responsive Web Design with Flexbox: Simple Techniques - 04

                                                                                





































Hello Developers, we are excited to introduce a highly flexible and efficient Flexbox layout snippet, expertly crafted with HTML and CSS. This snippet allows you to create dynamic and responsive layouts for your website, offering an adaptable way to arrange content in a clean and organized manner. The Flexbox layout is perfect for designing user interfaces that require complex alignment, spacing, and distribution of items, making it a powerful tool for modern web design. The Flexbox layout snippet is fully responsive, ensuring your content looks great on any device, from desktops to smartphones. The layout is designed to be highly customizable, allowing you to control the alignment, direction, order, and size of items within a container. By utilizing CSS Flexbox properties, you can create flexible and unique designs that adapt seamlessly to different screen sizes and orientations, enhancing the overall user experience. Incorporating this HTML and CSS Flexbox layout snippet into your website not only improves its visual appeal but also enhances its functionality. This snippet demonstrates your commitment to quality web design, providing a robust framework for organizing content. Whether you are creating a navigation menu, a gallery, or a complex webpage layout, this Flexbox layout will help you present your content in a professional and aesthetically pleasing manner. Experiment with different configurations and styles to create a layout that perfectly matches your vision and requirements.

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.

<!DOCTYPE html> <html lang="en"> <head> <title>Responsive Flexbox Layout Using HTML & CSS</title> <meta name="description" content="Responsive Profile card Using HTML & CSSt. Made by learningrobo.com"> <meta name="author" content="learningrobo.com"> <meta name="keywords" content="form,responsive,learningrobo.com,html & css projects,project,Flexbox Layout"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="icon" type=image/x-icon href="#"> <meta charset="UTF-8"> <script src="https://kit.fontawesome.com/5d72166fb5.js" crossorigin="anonymous"></script> <link href="style.css" rel="stylesheet"> </head> <body> <!--Hello Future Developer Thanks for Using learningrobo.com, Share & Support us--> <div class="main"> <div class="sub1"> <div class="a1"> <h1>1</h1> </div> <div class="a2"> <h1>2</h1> </div> <div class="a3"> <h1>3</h1> </div> <div class="a4"> <h1>4</h1> </div> </div> <div class="sub2"> <div class="b1"> <h1>5</h1> </div> <div class="b2"> <h1>6</h1> </div> </div> <div class="sub3"> <div class="c1"> <h1>7</h1> </div> <div class="c2"> <h1>8</h1> </div> <div class="c3"> <h1>9</h1> </div> <div class="c4"> <h1>10</h1> </div> </div> </div> <div class="credit">Made with <span>❤ </span>by<a href="https://www.learningrobo.com/">learningrobo</a></div> <!--Check our website Regularly For New Snippets Post--> </body> </html>
CSS provides style to an HTML page. To make the page attractive create a CSS file with the name style.css and remember that you have to make a file with a .css 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;
}

.main{
    height: 80%;
    width: 80%;
    display: flex;
    flex-direction: row;
    gap:10px;
}
.sub1{
    height: 100vh;
    width: 38vw;
    background-color: rgb(242, 236, 236);
    display:flex;
    flex-direction: column;
    text-align: center;
    gap: 10px;
}
.a1{
    height: 33.3vh;
    width: 33.3vw;
    background-color: red;
}
.a2{
    height: 33.3vh;
    width: 33.3vw;
    background-color: red;
}
.a3{
    height: 33.3vh;
    width: 33.3vw;
    background-color: red;
}
.a4{
    height: 33.3vh;
    width: 33.3vw;
    background-color: red;
    font:  sans-serif;
}
.sub2{
    height: auto;
    color: aliceblue;
    display:flex;
    flex-direction:column;
    width:  58vw;
    text-align: center;
    gap: 10px;
    background-color: rgb(247, 247, 247);
} 
.b1{
    height: 75vh;
    width: 32vw;
    background-color: black;
    display: flex;
    flex-direction: column;
}
.b2{
    height: 24vh;
    width: 32vw;
    background-color: black;
    display: flex;
    flex-direction: column;
} 
.sub3{
    height: 100vh;
    width: 38vw;
    background-color: rgb(242, 236, 236);
    display:flex;
    flex-direction: column;
    text-align: center;
    gap: 10px;
}
.c1{
    height: 33.3vh;
    width: 33.3vw;
    background-color: red;
}
.c2{
    height: 33.3vh;
    width: 33.3vw;
    background-color: red;
}
.c3{
    height: 33.3vh;
    width: 33.3vw;
    background-color: red;
}
.c4{
    height: 33.3vh;
    width: 33.3vw;
    background-color: red;
    font:  sans-serif;
}
@media screen and (max-width: 1024px) {
    .main {
        flex-direction: column;
        width: 100%;
        height: auto;
    }
    .sub1, .sub3 {
        width: 100%;
        height: auto;
    }
    .a1, .a2, .a3, .a4,
    .c1, .c2, .c3, .c4 {
        height: 25vh;
        width: 100%;
    }
    .sub2 {
        width: 100%;
    }
    .b1, .b2 {
        width: 100%;
    }
}
@media screen and (max-width: 630px) {
    .main {
        flex-direction: column;
        width: 100%;
        height: auto;
    }
    .sub1, .sub3 {
        width: 100%;
        height: auto;
    }
    .a1, .a2, .a3, .a4,
    .c1, .c2, .c3, .c4 {
        height: 20vh;
        width: 100%;
    }
    .sub2 {
        width: 100%;
    }
    .b1, .b2 {
        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;
}     
We hope you would like this Flexbox Layout using HTML and CSS.

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.

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.












Thank you
Learning robo team

Post a Comment

Thank you
Learning robo team

Post a Comment (0)

Previous Post Next Post
Learning Robo says...
code copied
Welcome