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

सीएसएस आरजीबी () फ़ंक्शन

<घंटा/>

आरजीबी () फ़ंक्शन का उपयोग आरजीबी रंग मान सेट करने के लिए किया जाता है। फ़ंक्शन के लिए पैरामीटर रंग की तीव्रता को प्रतिशत या मान में 0 से 255 तक सेट करता है।

उदाहरण

आइए पहले सीएसएस में आरजीबी () को लागू करने के लिए एक उदाहरण देखें -

<!DOCTYPE html>
<html>
<head>
<style>
div {
   text-align: justify;
   text-justify: inter-word;
   color: rgb(213,33,33);
   background-color: rgb(211,211,211);
   font-size: 1.1em;
}
</style>
</head>
<body>
<h2>Demo Heading</h2>
<div>This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. </div>
</body>
</html>

आउटपुट

सीएसएस आरजीबी () फ़ंक्शन

उदाहरण

आइए अब एक और उदाहरण देखें -

<!DOCTYPE html>
<html>
<head>
<style>
.demo {
   grid-area: newArea;
   font-size: xx-large;
}
.item3 {
   font-size: small;
}
.item4 {
   font-size: medium;
}
.item5 {
   font-size: x-large;
}
.grid-container {
   display: grid;
   grid-template-areas:
   'newArea newArea . . .'
   'newArea newArea . . .';
   grid-gap: 5px;
   background-color: rgb(0,255,255);
   padding: 5px;
}
.grid-container > div {
   background-color: rgb(255, 50, 80);
   text-align: center;
   padding: 5px 0;
}
</style>
</head>
<body>
<h1>Heading One</h1>
<p>Set some random numbers</p>
<div class="grid-container">
<div class="demo">250</div>
<div class="item2">120</div>
<div class="item3">333</div>
<div class="item4">298</div>
<div class="item5">645</div>
<div class="item6">543</div>
<div class="item7">555</div>
</div>
</body>
</html>

आउटपुट

सीएसएस आरजीबी () फ़ंक्शन


  1. सीएसएस रैखिक-ढाल () फ़ंक्शन सीएसएस रैखिक-ढाल () फ़ंक्शन

    रैखिक ढाल () का उपयोग रैखिक ढाल को पृष्ठभूमि छवि के रूप में परिभाषित करने के लिए किया जाता है - background-image: linear-gradient(direction, color-stop1, color-stop2, ...); ऊपर, शुरुआती बिंदु और दिशा सेट करें, उस रंग के साथ रुके हुए संक्रमण को सुचारू रूप से प्रस्तुत करने के लिए। उदाहरण आइए अब रैखि

  1. सीएसएस सही संपत्ति सीएसएस सही संपत्ति

    तत्व की क्षैतिज स्थिति निर्धारित करने के लिए सही गुण का उपयोग किया जाता है। इसे - . के रूप में सेट किया गया है right: auto|length|initial|inherit; उदाहरण आइए CSS में सही प्रॉपर्टी को लागू करने के लिए एक उदाहरण देखें - <!DOCTYPE html> <html> <head> <style> div {    

  1. सीएसएस का उपयोग करके टेक्स्ट इंडेंटेशन सीएसएस का उपयोग करके टेक्स्ट इंडेंटेशन

    टेक्स्ट इंडेंटेशन के लिए, CSS में टेक्स्ट-इंडेंट प्रॉपर्टी का उपयोग करें। यह एक पैराग्राफ में पहली पंक्ति के इंडेंटेशन के लिए है। उदाहरण आइए अब एक उदाहरण देखें - <!DOCTYPE html> <html> <head> <style> div {    text-indent: 30px; } </style> </head> <bo