Computer >> कंप्यूटर ट्यूटोरियल >  >> प्रोग्रामिंग >> CSS

CSS से 4-कॉलम लेआउट ग्रिड कैसे बनाएं?

उदाहरण

CSS से 4-कॉलम लेआउट ग्रिड बनाने के लिए, निम्न कोड का उपयोग करें:

<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" /> <style>    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    * {       box-sizing: border-box;    }    .first, .second, .third, .fourth {       float: left;       width: 25%;       color: white;       padding: 10px;       height: 500px;       text-align: center;    }    .first {       background-color: tomato;    }    .second {       background-color: teal;    }    .third {       background-color: rgb(166, 71, 255);    }    .fourth {       background-color: rgb(255, 71, 194);    }    .container:after {       clear: both;    } </style> </head> <body> <h1 style="text-align: center;">Four Column grid example</h1> <div class="container"> <div class="first"> <h1>Some text on the first div</h1> </div> <div class="second"> <h1>Some text on the second div</h1> </div> <div class="third"> <h1>Some text on the third div</h1> </div> <div class="fourth"> <h1>Some text on the fourth div</h1> </div> </div> </body> </html>

आउटपुट

उपरोक्त कोड निम्न आउटपुट उत्पन्न करेगा:

CSS से 4-कॉलम लेआउट ग्रिड कैसे बनाएं?

  1. CSS और JavaScript से एक्सपैंडिंग ग्रिड कैसे बनाएं? CSS और JavaScript से एक्सपैंडिंग ग्रिड कैसे बनाएं?

    उदाहरण CSS और JavaScript से एक्सपैंडिंग ग्रिड बनाने के लिए, निम्न कोड का उपयोग करें: <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" /> <style>    body {       padding: 1%; &n

  1. CSS से 4-कॉलम लेआउट ग्रिड कैसे बनाएं? CSS से 4-कॉलम लेआउट ग्रिड कैसे बनाएं?

    उदाहरण CSS से 4-कॉलम लेआउट ग्रिड बनाने के लिए, निम्न कोड का उपयोग करें: <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" /> <style>    body {       font-family: "Segoe UI&

  1. CSS से चेकमार्क/टिक कैसे बनाएं? CSS से चेकमार्क/टिक कैसे बनाएं?

    हम CSS का उपयोग करके एक कस्टमाइज़्ड चेकमार्क बना सकते हैं। निम्न उदाहरण इस प्रभाव को दर्शाते हैं: उदाहरण 1 (प्सूडो-एलिमेंट से) <!DOCTYPE html> <html> <style> div {    margin: 2%;    position: relative;    width: 40px;    height: 40px;