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

CSS के साथ सेक्शन काउंटर कैसे बनाएं?

<घंटा/>

CSS के साथ एक सेक्शन काउंटर बनाने के लिए, कोड इस प्रकार है -

उदाहरण

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/fontawesome.min.css">
<style>
   * {
      box-sizing: border-box;
   }
   body {
      font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif
   }
   .section {
      float: left;
      width: 25%;
      padding: 0 5px;
   }
   .sectionContainer {margin: 0 -5px;}
   .sectionContainer:after {
      content: "";
      display: table;
      clear: both;
   }
   @media screen and (max-width: 600px) {
      .section {
         width: 100%;
         display: block;
         margin-bottom: 10px;
      }
   }
   .sectionCard {
      box-shadow: 0 4px 8px 0 rgb(127, 16, 172);
      padding: 16px;
      text-align: center;
      background-color: rgb(127, 16, 172);
      color: rgb(255, 255, 255);
   }
   .fa {font-size:50px;}
</style>
</head>
<body>
<h1>Responsive Section Counter Example</h1>
<br>
<div class="sectionContainer">
<div class="section">
<div class="sectionCard">
<p><i class="fa fa-mobile" aria-hidden="true"></i></p>
<h3>100000+</h3>
<p>Downloads</p>
</div>
</div>
<div class="section">
<div class="sectionCard">
<p><i class="fa fa-globe" aria-hidden="true"></i></p>
<h3>5000+</h3>
<p>Outlets over the globe</p>
</div>
</div>
<div class="section">
<div class="sectionCard">
<p><i class="fa fa-bar-chart" aria-hidden="true"></i> </p>
<h3>Top Performer</h3>
<p>In past 5 years</p>
</div>
</div>
<div class="section">
<div class="sectionCard">
<p><i class="fa fa-handshake-o" aria-hidden="true"></i></p>
<h3>3000+</h3>
<p>Partners</p>
</div>
</div>
</div>
</body>
</html>

आउटपुट

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

CSS के साथ सेक्शन काउंटर कैसे बनाएं?

स्क्रीन का आकार बदलने पर -

CSS के साथ सेक्शन काउंटर कैसे बनाएं?


  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 के साथ चैट मैसेज कैसे बनाएं?

    सीएसएस के साथ चैट संदेश बनाने के लिए, कोड इस प्रकार है - उदाहरण <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style>    body {       margin: 0 auto;       m

  1. CSS के साथ वेबसाइट के बारे में / हमारे बारे में पेज कैसे बनाएं? CSS के साथ वेबसाइट के बारे में / हमारे बारे में पेज कैसे बनाएं?

    अबाउट पेज बनाने के लिए, कोड इस प्रकार है - उदाहरण <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" /> <style>    html {       box-sizing: border-box;    }   &nbs