

{"id":78658,"date":"2020-07-02T09:00:24","date_gmt":"2020-07-02T03:30:24","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=78658"},"modified":"2024-07-26T13:16:36","modified_gmt":"2024-07-26T07:46:36","slug":"html-lists","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/html-lists\/","title":{"rendered":"HTML Lists &#8211; CSS Styling Lists"},"content":{"rendered":"<p>Lists are used to group similar data together so that it becomes easy to retrieve the relevant data. HTML Lists contain list items that can be ordered or unordered, based on the developer\u2019s necessity. For example, books list, list of students in a class, etc.<\/p>\n<p>In HTML, there are three ways of creating a list-<\/p>\n<p><strong>1. Unordered List &#8211;<\/strong> The items are sequenced using bullets(by default). It is specified using the &lt;ul&gt; tag, followed by &lt;li&gt;<br \/>\n<strong>2. Ordered List &#8211;<\/strong> The items are sequenced using numbers. It is specified using the &lt;ol&gt; tag, followed by &lt;li&gt;<br \/>\n<strong>3. Description List &#8211;<\/strong> These are the lists containing definition terms followed by their definition. These are specified using the &lt;dl&gt; tag followed by &lt;dt&gt; and &lt;dd&gt;.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/html-lists-df.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78899\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/html-lists-df.jpg\" alt=\"html lists\" width=\"1200\" height=\"628\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/html-lists-df.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/html-lists-df-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/html-lists-df-1024x536.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/html-lists-df-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/html-lists-df-768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/html-lists-df-520x272.jpg 520w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><\/p>\n<h2>Advantages of Lists in HTML5<\/h2>\n<p>1. Proper semantics of an HTML document are maintained using an HTML list. It removes the confusion since words are not jumbled in a single line and can be easily comprehended.<br \/>\n2. CSS styles can be easily applied to HTML lists, by accessing the &lt;li&gt; tags.<br \/>\n3<strong>.<\/strong> HTML lists provide flexibility as the order of the lists can be easily changed.<\/p>\n<p>Lists in HTML5 are highly versatile. They can be nested in order to create complex structures which helps in displaying hierarchical information effectively. This feature is particularly useful for creating menus and sub-menus on websites which further ensures a clean and organized presentation of content.<\/p>\n<p>Lists also improve accessibility by providing a clear structure that screen readers can easily interpret. This improves the user experience for individuals and ensures that the content is accessible to a wider audience.<\/p>\n<h2>a. HTML Unordered List<\/h2>\n<p>It starts with the &lt;ul&gt; tag and each list item is specified using the &lt;li&gt; tag. By default, the list items start with bullets. For example,<br \/>\n<strong>Code-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n   &lt;title&gt;DataFlair&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;h2&gt;Web Development Technologies &lt;\/h2&gt;\r\n&lt;ul&gt;\r\n   &lt;li&gt;HTML5&lt;\/li&gt;\r\n   &lt;li&gt;CSS3&lt;\/li&gt;\r\n   &lt;li&gt;JavaScript&lt;\/li&gt;\r\n   &lt;li&gt;Bootstrap4&lt;\/li&gt;\r\n&lt;\/ul&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Output-<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-1Basic-Example.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78901\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-1Basic-Example.png\" alt=\"html list example\" width=\"516\" height=\"209\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-1Basic-Example.png 516w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-1Basic-Example-300x122.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-1Basic-Example-150x61.png 150w\" sizes=\"auto, (max-width: 516px) 100vw, 516px\" \/><\/a><\/p>\n<p>The list item marker can be changed using the CSS property list-style-type<\/p>\n<p><strong>There are four values for list-style-type-<\/strong><\/p>\n<h3>1. disc(default)<\/h3>\n<p>List item marker set to bullet.<\/p>\n<p><strong>Code-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n   &lt;title&gt;DataFlair&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;h2&gt;Web Development Technologies &lt;\/h2&gt;\r\n&lt;ul style=\"list-style-type: disc;\"&gt;\r\n   &lt;li&gt;HTML5&lt;\/li&gt;\r\n   &lt;li&gt;CSS3&lt;\/li&gt;\r\n   &lt;li&gt;JavaScript&lt;\/li&gt;\r\n   &lt;li&gt;Bootstrap4&lt;\/li&gt;\r\n&lt;\/ul&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Output-<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-2disc.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78902\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-2disc.png\" alt=\"html disc\" width=\"544\" height=\"220\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-2disc.png 544w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-2disc-300x121.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-2disc-150x61.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-2disc-520x210.png 520w\" sizes=\"auto, (max-width: 544px) 100vw, 544px\" \/><\/a><\/p>\n<h3>2. Circle<\/h3>\n<p>List item marker displayed as a circle.<\/p>\n<p><strong>Code-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n   &lt;title&gt;DataFlair&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;h2&gt;Web Development Technologies &lt;\/h2&gt;\r\n&lt;ul style=\"list-style-type: circle;\"&gt;\r\n   &lt;li&gt;HTML5&lt;\/li&gt;\r\n   &lt;li&gt;CSS3&lt;\/li&gt;\r\n   &lt;li&gt;JavaScript&lt;\/li&gt;\r\n   &lt;li&gt;Bootstrap4&lt;\/li&gt;\r\n&lt;\/ul&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Output-<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-3Circle.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78903\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-3Circle.png\" alt=\"html circle\" width=\"549\" height=\"182\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-3Circle.png 549w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-3Circle-300x99.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-3Circle-150x50.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-3Circle-520x172.png 520w\" sizes=\"auto, (max-width: 549px) 100vw, 549px\" \/><\/a><\/p>\n<h3>3. Square<\/h3>\n<p>List item marker displayed as a square.<\/p>\n<p><strong>Code-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n   &lt;title&gt;DataFlair&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;h2&gt;Web Development Technologies &lt;\/h2&gt;\r\n&lt;ul style=\"list-style-type: square;\"&gt;\r\n   &lt;li&gt;HTML5&lt;\/li&gt;\r\n   &lt;li&gt;CSS3&lt;\/li&gt;\r\n   &lt;li&gt;JavaScript&lt;\/li&gt;\r\n   &lt;li&gt;Bootstrap4&lt;\/li&gt;\r\n&lt;\/ul&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Output-<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-4Square.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78904\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-4Square.png\" alt=\"html square\" width=\"426\" height=\"156\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-4Square.png 426w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-4Square-300x110.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-4Square-150x55.png 150w\" sizes=\"auto, (max-width: 426px) 100vw, 426px\" \/><\/a><\/p>\n<h3>4. None<\/h3>\n<p>List item marker not displayed.<\/p>\n<p><strong>Code-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n   &lt;title&gt;DataFlair&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;h2&gt;Web Development Technologies &lt;\/h2&gt;\r\n&lt;ul style=\"list-style-type: none;\"&gt;\r\n   &lt;li&gt;HTML5&lt;\/li&gt;\r\n   &lt;li&gt;CSS3&lt;\/li&gt;\r\n   &lt;li&gt;JavaScript&lt;\/li&gt;\r\n   &lt;li&gt;Bootstrap4&lt;\/li&gt;\r\n&lt;\/ul&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Output-<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-5none.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78905\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-5none.png\" alt=\"html list\" width=\"476\" height=\"176\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-5none.png 476w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-5none-300x111.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-5none-150x55.png 150w\" sizes=\"auto, (max-width: 476px) 100vw, 476px\" \/><\/a><\/p>\n<h3>HTML Nested Lists<\/h3>\n<p>One list can be contained within another. For example,<\/p>\n<p><strong>Code-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n   &lt;title&gt;DataFlair&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;h2&gt;Web Development Technologies &lt;\/h2&gt;\r\n&lt;ul style=\"list-style-type: circle;\"&gt;\r\n   &lt;li&gt;HTML5\r\n      &lt;ul&gt;\r\n         &lt;li&gt;Tables&lt;\/li&gt;\r\n         &lt;li&gt;Lists&lt;\/li&gt;\r\n      &lt;\/ul&gt;\r\n   &lt;\/li&gt;\r\n   &lt;li&gt;CSS3&lt;\/li&gt;\r\n   &lt;li&gt;JavaScript&lt;\/li&gt;\r\n   &lt;li&gt;Bootstrap4&lt;\/li&gt;\r\n&lt;\/ul&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Output-<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-6Nested-Lists.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78906\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-6Nested-Lists.png\" alt=\"html nested list\" width=\"545\" height=\"249\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-6Nested-Lists.png 545w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-6Nested-Lists-300x137.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-6Nested-Lists-150x69.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-6Nested-Lists-520x238.png 520w\" sizes=\"auto, (max-width: 545px) 100vw, 545px\" \/><\/a><\/p>\n<h3>Navigation Bars using Unordered List in HTML<\/h3>\n<p>Unordered lists can be styled using CSS and can be used to create navigation bars. The unordered list is displayed horizontally using the float property of CSS. For example,<\/p>\n<p><strong>Code-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;style&gt;\r\nul {\r\n  list-style-type: none;\r\n  margin: 0;\r\n  padding: 0;\r\n  overflow: hidden;\r\n  background-color: #333333;\r\n}\r\n\r\nli {\r\n  float: right;\r\n}\r\n\r\nli a {\r\n  display: block;\r\n  color: white;\r\n  text-align: center;\r\n  padding: 16px;\r\n  text-decoration: none;\r\n}\r\n\r\n&lt;\/style&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n\r\n&lt;ul&gt;\r\n  &lt;li&gt;&lt;a href=\"#home\"&gt;Home&lt;\/a&gt;&lt;\/li&gt;\r\n  &lt;li&gt;&lt;a href=\"#contact\"&gt;Contact Us&lt;\/a&gt;&lt;\/li&gt;\r\n  &lt;li&gt;&lt;a href=\"#about\"&gt;About Us&lt;\/a&gt;&lt;\/li&gt;\r\n&lt;\/ul&gt;\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Output-<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/image-7-Navigation-Bars-using-Unordered-List.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78907\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/image-7-Navigation-Bars-using-Unordered-List.png\" alt=\"html unordered list\" width=\"1027\" height=\"86\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/image-7-Navigation-Bars-using-Unordered-List.png 1027w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/image-7-Navigation-Bars-using-Unordered-List-300x25.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/image-7-Navigation-Bars-using-Unordered-List-1024x86.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/image-7-Navigation-Bars-using-Unordered-List-150x13.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/image-7-Navigation-Bars-using-Unordered-List-768x64.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/image-7-Navigation-Bars-using-Unordered-List-520x44.png 520w\" sizes=\"auto, (max-width: 1027px) 100vw, 1027px\" \/><\/a><\/p>\n<h2>b. HTML Ordered List<\/h2>\n<p>An ordered list is defined using the &lt;ol&gt; tag followed by &lt;li&gt; tags. The list item marker can be numerical digits or alphabetical.<\/p>\n<p><strong>Code-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n   &lt;title&gt;DataFlair&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;h2&gt;Web Development Technologies &lt;\/h2&gt;\r\n&lt;ol&gt;\r\n   &lt;li&gt;HTML5&lt;\/li&gt;\r\n   &lt;li&gt;CSS3&lt;\/li&gt;\r\n   &lt;li&gt;JavaScript&lt;\/li&gt;\r\n   &lt;li&gt;Bootstrap4&lt;\/li&gt;\r\n&lt;\/ol&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Output-<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-8-Ordered-Lists.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78908\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-8-Ordered-Lists.png\" alt=\"html ordered lists\" width=\"624\" height=\"221\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-8-Ordered-Lists.png 624w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-8-Ordered-Lists-300x106.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-8-Ordered-Lists-150x53.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-8-Ordered-Lists-520x184.png 520w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/a><\/p>\n<p>The list-item marker is specified using the type attribute of the &lt;ol&gt; tag. The type attribute can have the following values-<\/p>\n<ul>\n<li><strong>type=\u201d1\u201d-<\/strong> List item marker displayed as a number (default).<\/li>\n<li><strong>type=\u201dA\u201d-<\/strong> List item marker displayed as an alphabet in uppercase.<\/li>\n<li><strong>type=\u201da\u201d-<\/strong> List item marker displayed as an alphabet in lowercase.<\/li>\n<li><strong>type=\u201d\u2160\u201d-<\/strong> List item marker displayed as an uppercase roman numeral.<\/li>\n<li><strong>type=\u201di\u201d-<\/strong> List item marker displayed as a lowercase roman numeral.<\/li>\n<\/ul>\n<p><strong>Code-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n   &lt;title&gt;DataFlair&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;h2&gt;Web Development Technologies &lt;\/h2&gt;\r\n&lt;ol type=\"1\"&gt;\r\n   &lt;li&gt;HTML5&lt;\/li&gt;\r\n   &lt;li&gt;CSS3&lt;\/li&gt;\r\n   &lt;li&gt;JavaScript&lt;\/li&gt;\r\n   &lt;li&gt;Bootstrap4&lt;\/li&gt;\r\n&lt;\/ol&gt;\r\n&lt;ol type=\"A\"&gt;\r\n   &lt;li&gt;HTML5&lt;\/li&gt;\r\n   &lt;li&gt;CSS3&lt;\/li&gt;\r\n   &lt;li&gt;JavaScript&lt;\/li&gt;\r\n   &lt;li&gt;Bootstrap4&lt;\/li&gt;\r\n&lt;\/ol&gt;\r\n&lt;ol type=\"a\"&gt;\r\n   &lt;li&gt;HTML5&lt;\/li&gt;\r\n   &lt;li&gt;CSS3&lt;\/li&gt;\r\n   &lt;li&gt;JavaScript&lt;\/li&gt;\r\n   &lt;li&gt;Bootstrap4&lt;\/li&gt;\r\n&lt;\/ol&gt;\r\n&lt;ol type=\"I\"&gt;\r\n   &lt;li&gt;HTML5&lt;\/li&gt;\r\n   &lt;li&gt;CSS3&lt;\/li&gt;\r\n   &lt;li&gt;JavaScript&lt;\/li&gt;\r\n   &lt;li&gt;Bootstrap4&lt;\/li&gt;\r\n&lt;\/ol&gt;\r\n&lt;ol type=\"i\"&gt;\r\n   &lt;li&gt;HTML5&lt;\/li&gt;\r\n   &lt;li&gt;CSS3&lt;\/li&gt;\r\n   &lt;li&gt;JavaScript&lt;\/li&gt;\r\n   &lt;li&gt;Bootstrap4&lt;\/li&gt;\r\n&lt;\/ol&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Output-<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-9.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78909\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-9.png\" alt=\"html ordered list\" width=\"564\" height=\"678\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-9.png 564w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-9-250x300.png 250w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-9-125x150.png 125w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-9-520x625.png 520w\" sizes=\"auto, (max-width: 564px) 100vw, 564px\" \/><\/a><\/p>\n<h3>1. HTML List Counting<\/h3>\n<p>Counting of the items of an ordered list, by default, starts from 1. We can change it using the start attribute of the &lt;ol&gt; tag. For example,<\/p>\n<p><strong>Code-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n   &lt;title&gt;DataFlair&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;h2&gt;Web Development Technologies &lt;\/h2&gt;\r\n&lt;ol start=\"10\"&gt;\r\n   &lt;li&gt;HTML5&lt;\/li&gt;\r\n   &lt;li&gt;CSS3&lt;\/li&gt;\r\n   &lt;li&gt;JavaScript&lt;\/li&gt;\r\n   &lt;li&gt;Bootstrap4&lt;\/li&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Output-<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/image10list-counting.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78910\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/image10list-counting.png\" alt=\"html list counting\" width=\"534\" height=\"205\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/image10list-counting.png 534w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/image10list-counting-300x115.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/image10list-counting-150x58.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/image10list-counting-520x200.png 520w\" sizes=\"auto, (max-width: 534px) 100vw, 534px\" \/><\/a><\/p>\n<h3>2. HTML Nesting Ordered Lists<\/h3>\n<p><strong>Code-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n   &lt;title&gt;DataFlair&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;h2&gt;Web Development Technologies &lt;\/h2&gt;\r\n&lt;ol&gt;\r\n   &lt;li&gt;HTML5\r\n      &lt;ol&gt;\r\n         &lt;li&gt;Tables&lt;\/li&gt;\r\n         &lt;li&gt;Lists&lt;\/li&gt;\r\n      &lt;\/ol&gt;\r\n   &lt;\/li&gt;\r\n   &lt;li&gt;CSS3&lt;\/li&gt;\r\n   &lt;li&gt;JavaScript&lt;\/li&gt;\r\n   &lt;li&gt;Bootstrap4&lt;\/li&gt;\r\n&lt;\/ol&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Output-<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-11Nesting-ordered-lists.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78911\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-11Nesting-ordered-lists.png\" alt=\"html nesting ordered list\" width=\"516\" height=\"253\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-11Nesting-ordered-lists.png 516w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-11Nesting-ordered-lists-300x147.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-11Nesting-ordered-lists-150x74.png 150w\" sizes=\"auto, (max-width: 516px) 100vw, 516px\" \/><\/a><\/p>\n<h2>c. HTML Description List<\/h2>\n<p>Description list is specified using the &lt;dl&gt; tag followed by &lt;dt&gt;, definition term, and &lt;dd&gt;, definition, tags. It is used to create lists where information related to each list-item is required. For example,<\/p>\n<p><strong>Code-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n   &lt;title&gt;DataFlair&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;h2&gt;Web Development Technologies &lt;\/h2&gt;\r\n&lt;dl&gt;\r\n  &lt;dt&gt;HTML5&lt;\/dt&gt;\r\n  &lt;dd&gt;- Used for creating static web-pages.&lt;\/dd&gt;\r\n  &lt;dt&gt;CSS3&lt;\/dt&gt;\r\n  &lt;dd&gt;- Used for styling the web-pages.&lt;\/dd&gt;\r\n&lt;\/dl&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Output-<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-12Description-Lis.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78912\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-12Description-Lis.png\" alt=\"html description list\" width=\"516\" height=\"223\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-12Description-Lis.png 516w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-12Description-Lis-300x130.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/Image-12Description-Lis-150x65.png 150w\" sizes=\"auto, (max-width: 516px) 100vw, 516px\" \/><\/a><\/p>\n<h2>Choosing Lists in HTML<\/h2>\n<ul>\n<li>If in a particular document, name-value pairs are required, it is recommended to select description lists and proceed, else ordered or unordered lists can be used.<\/li>\n<li>If the order of the list items is essential, for example, number of students in a class,an ordered list must be used else an unordered list would also suffice.<\/li>\n<\/ul>\n<h2>Summary<\/h2>\n<p>HTML Lists are useful for grouping similar data together that helps in easy retrieval and makes the document systematic. In HTML5, lists are of three types- ordered list, unordered list, and definition list. In this article, we\u2019ve discussed these lists along with their applications and properties in detail.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Lists are used to group similar data together so that it becomes easy to retrieve the relevant data. HTML Lists contain list items that can be ordered or unordered, based on the developer\u2019s necessity.&#46;&#46;&#46;<\/p>\n","protected":false},"author":10,"featured_media":78899,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22400],"tags":[22429,22487,22488,22489],"class_list":["post-78658","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-html","tag-advantages-of-html","tag-html-lists","tag-html-ordered-list","tag-html-unordered-list"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>HTML Lists - CSS Styling Lists - DataFlair<\/title>\n<meta name=\"description\" content=\"Learn what is html lists, its advantages and ways of creating lists - Ordered list, unordered list, definition list, how to choose lists in html\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/html-lists\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"HTML Lists - CSS Styling Lists - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Learn what is html lists, its advantages and ways of creating lists - Ordered list, unordered list, definition list, how to choose lists in html\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/html-lists\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-07-02T03:30:24+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-26T07:46:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/html-lists-df.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"HTML Lists - CSS Styling Lists - DataFlair","description":"Learn what is html lists, its advantages and ways of creating lists - Ordered list, unordered list, definition list, how to choose lists in html","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/html-lists\/","og_locale":"en_US","og_type":"article","og_title":"HTML Lists - CSS Styling Lists - DataFlair","og_description":"Learn what is html lists, its advantages and ways of creating lists - Ordered list, unordered list, definition list, how to choose lists in html","og_url":"https:\/\/data-flair.training\/blogs\/html-lists\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2020-07-02T03:30:24+00:00","article_modified_time":"2024-07-26T07:46:36+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/html-lists-df.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/html-lists\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/html-lists\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/a90b082e16aa38d207212d22b0581f33"},"headline":"HTML Lists &#8211; CSS Styling Lists","datePublished":"2020-07-02T03:30:24+00:00","dateModified":"2024-07-26T07:46:36+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/html-lists\/"},"wordCount":738,"commentCount":1,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/html-lists\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/html-lists-df.jpg","keywords":["advantages of html","HTML Lists","HTML Ordered list","html unordered list"],"articleSection":["HTML Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/html-lists\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/html-lists\/","url":"https:\/\/data-flair.training\/blogs\/html-lists\/","name":"HTML Lists - CSS Styling Lists - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/html-lists\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/html-lists\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/html-lists-df.jpg","datePublished":"2020-07-02T03:30:24+00:00","dateModified":"2024-07-26T07:46:36+00:00","description":"Learn what is html lists, its advantages and ways of creating lists - Ordered list, unordered list, definition list, how to choose lists in html","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/html-lists\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/html-lists\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/html-lists\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/html-lists-df.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/07\/html-lists-df.jpg","width":1200,"height":628,"caption":"html lists"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/html-lists\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"HTML Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/html\/"},{"@type":"ListItem","position":3,"name":"HTML Lists &#8211; CSS Styling Lists"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/a90b082e16aa38d207212d22b0581f33","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/dd6de0d647a0185cd6faf264e4ba860b0d85d08d7070766f9cd41bea5bb0b227?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/dd6de0d647a0185cd6faf264e4ba860b0d85d08d7070766f9cd41bea5bb0b227?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/dd6de0d647a0185cd6faf264e4ba860b0d85d08d7070766f9cd41bea5bb0b227?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"The DataFlair Team is passionate about delivering top-notch tutorials and resources on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. With expertise in the tech industry, we simplify complex topics to help learners excel. Stay updated with our latest insights.","url":"https:\/\/data-flair.training\/blogs\/author\/dfadteam1\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/78658","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=78658"}],"version-history":[{"count":4,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/78658\/revisions"}],"predecessor-version":[{"id":142930,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/78658\/revisions\/142930"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/78899"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=78658"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=78658"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=78658"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}