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

JavaScript से listStyleImage, listStylePosition, listStyleType एक घोषणा में कैसे सेट करें?

उदाहरण

listStyle शॉर्टहैंड प्रॉपर्टी से सभी लिस्ट प्रॉपर्टीज़ एक साथ सेट करें।

<!DOCTYPE html>
<html>
  <body>
    <ol id="myID">
      <li>एक</li>
      <li>दो</li>
    </ol>
    <button type="button" onclick="display()">शैली बदलें</button>
    <script>
      function display() {
        document.getElementById("myID").style.listStyle = "circle outside";
      }
    </script>
  </body>
</html>

सिंटैक्स: listStyle: type position image (कोई भी क्रम, कोई भी छोड़ सकते हैं)।

उदाहरण: "square inside", "url('bullet.png')", "decimal outside url('img.png')"।

  1. - JavaScript से listStyleImage, listStylePosition, listStyleType एक घोषणा में कैसे सेट करें?

    उदाहरण listStyle शॉर्टहैंड प्रॉपर्टी से सभी लिस्ट प्रॉपर्टीज़ एक साथ सेट करें। <!DOCTYPE html> <html> <body> <ol id=myID> <li>एक</li> <li>दो</li> </ol> <button type=button onclick=display()>शैली बदलें</button>

  1. - JavaScript से एलिमेंट के सभी मार्जिन्स एक साथ कैसे सेट करें?

    उदाहरण margin शॉर्टहैंड प्रॉपर्टी से चारों मार्जिन एक साथ सेट करें। <!DOCTYPE html> <html> <body> <button type=button onclick=display()>चारों मार्जिन सेट करें</button> <p id=myID>यह डेमो टेक्स्ट है।</p> <script> function display() {

  1. - JavaScript से सभी आउटलाइन प्रॉपर्टीज़ एक घोषणा में कैसे सेट करें?

    उदाहरण outline शॉर्टहैंड प्रॉपर्टी से रंग, शैली, चौड़ाई एक साथ सेट करें। <!DOCTYPE html> <html> <head> <style> #box { width: 450px; background-color: orange; border: 3px solid red; } </style> </head> <body>