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

CSS में टेक्स्ट सजावट की शैली सेट करें

टेक्स्ट सजावट की शैली सेट करने के लिए text-decoration-style प्रॉपर्टी का उपयोग करें। आप निम्न मानों का उपयोग कर सकते हैं:

text-decoration-style: solid | double | dotted | dashed | wavy | initial | inherit;

उदाहरण

<!DOCTYPE html> <html> 
  <head> 
    <style> 
      span { 
        text-decoration: line-through; 
        text-decoration-color: blue; 
      } 
      .demo2 { 
        text-decoration: underline; 
        text-decoration-style: double; 
        text-decoration-color: red; 
      } 
    </style> 
  </head> 
  <body> 
    <h1>विवरण</h1> 
    <p class="demo">परीक्षा केंद्र <span>XYZ कॉलेज</span> ABC कॉलेज के पास।</p> 
    <p class="demo2">परीक्षा सुबह 11 बजे शुरू होती है।</p> 
  </body> 
</html>

आउटपुट

CSS में टेक्स्ट सजावट की शैली सेट करें

एक और उदाहरण

<!DOCTYPE html> <html> 
  <head> 
    <style> 
      .demo { 
        text-decoration: overline; 
        text-decoration-color: blue; 
        text-decoration-style: wavy; 
      } 
      .demo2 { 
        text-decoration: overline; 
        text-decoration-style: dashed; 
        text-decoration-color: red; 
      } 
    </style> 
  </head> 
  <body> 
    <h1>विवरण</h1> 
    <p class="demo">परीक्षा केंद्र ABC कॉलेज के पास।</p> 
    <p class="demo2">परीक्षा सुबह 11 बजे शुरू होती है।</p> 
  </body> 
</html>

आउटपुट

CSS में टेक्स्ट सजावट की शैली सेट करें

व्याख्या: text-decoration-style लाइन की शैली नियंत्रित करता है: solid (डिफ़ॉल्ट), double (दो लाइनें), dotted (बिंदु), dashed (डैश), wavy (लहरदार)। text-decoration शॉर्टहैंड सभी उप-प्रॉपर्टीज़ सेट करता है।

  1. CSS में टेक्स्ट डेकोरेशन CSS में टेक्स्ट डेकोरेशन

    text-decoration प्रॉपर्टी CSS में टेक्स्ट डेकोरेशन के लिए text-decoration प्रॉपर्टी का उपयोग एक शॉर्टहैंड के रूप में निम्नलिखित प्रॉपर्टीज के लिए किया जाता है: text-decoration-line text-decoration-color text-decoration-style सब-प्रॉपर्टीज: text-decoration-line: underline, overline, line-through

  1. HTML में टेक्स्ट डायरेक्शन कैसे सेट करें? HTML में टेक्स्ट डायरेक्शन कैसे सेट करें?

    CSS direction प्रॉपर्टी टेक्स्ट दिशा सेट करने के लिए style एट्रिब्यूट के साथ CSS direction प्रॉपर्टी उपयोग करें। मान: क्र.सं.मान और विवरण 1ltr - लेफ्ट टू राइट 2rtl - राइट टू लेफ्ट 3initial - डिफ़ॉल्ट मान उदाहरण <!DOCTYPE html> <html> <head> <title>HTML Text Direction

  1. HTML DOM Style lineHeight प्रॉपर्टी: लाइन ऊँचाई सेट करना HTML DOM Style lineHeight प्रॉपर्टी: लाइन ऊँचाई सेट करना

    DOM Style lineHeight प्रॉपर्टी lineHeight प्रॉपर्टी किसी एलिमेंट के टेक्स्ट की लाइन ऊँचाई (line height) सेट या प्राप्त करती है - यानी टेक्स्ट की पंक्तियों के बीच की दूरी। सिंटैक्स // प्राप्त करें object.style.lineHeight // सेट करें object.style.lineHeight = normal | number | length | % | initial |