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

CSS से पिल बटन (गोल कोने वाले) कैसे बनाएं?


पिल बटन के पूरी तरह गोल कोने होते हैं (border-radius: 32px या अधिक)। ये आधुनिक UI डिज़ाइन में लोकप्रिय हैं और इंटरएक्टिव तत्वों को मित्रवत बनाते हैं।

उदाहरण

<!DOCTYPE html>
<html>
<head>
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <style>
    button {
      font-family: "Lucida Sans", "Lucida Sans Regular", "Lucida Grande", "Lucida Sans Unicode", Geneva, Verdana, sans-serif;
      background-color: rgb(193, 255, 236);
      border: none;
      color: rgb(0, 0, 0);
      padding: 10px 20px;
      text-align: center;
      text-decoration: none;
      display: inline-block;
      margin: 4px 2px;
      cursor: pointer;
      font-size: 30px;
      border-radius: 32px;
    }
    button:hover {
      background-color: #9affe1;
    }
  </style>
</head>
<body>
  <h1>Pill Buttons Example</h1>
  <button>Button 1</button>
  <button>Button 2</button>
  <div></div>
  <button>Button 3</button>
  <button>Button 4</button>
</body>
</html>

आउटपुट

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

CSS से पिल बटन (गोल कोने वाले) कैसे बनाएं?

मुख्य बिंदु

  • border-radius: 32px - ऊंचाई से बड़ा मान पूरी तरह गोल कोने बनाता है
  • पैडिंग अनुपात - क्षैतिज पैडिंग ऊर्ध्वाधर से अधिक होना चाहिए
  • हल्का बैकग्राउंड - मिंट ग्रीन रंग आधुनिक लुक देता है
  • होवर पर थोड़ा गहरा - सूक्ष्म इंटरएक्शन फीडबैक
  1. CSS से बेसिक कार्ड कैसे बनाएं? CSS से बेसिक कार्ड कैसे बनाएं?

    बेसिक कार्ड में इमेज, नाम, पदनाम होता है। बॉक्स-शैडो, होवर पर शैडो गहरी, पदनाम बैज स्टाइल, रिस्पॉन्सिव चौड़ाई (40%, मैक्स 300px)। उदाहरण <!DOCTYPE html> <html> <head> <meta name=viewport content=width=device-width, initial-scale=1> <style> body { font-family:

  1. CSS से कूपन बनाना 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; } img { width: 100%; } .coupon

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

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