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

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


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

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

उदाहरण

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
body { font-family: Arial; color: white; }
.left, .right { height: 50%; width: 50%; position: fixed; overflow-x: hidden; padding-top: 20px; }
.left { left: 0; background-color: rgb(36, 0, 95); }
.right { right: 0; background-color: rgb(56, 1, 44); }
.centered { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }
.centered img { width: 150px; border-radius: 50%; }
</style>
</head>
<body>
<h1 style="color: black;">Two column layout grid example</h1>
<div class="left"><h1>Some random text on the left</h1></div>
<div class="right"><h1>Some random text on the right</h1></div>
</body>
</html>

आउटपुट

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


  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&