🔷 1. Introduction:
The <basefont>
tag in HTML is used to set a default font style, size, and color for all the text on the web page.
Once this tag is set, all the text in the page will follow its settings, unless changed by another tag.
It is useful to apply the same style to the whole page quickly.
Note: This tag is deprecated in HTML5.
🔷 2. Definition:
The <basefont>
tag defines the base font (default font) for the webpage.
It affects all the text inside the <body>
unless a specific <font>
tag overrides it.
🔷 3. Attributes of <basefont>
:
Attribute | Use / Meaning |
---|---|
face | Sets default font style (e.g., Arial, Verdana) |
size | Sets default font size (1 to 7) |
color | Sets default text color |
🔷 4. Syntax + Example (Code):
<basefont face="Verdana" size="5" color="green">
<p>This paragraph will follow the basefont settings.</p>
<p>So will this one.</p>
🔷 5. Output (What appears in browser):
- Both paragraphs will appear in Verdana font
- Font size 5
- Text color green
Unless another <font>
tag is used later, all text will follow this default style.
🔷 6. Real Life Example:
Suppose a teacher is creating a project page and wants all text to appear in red and size 4.
Using just <basefont color="red" size="4">
at the top makes the job easy — no need to style every paragraph separately.
🔷 7. Practical Notes:
- This tag is no longer used in modern HTML5
- CSS is now the preferred way to style text across the page
- For learning purposes,
<basefont>
helps beginners understand default styling
🔷 8. CSS Alternative:
Instead of <basefont>
, you should now use:
<style>
body {
font-family: Verdana;
font-size: 20px;
color: green;
}
</style>
🔷 9. Advantages:
- Saves time by applying one style to all text
- Easy to use
- Good for beginners learning consistent formatting
- Works in older HTML documents
🔷 10. Limitations:
- Deprecated in HTML5
- Does not work in modern browsers like Chrome, Firefox
- Limited customization
- CSS is more flexible and powerful
HTML का <basefont>
टैग
🔷 1. परिचय (Introduction):
HTML में <basefont>
टैग का उपयोग पूरे वेबपेज के लिए डिफ़ॉल्ट टेक्स्ट स्टाइल,
जैसे कि फॉन्ट का प्रकार (face), आकार (size) और रंग (color) सेट करने के लिए किया जाता है।
एक बार यह टैग सेट कर दिया जाए, तो पूरी वेबसाइट पर वही स्टाइल लागू हो जाती है —
जब तक कि किसी खास जगह पर <font>
टैग से अलग स्टाइल ना दी जाए।
❗ यह टैग HTML5 में deprecated (बंद) हो चुका है, लेकिन सीखने के लिए अब भी उपयोगी है।
🔷 2. परिभाषा (Definition):
<basefont>
टैग वेबपेज के सभी टेक्स्ट के लिए डिफ़ॉल्ट फॉर्मेटिंग सेट करता है।
जब हम इसे <body>
में ऊपर लगाते हैं, तो पूरे पेज पर वही फॉन्ट, साइज और रंग दिखाई देता है।
🔷 3. Attributes और उनका उपयोग:
Attribute | कार्य |
---|---|
face | टेक्स्ट का डिफ़ॉल्ट फॉन्ट सेट करता है (जैसे Arial, Verdana) |
size | टेक्स्ट का डिफ़ॉल्ट साइज सेट करता है (1 से 7 तक) |
color | डिफ़ॉल्ट टेक्स्ट का रंग सेट करता है |
🔷 4. सिंटैक्स + उदाहरण (Code):
<basefont face="Verdana" size="5" color="green">
<p>यह पैराग्राफ basefont सेटिंग को फॉलो करेगा।</p>
<p>यह भी उसी स्टाइल में दिखाई देगा।</p>
🔷 5. आउटपुट (Output):
- दोनों पैराग्राफ Verdana फॉन्ट में
- साइज 5
- और हरा रंग (green) में दिखाई देंगे।
जब तक किसी और <font>
टैग से स्टाइल ना बदली जाए, यह स्टाइल पूरे पेज पर लागू रहेगी।
🔷 6. वास्तविक जीवन उदाहरण (Real Life Example):
मान लीजिए एक शिक्षक HTML में प्रोजेक्ट बना रहे हैं और चाहते हैं कि पूरा पेज लाल रंग और साइज 4 में दिखे।
तो वह केवल एक बार <basefont color="red" size="4">
लगाते हैं, और सारा टेक्स्ट वैसा ही दिखाई देता है —
हर पैराग्राफ में अलग-अलग <font>
लगाने की ज़रूरत नहीं।
🔷 7. व्यावहारिक जानकारी (Practical Notes):
<basefont>
टैग पुराने HTML वर्जन में चलता था (HTML 4.01)- HTML5 में इसका उपयोग नहीं किया जाता
- अब इसकी जगह CSS (Cascading Style Sheets) का उपयोग होता है
🔷 8. CSS विकल्प (Modern Alternative using CSS):
<style>
body {
font-family: Verdana;
font-size: 20px;
color: green;
}
</style>
🔷 9. लाभ (Advantages):
- पूरे पेज के टेक्स्ट को एक साथ फॉर्मेट करता है
- कोड छोटा और आसान बनता है
- शुरुआती छात्रों के लिए उपयोगी
- पुरानी वेबसाइट्स में अभी भी देखा जा सकता है
🔷 10. सीमाएँ (Limitations):
- HTML5 में support नहीं है
- मॉडर्न ब्राउज़र (जैसे Chrome, Firefox) में प्रभावी नहीं होता
- डिज़ाइनिंग विकल्प सीमित हैं
- CSS ज्यादा मजबूत और लचीला विकल्प है