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

CSS में अनऑर्डर्ड और ऑर्डर्ड लिस्ट्स को फॉर्मेट करना


अनऑर्डर्ड और ऑर्डर्ड लिस्ट्स की स्टाइल और पोजिशन को CSS प्रॉपर्टीज़ list-style-type, list-style-image और list-style-position द्वारा फॉर्मेट किया जा सकता है।

सिंटैक्स

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

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

उदाहरण

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

निम्नलिखित उदाहरण ऑर्डर्ड लिस्ट को स्टाइल करता है:

<!DOCTYPE html> <html> <head> <style> ol { list-style: upper-roman; line-height: 150%; } </style> </head> <body> <h2>Latest C# Versions</h2> <ol> <li>C# 8.0</li> <li>C# 7.3</li> <li>C# 7.2</li> <li>C# 7.1</li> <li>C# 7.0</li> </ol> </body> </html>

आउटपुट

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

CSS में अनऑर्डर्ड और ऑर्डर्ड लिस्ट्स को फॉर्मेट करना

उदाहरण

निम्नलिखित उदाहरण अनऑर्डर्ड लिस्ट को स्टाइल करता है:

<!DOCTYPE html> <html> <head> <style> ul > ul{ list-style: circle inside; } li:last-child { list-style-type: square; } </style> </head> <body> <h2>Programming Languages</h2> <ul> <li>C++ programming language created by Bjarne Stroustrup as an extension of the C programming language.</li> <li>Java programming language developed by James Gosling.</li> <ul> <li>Core Java</li> <li>Advanced Java</li> </ul> <li>Scala is a modern multi-paradigm programming language designed to express common programming patterns in a concise, elegant, and type-safe way.</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 से रिस्पॉन्सिव प्राइसिंग टेबल कैसे बनाएं?

    CSS से रिस्पॉन्सिव प्राइसिंग टेबल बनाने के लिए, कोड निम्नानुसार है -उदाहरण<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <style>    * {       box-sizing: border-box; &nb

  1. CSS ::marker सेलेक्टर से लिस्ट के बुलेट कलर बदलें CSS ::marker सेलेक्टर से लिस्ट के बुलेट कलर बदलें

    सिंटैक्स CSS ::marker सेलेक्टर का सिंटैक्स निम्नानुसार है: Selector::marker {    attribute: /*value*/; } उदाहरण 1 निम्न उदाहरण CSS ::marker सेलेक्टर को दर्शाते हैं। <!DOCTYPE html> <html>    <head>       <style>         &