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

CSS से 3-कॉलम लेआउट ग्रिड बनाना


3-कॉलम ग्रिड लेआउट

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

उदाहरण

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

आउटपुट

CSS से 3-कॉलम लेआउट ग्रिड बनाना


  1. CSS और JavaScript से लिस्ट ग्रिड व्यू कैसे बनाएं? CSS और JavaScript से लिस्ट ग्रिड व्यू कैसे बनाएं?

    उदाहरण लिस्ट ग्रिड व्यू बनाने के लिए, निम्न कोड का उपयोग करें: <!DOCTYPE html> <html> <head> <style>    * {       box-sizing: border-box;    }    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdan

  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&