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

सीएसएस के साथ समान ऊंचाई वाले कॉलम कैसे बनाएं?


CSS के साथ समान ऊंचाई वाले कॉलम बनाने के लिए, कोड इस प्रकार है -

उदाहरण

<!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;
   }
   .container {
      display: table;
      width: 100%;
   }
   .column {
      display: table-cell;
      padding: 16px;
      background-color: greenyellow;
   }
   .column:nth-of-type(2n-1) {
      color: red;
      background-color: yellow;
   }
</style>
</head>
<body>
<h1>Equal Height Columns Example</h1>
<div class="container">
<div class="column">
<h2>Column 1</h2>
<h2>Column 1</h2>
<h2>Column 1</h2>
</div>
<div class="column">
<h2>Column 2</h2>
<h2>Column 2</h2>
<h2>Column 2</h2>
</div>
<div class="column">
<h2>Column 3</h2>
<h2>Column 3</h2>
<h2>Column 3</h2>
</div>
</div>
</body>
</html>

आउटपुट

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

सीएसएस के साथ समान ऊंचाई वाले कॉलम कैसे बनाएं?


  1. सीएसएस के साथ तीर कैसे बनाएं? सीएसएस के साथ तीर कैसे बनाएं?

    सीएसएस के साथ तीर बनाने के लिए, कोड इस प्रकार है - उदाहरण <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" /> <style>    body {       font-family: "Segoe UI", Tahoma,

  1. CSS के साथ रिस्पॉन्सिव कॉलम कार्ड कैसे बनाएं? CSS के साथ रिस्पॉन्सिव कॉलम कार्ड कैसे बनाएं?

    सीएसएस के साथ रिस्पॉन्सिव कॉलम कार्ड बनाने के लिए, कोड इस प्रकार है - उदाहरण body { font-family:Segoe UI , ताहोमा, जिनेवा, वर्दाना, सेन्स-सेरिफ़; } * {बॉक्स-साइज़िंग:बॉर्डर-बॉक्स; } .कार्ड {रंग:सफेद; नाव छोड़ी; चौड़ाई:कैल्क (25% - 20px); पैडिंग:10px; सीमा-त्रिज्या:10px; मार्जिन:10px; ऊंचाई:200px; }

  1. सीएसएस के साथ मिश्रित कॉलम लेआउट ग्रिड कैसे बनाएं? सीएसएस के साथ मिश्रित कॉलम लेआउट ग्रिड कैसे बनाएं?

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