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

जावास्क्रिप्ट के साथ बैकग्राउंड इमेज का पोजिशनिंग एरिया कैसे सेट करें?


जावास्क्रिप्ट में बैकग्राउंड इमेज का पोजिशनिंग एरिया सेट करने के लिए, backgroundOrigin प्रॉपर्टी का उपयोग करें।

उदाहरण

बैकग्राउंड के लिए इमेज का पोजिशनिंग एरिया सेट करना सीखने के लिए निम्न कोड चलाकर देखें:

<!DOCTYPE html> <html>    <head>       <style>          #box {             border: 2px dashed yellow;             padding: 35px;             width: 600px;             height: 400px;             background: url('https://www.tutorialspoint.com/videotutorials/images/coding_ground_home.jpg') no-repeat;          }       </style>    </head>    <body>       <button onclick="display()">बैकग्राउंड इमेज का एरिया सेट करें</button>       <div id="box">          यह डेमो टेक्स्ट है! यह डेमो टेक्स्ट है! यह डेमो टेक्स्ट है!          यह डेमो टेक्स्ट है! यह डेमो टेक्स्ट है!       </div>       <script>          function display() {             document.getElementById("box").style.backgroundOrigin = "content-box";          }       </script>    </body> </html>

  1. - JavaScript से एलिमेंट का क्षैतिज अलाइनमेंट कैसे सेट करें?

    उदाहरण cssFloat प्रॉपर्टी से एलिमेंट को क्षैतिज रूप से फ्लोट करें (बाएँ/दाएँ)। <!DOCTYPE html> <html> <body> <img id=myID src=https://www.tutorialspoint.com/videotutorials/images/tutor_connect_home.jpg width=300 height=300> <p>यह डेमो टेक्स्ट है। यह डेमो टेक्स

  1. - JavaScript से फ़ॉन्ट को स्मॉल कैपिटल लेटर्स में कैसे प्रदर्शित करें?

    उदाहरण fontVariant प्रॉपर्टी से फ़ॉन्ट को स्मॉल-कैप्स में बदलें। <!DOCTYPE html> <html> <body> <h1>हेडिंग 1</h1> <p id=myID> यह डेमो टेक्स्ट है। यह डेमो टेक्स्ट है। यह डेमो टेक्स्ट है। यह डेमो टेक्स्ट है। यह डेमो टेक्स्ट है। यह डेमो टेक्स्ट ह

  1. - JavaScript से लिस्ट-आइटम मार्कर के रूप में इमेज कैसे सेट करें?

    उदाहरण listStyleImage प्रॉपर्टी से कस्टम इमेज को लिस्ट मार्कर के रूप में उपयोग करें। <!DOCTYPE html> <html> <body> <ol id=myID> <li>एक</li> <li>दो</li> </ol> <button type=button onclick=display()>लिस्ट इमेज अपडेट क