How to Add & Change Background Color in HTML / HTML या CSS में background color कैसे change या add क्रे
To set the background color in HTML, use the background -color properity. This background color is apply on inline style.The attribute is used with the HTML <body> tag, with the CSS property background-color. HTML5 do not provide a feature to apply background color, so the CSS style is used to add background color.
HTML में बैकग्राउंड कलर सेट करने के लिए bacground -color प्रॉपरिटी का इस्तेमाल करें। यह background color inline style पर लागू होता है। यह विशेषता का उपयोग HTML <body> टैग के साथ, CSS ke background-color properity के साथ किया जाता है। HTML5background color लागू करने की सुविधा प्रदान नहीं करता है, इसलिए background color change क्रने के लिए CSS language का उपयोग किया जाता है।
Syntax:
background-color:color-name;
Example:
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Document</title></head><body style="background-color:black;"><h1 style="color:#ffffff;">Hello World</h1><p style="color:#ffffff;">You learn css and html</p></body></html>
Output:
What are the different ways to represent colors in CSS?/ CSS में रंगों का प्रतिनिधित्व करने के विभिन्न तरीके क्या हैं?
Their are three ways for defining a color in css./ CSS में रंग को परिभाषित करने के लिये तीन तरीके हैं:
- Color Keywords
- RGB Color Values
- Hexadecimal Color Values
Color Keywords:
The easiest way to defining a color is using one of the 17 predefined color keywords.
किसी रंग को परिभाषित करने का सबसे आसान तरीका 17 पूर्वनिर्धारित रंग कीवर्ड में से एक का उपयोग करना है।
example:
RGB Color Values:
RGB stands for red, green, and blue is the color model. RGB color model is used for web designing. RGB का मतलब लाल, हरा और नीला रंग मॉडल है। RGB कलर मॉडल का उपयोग वेब डिजाइनिंग के लिए किया जाता है।
h2 { color: rgb(0, 0, 0); } /* black color */h5 { color: rgb(100%, 100%, 100%); } /* white color */p { color: rgb(128, 80, 200); } /* purple color */
The RGB value is between 0 and 255 or a percentage value. The higher value means more of that color. RGB मान 0 और 255 या प्रतिशत मान के बीच होता है। उच्च value का अर्थ है उस रंग का अधिक होना।
Hexadecimal Color Values:
The most useful way to defining colors in CSS is hexadecimal values. In this we can using three numbers between 0 and 255, you use six hexadecimal numbers. Hexadecimal values can be 0-9 and A-F. Hex values are always prefixed with a # symbol.
CSS में रंगों को परिभाषित करने का सबसे उपयोगी तरीका हेक्साडेसिमल मान है। इसमें हम 0 और 255 के बीच की तीन संख्याओं का उपयोग कर सकते हैं, आप छह हेक्साडेसिमल संख्याओं का उपयोग करते हैं। हेक्साडेसिमल मान 0-9 और A-F हो सकते हैं। hexadecimal color हमेशा # symbol se start करते हैं
p { color: #000000; } /* black color */h1 { color: #ffffff; } /* white color */ul { color: #f2f2f2; } /* light grey color */
I hope you have learned from reading this post. If you like this post then share it with your friends and you can comment on any of your doubts and I will replay then at the earliest.
मुझे उम्मीद है कि आपने इस पोस्ट को पढ़कर सीखा होगा। अगर आपको यह पोस्ट पसंद आया हो तो इसे अपने दोस्तों के साथ शेयर करें और आप अपने किसी भी संदेह पर टिप्पणी कर सकते हैं और मैं इसे जल्द से जल्द फिर से चलाऊंगा।
Please do not entering spam link in the comment box ConversionConversion EmoticonEmoticon