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

CSS में इमेज को लिस्ट मार्कर के रूप में उपयोग करना

CSS list-style-image प्रॉपर्टी का उपयोग लिस्ट आइटम के लिए एक इमेज को मार्कर के रूप में सेट करने के लिए किया जाता है।

सिंटैक्स

CSS list-style-image प्रॉपर्टी का सिंटैक्स निम्नानुसार है:

Selector {    list-style-image: /*value*/ }

उदाहरण

निम्नलिखित उदाहरण CSS list-style-image प्रॉपर्टी को दर्शाते हैं:

<!DOCTYPE html> <html> <head> <style> ul {    width: 150px;    list-style-image: url("https://www.tutorialspoint.com/images/Servlets.png");    background: goldenrod; } li {    text-align: center;    background: lavenderblush;    margin: 5px 30px; } </style> </head> <body> <h2>Servlets</h2> <ul> <li>Client Request</li> <li>Server Response</li> <li>Cookies Handling</li> <li>Session Tracking</li> </ul> </body> </html>

आउटपुट

यह निम्नलिखित आउटपुट देता है:

CSS में इमेज को लिस्ट मार्कर के रूप में उपयोग करना

दूसरा उदाहरण

<!DOCTYPE html> <html> <head> <style> ul {    margin-left: 20px;    list-style-image: url("https://www.tutorialspoint.com/images/hibernate.png"); } li {    font-size: 1.3em;    text-align: center;    background: burlywood;    margin: 3px; } </style> </head> <body> <h2>Hibernate Tutorial</h2> <ul> <li>Sessions</li> <li>Persistent Class</li> <li>Mapping Files</li> <li>Mapping Types</li> <li>Annotations</li> </ul> </body> </html>

आउटपुट

यह निम्नलिखित आउटपुट देता है:

CSS में इमेज को लिस्ट मार्कर के रूप में उपयोग करना

  1. CSS से कैलेंडर कैसे बनाएं? CSS से कैलेंडर कैसे बनाएं?

    CSS कैलेंडर में महीना हेडर, दिन नाम पंक्ति, और तारीख ग्रिड होता है। ग्रिड display: inline-block और width: 13.6% (100%/7) से 7 कॉलम बनाता है। आज की तारीख हाइलाइटेड होती है। उदाहरण <!DOCTYPE html> <html> <head> <style> body { font-family: Segoe UI, Tahoma, Geneva, Verda

  1. CSS से बुलेट्स के बिना अनऑर्डर्ड लिस्ट कैसे बनाएं? CSS से बुलेट्स के बिना अनऑर्डर्ड लिस्ट कैसे बनाएं?

    अनऑर्डर्ड लिस्ट (ul) से डिफ़ॉल्ट बुलेट्स हटाने के लिए list-style-type: none उपयोग करें। मार्जिन/पैडिंग शून्य करके डिफ़ॉल्ट इंडेंटेशन भी हटाएं। उदाहरण <!DOCTYPE html> <html> <head> <style> body { font-family: Segoe UI, Tahoma, Geneva, Verdana, sans-serif; } ul {

  1. CSS से बेसिक लिस्ट को लिस्ट ग्रुप में बदलना CSS से बेसिक लिस्ट को लिस्ट ग्रुप में बदलना

    लिस्ट ग्रुप बेसिक लिस्ट को लिस्ट ग्रुप में बदलने के लिए CSS का उपयोग करें: उदाहरण <!DOCTYPE html> <html> <head> <meta name=viewport content=width=device-width, initial-scale=1 /> <style> body { font-family: Segoe UI, Tahoma, Geneva, Verdana, sans-serif; } * { box-sizin