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

CSS3 से HTML में पतले फॉन्ट्स को स्मूथली कैसे रेंडर करें?


पतले फॉन्ट्स के लिए फॉन्ट स्मूथिंग

पतले फॉन्ट्स को अधिक स्मूथली रेंडर करने के लिए:

text-rendering: optimizeLegibility !important;
-webkit-font-smoothing: antialiased !important;
-moz-osx-font-smoothing: grayscale !important;

केवल Google Chrome के लिए

-webkit-font-smoothing: antialiased !important;

text-rendering वैल्यूज

text-rendering: auto;
text-rendering: optimizeSpeed;
text-rendering: optimizeLegibility;
text-rendering: geometricPrecision;
text-rendering: inherit;

व्याख्या

प्रॉपर्टीविवरण
text-rendering: optimizeLegibilityपठनीयता के लिए ऑप्टिमाइज़ करता है, लिगेचर्स और कर्निंग सक्षम करता है
-webkit-font-smoothing: antialiasedWebKit/Blink में सबपिक्सल एंटीएलियासिंग बंद करता है (पतले फॉन्ट्स के लिए बेहतर)
-moz-osx-font-smoothing: grayscalemacOS पर Firefox में ग्रेस्केल एंटीएलियासिंग सक्षम करता है

सावधानियाँ

  • !important का अत्यधिक उपयोग न करें - विशिष्टता बढ़ाएं।
  • optimizeLegibility मोबाइल पर प्रदर्शन प्रभाव डाल सकता है।
  • सबपिक्सल एंटीएलियासिंग (डिफ़ॉल्ट) रंगीन फ्रिंजिंग का कारण बन सकता है।
  • सिस्टम फॉन्ट्स (San Francisco, Segoe UI) पहले से ऑप्टिमाइज़्ड होते हैं।
  1. JavaScript से <strong> टैग में टेक्स्ट कैसे सेट करें? JavaScript से <strong> टैग में टेक्स्ट कैसे सेट करें?

    उदाहरण सबसे पहले <strong> एलिमेंट सेट करें: <strong id=strongDemo>Replace This strong tag</strong> आईडी का उपयोग करके jQuery से टेक्स्ट सेट करें: $(document).ready(function(){ $(#strongDemo).html(Actual value of 5+10 is 15.....); }); पूरा HTML कोड: <!DOCTYPE html> <

  1. JavaScript से स्क्रीन रेजोल्यूशन कैसे पता करें? JavaScript से स्क्रीन रेजोल्यूशन कैसे पता करें?

    उदाहरण स्क्रीन रेजोल्यूशन जानने के लिए window.screen ऑब्जेक्ट का उपयोग करें। // चौड़ाई के लिए window.screen.availWidth // ऊंचाई के लिए window.screen.availHeight पूरा कोड: <!DOCTYPE html> <html lang=en> <head> <meta charset=UTF-8> <meta name=viewport content=width=devic

  1. HTML में बिब्लियोग्राफी (ग्रंथ सूची) कैसे बनाएं? HTML में बिब्लियोग्राफी (ग्रंथ सूची) कैसे बनाएं?

    <ol> और <cite> टैग्स का उपयोग बिब्लियोग्राफी (संदर्भ ग्रंथ सूची) बनाने के लिए <ol> से क्रमांकित सूची और <cite> से पुस्तक/कृति का शीर्षक मार्क करें। उदाहरण <!DOCTYPE html> <html> <head> <title>Bibliography</title> </head> <body>