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

CSS content-box वैल्यू


CSS background-origin प्रॉपर्टी का उपयोग करके content-box वैल्यू सेट करें। content-box वैल्यू के साथ, बैकग्राउंड इमेज कंटेंट के ऊपरी बाएं कोने से शुरू होती है।

content-box वैल्यू लागू करने के लिए निम्न कोड चलाकर देखें:

उदाहरण

<!DOCTYPE html> <html>    <head>       <style>          #value1 {             border: 3px solid blue;             padding: 30px;             background: url(https://www.tutorialspoint.com/assets/videotutorials/courses/html_online_training/380_course_216_image.jpg);             background-repeat: no-repeat;             background-origin: padding-box;          }          #value2 {             border: 3px solid orange;             padding: 30px;             background: url(https://www.tutorialspoint.com/assets/videotutorials/courses/html_online_training/380_course_216_image.jpg);             background-repeat: no-repeat;             background-origin: border-box;          }          #value3 {             border: 3px dashed yellow;             padding: 30px;             background: url(https://www.tutorialspoint.com/assets/videotutorials/courses/html_online_training/380_course_216_image.jpg);             background-repeat: no-repeat;             background-origin: content-box;          }       </style>    </head>    </body> </html>

  1. CSS linear-gradient() फंक्शन CSS linear-gradient() फंक्शन

    linear-gradient() फंक्शन linear-gradient() का उपयोग रैखिक ग्रेडिएंट को बैकग्राउंड इमेज के रूप में परिभाषित करने के लिए किया जाता है। सिंटैक्स: background-image: linear-gradient(direction, color-stop1, color-stop2, ...); पैरामीटर्स: direction: ग्रेडिएंट की दिशा (to right, to bottom right, 45deg

  1. CSS right प्रॉपर्टी CSS right प्रॉपर्टी

    right प्रॉपर्टी right प्रॉपर्टी का उपयोग एलिमेंट की क्षैतिज स्थिति सेट करने के लिए किया जाता है। यह पोजिशन्ड एलिमेंट्स (relative, absolute, fixed, sticky) पर काम करता है। सिंटैक्स: right: auto | length | % | initial | inherit; मान: auto: ब्राउज़र गणना करता है (डिफ़ॉल्ट) length: px, em, rem,

  1. CSS से टेक्स्ट इंडेंटेशन CSS से टेक्स्ट इंडेंटेशन

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