
Suppose you are creating content with a list of top courses available at PW Skills. How do you keep this information structured and organized within your web page? This is where the HTML List comes in. These lists help developers organize and structure content in a visually appealing manner. Let's read this article in detail and explore everything about HTML List. By the end of this article, you will be familiar with the concept and proficient enough to create your own lists within a web page.
| Syntax Of Ordered HTML List |
| <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Ordered List Example</title> </head> <body> <h2>Steps To Enroll In PW Skills Course</h2> <ol> <li>Open the web browser.</li> <li>Type PWSkills.com into the search engine.</li> <li>Open the website.</li> <li>Search your desired course through the website.</li> <li>Click on the enroll now button on the right corner.</li> <li>Make the payment through your desired method.</li> <li>Get enrolled in the course successfully.</li> </ol> </body> </html> |
Output-
|
| Syntax Of Unordered HTML List |
| <!DOCTYPE html> <html> <head> <title>Unordered HTML List Example</title> </head> <body> <h1>Top Courses at PW Skills</h1> <ul> <li>Full Stack Development</li> <li>Data Science with Gen AI</li> <li>Programming Powerhouse Course</li> <li>Digital Marketing With AI course</li> <li>Python with DSA course</li> </ul> </body> </html> |
Output-
|
| Syntax Of Definition HTML List |
| <!DOCTYPE html> <html> <head> <title>Definition HTML List Example</title> </head> <body> <h1>Essential Terms Of Web Development</h1> <dl> <dt>HTML</dt> <dd>A markup language for creating web pages.</dd> <dt>CSS</dt> <dd>A style sheet language used for describing the look and formatting of a document written in HTML.</dd> <dt>JavaScript</dt> <dd>A programming language commonly used in web development to create interactive effects within web browsers.</dd> </dl> </body> </html> |
| Output- HTML A markup language for creating web pages. CSS A style sheet language used for describing the look and formatting of a document written in HTML. JavaScript A programming language commonly used in web development to create interactive effects within web browsers. |
| Changing The Bullet Style In HTML List |
| .fruit-list { list-style-type: square; //Using square bullets } |
Output-
|
| li { margin-bottom: 10px; } |
| li:hover { color: blue; } |
| HTML Code For List |
| <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Styling List Items Example</title> <link rel="stylesheet" href="styles.css"> </head> <body> <h2>Favorite Movies</h2> <ul class="movie-list"> <li>The Shawshank Redemption</li> <li>The Godfather</li> <li>The Dark Knight</li> <li>Pulp Fiction</li> </ul> </body> </html> |
| CSS Code For List |
| .movie-list { font-family: Arial, sans-serif; font-size: 18px; color: #333; } .movie-list li { margin-bottom: 10px; list-style-type: disc; /* Bullet style background-color: #f0f0f0; padding: 5px 10px; border-radius: 5px; } .movie-list li:hover { color: blue; } |