Styling HTML Text
Text को style करने के लिए जैसे की उसका color change करना या font family change करना आदि के लिए CSS को यूज़ किया जाता है।
CSS एक बड़ा topic है। CSS के बारे में और अधिक जानकारी आप CSS Topic से प्राप्त कर सकते है। यँहा पर सिर्फ आपकी समझ के लिए कुछ styles का इस्तेमाल बताया जा रहा है। इसके लिए आप Style tag यूज़ करते है। और एक CSS property और उसकी values देते है।
CSS एक बड़ा topic है। CSS के बारे में और अधिक जानकारी आप CSS Topic से प्राप्त कर सकते है। यँहा पर सिर्फ आपकी समझ के लिए कुछ styles का इस्तेमाल बताया जा रहा है। इसके लिए आप Style tag यूज़ करते है। और एक CSS property और उसकी values देते है।
Changing Text Color
किसी भी tag के text का color change करने के लिए आप CSS की color property यूज़ करते है। और इसके बाद colon लगाकर color का नाम देते है।
<p style="color:red">This text will be red. </p>
|
Changing Font Family
Text की font family change करने के लिए आप font family property यूज़ करते है और value के रूप में font family का नाम देते है।
<p style="font-family:Arial"> This text will be in Arial </p>
|
Changing Text Size
Text की size change करने के लिए आप font size property यूज़ करते है और value के रूप में जो size आप चाहते है वह देते है।
<p style="font-size: 45"> This size is changed by style tag. </p>
|
Changing Text Position
Text की position change करने के लिए text align property यूज़ की जाती है और value के रूप में आप left, right या center pass कर सकते है।
<p style="text-align:center"> This position is change by style tag</p>
|
इसका उदाहरण नीचे दिया जा रहा है।
<html>
<head>
<title>Text Formatting</title>
</head>
<body>
<p style="color:red">This text will be red. </p>
<p style="font-family:Arial"> This text will be in Arial </p>
<p style="font-size: 45"> This size is changed by style tag. </p>
<p style="text-align:center">
This position is changed by style tag.
</p>
</body>
</html>
|
ऊपर दी गयी script निचे दिया गया web page generate करेगी।
0 Comments