- Lists are the common requirement to place the data in a formatted manner, like if you have made a webpage where you need to display the content of the pizza menu of a hotel, then likely it would be an HTML list style that shall appear in a clear and discrete manner.
- Other cases can be where you are having a set of ranks of students who appeared among top performers of the class; in this context, the requirement will be to place the rank 1 student at the top and others below it in increasing order of ranking, for that we need to format this into a sorted list.
- Another type can be custom lists which you can make using Javascript and Html together, where the dynamics in the objects can be set up too, and the lists can take some customized outlook.
Different List Styles in HTML
Below are the various HTML list styles explained.
1) Unordered Lists
Here the order of display of the content is not something that we need to care about; just we need to place the things well, such that the HTML page makes them placed up in front of the user in a well-formatted and clear way.
There are two tags in HTML language that handle these lists, and likely you can make a navigation bar and vertical sidebar using these tags only.
- : this represents the unordered list; whenever we need not rank anything or look to place it in random order, this tag is incorporated.
- : this represents the list items, the set of items to be placed in the unordered list i.e. under the
- tag appear inside the
- tag. The items marked with these markups will be automatically carrying some bullets or circles in their beginning; these are the basic HTML features.
Now let us see a piece of code for
- and
- based unordered lists and how the HTML page will look; once you execute that file, note that you can write in an editor like notepad and save the file with “.html” extension; hence it can be opened with any of the browsers.
Example Snippet –
Code:
HTML Lists <h2> list of pizzas <h2> <ul> <li style="color:red"> farmhouse </li> <li style="color:green"> peppy paneer </li> <li style="color:blue"> onion pizza </li> </ul> </h2> </h2>
Output:
2) Ordered Lists
Now will see a case where we are looking to place the students in an ordered manner based on their ranks in class, and this will appear in a sorted manner by using the
- tag of HTML, and it will be containing multiple
- tags, those will have the list items in it.
- : this tag is used to set up an ordered list, and all elements are placed inside it, within
- tags.
- tag has been explained above.
For this case, let’s see an example, too, and you need to save this just like done above.
Code:
HTML Lists <h2> list of students <h2> <ol> <li style="color:red"> John </li> <li style="color:green"> Harris </li> <li style="color:blue"> Plunket </li> </ol> </h2> </h2>
Output/ HTML page
Now let’s see some variants of these where we can customize or well format these lists only by adding some CSS properties into the HTML page, which will make the appearance of the page look better.
- In the unordered lists, we have the following properties that can be given –
- List-style-type – can be disc, circle, square or none. So the circles you saw in unordered list items will not appear if we choose none here, let’s do it.
Example –
Code:
HTML Lists <h2> list of students <h2> <ul style="list-style-type:none"> <li style="color:red"> John </li> <li style="color:green"> Harris </li> <li style="color:blue"> Plunket </li> </ul> </h2> </h2>
Output/ HTML page –
So, the circle bullets no longer exist; you can customize them with the above-provided options.
Similarly, there is a provision to choose whether the order list values will appear with numerals or Romans or alphabets in the order lists.
You can set the property type in
- tag for the same, and the type can take the following values.
Type: “1”,” A”,” a”,” I”,” i.”
Let’s see Example Code for the same –
Code:
HTML Lists <h2> list of students <h2> <ol type="i"> <li style="color:red"> John </li> <li style="color:green"> Harris </li> <li style="color:blue"> Plunket </li> </ol> </h2> </h2>
Output/ HTML page –
Similarly, we also have description lists where we can define the item against which we need to place a description; let’s say you are making a page where you need to place some definitions against some keywords, then you can choose the description lists.
Tags
We have the following tags to handle the same.
– this tag will give the description term
– this tag carries the description of each term
Example –
Code:
HTML Lists <h2> list of students <h2> <dl> <dt style="color:red"> Docker </dt> <dd> -: this is used to make environment portable application containers </dd> <br> <dt style="color:green"> Kubernetes </dt> <dd> -: this is an orchestrator for those containers make by docker </dd> </dl> </h2> </h2>
Output/HTML page –
You can also define the start property in the ordered lists in
- tag, which tells from where the count starts. Let’s see an example of the same –
Code:
HTML Lists <h2> list of students <h2> <ol type="1" start="10"> <li style="color:red"> John </li> <li style="color:green"> Harris </li> <li style="color:blue"> Plunket </li> > </ol> </h2> </h2>
Output:
Conclusion
So we saw various lists in which we can place data; this data can be rendered from the model to view using javascript frameworks; what we have shown is a static page, and it can be made dynamic with JS. These lists can be formatted with bootstrap to make them look like navbars or sidebars too.
- tags, those will have the list items in it.
The above is the detailed content of HTML List Styles. For more information, please follow other related articles on the PHP Chinese website!

The future trends of HTML are semantics and web components, the future trends of CSS are CSS-in-JS and CSSHoudini, and the future trends of JavaScript are WebAssembly and Serverless. 1. HTML semantics improve accessibility and SEO effects, and Web components improve development efficiency, but attention should be paid to browser compatibility. 2. CSS-in-JS enhances style management flexibility but may increase file size. CSSHoudini allows direct operation of CSS rendering. 3.WebAssembly optimizes browser application performance but has a steep learning curve, and Serverless simplifies development but requires optimization of cold start problems.

The roles of HTML, CSS and JavaScript in web development are: 1. HTML defines the web page structure, 2. CSS controls the web page style, and 3. JavaScript adds dynamic behavior. Together, they build the framework, aesthetics and interactivity of modern websites.

The future of HTML is full of infinite possibilities. 1) New features and standards will include more semantic tags and the popularity of WebComponents. 2) The web design trend will continue to develop towards responsive and accessible design. 3) Performance optimization will improve the user experience through responsive image loading and lazy loading technologies.

The roles of HTML, CSS and JavaScript in web development are: HTML is responsible for content structure, CSS is responsible for style, and JavaScript is responsible for dynamic behavior. 1. HTML defines the web page structure and content through tags to ensure semantics. 2. CSS controls the web page style through selectors and attributes to make it beautiful and easy to read. 3. JavaScript controls web page behavior through scripts to achieve dynamic and interactive functions.

HTMLisnotaprogramminglanguage;itisamarkuplanguage.1)HTMLstructuresandformatswebcontentusingtags.2)ItworkswithCSSforstylingandJavaScriptforinteractivity,enhancingwebdevelopment.

HTML is the cornerstone of building web page structure. 1. HTML defines the content structure and semantics, and uses, etc. tags. 2. Provide semantic markers, such as, etc., to improve SEO effect. 3. To realize user interaction through tags, pay attention to form verification. 4. Use advanced elements such as, combined with JavaScript to achieve dynamic effects. 5. Common errors include unclosed labels and unquoted attribute values, and verification tools are required. 6. Optimization strategies include reducing HTTP requests, compressing HTML, using semantic tags, etc.

HTML is a language used to build web pages, defining web page structure and content through tags and attributes. 1) HTML organizes document structure through tags, such as,. 2) The browser parses HTML to build the DOM and renders the web page. 3) New features of HTML5, such as, enhance multimedia functions. 4) Common errors include unclosed labels and unquoted attribute values. 5) Optimization suggestions include using semantic tags and reducing file size.

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Linux new version
SublimeText3 Linux latest version

Dreamweaver Mac version
Visual web development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 Mac version
God-level code editing software (SublimeText3)