Computer Science, asked by Anonymous, 8 months ago

Explain how list can be defined in HTML document by giving suitable example.


Answer fast it is urgent....
Correct answer will be marked as brainliest.... ​

Answers

Answered by honey2442
14

There are three list types in HTML:

unordered list — used to group a set of related items in no particular order

ordered list — used to group a set of related items in a specific order

description list — used to display name/value pairs such as terms and definitions

Each list type has a specific purpose and meaning in a web page.

example for unordered list<ul>

<li>bread</li>

<li>coffee beans</li>

<li>milk</li>

<li>butter</li>

</ul>

example for ordered list

<ol>

<li>Gather ingredients</li>

<li>Mix ingredients together</li>

<li>Place ingredients in a baking dish</li>

<li>Bake in oven for an hour</li>

<li>Remove from oven</li>

<li>Allow to stand for ten minutes</li>

<li>Serve</li>

</ol>

example for description list

coffee

a beverage made from roasted, ground coffee beans

a cup of coffee

a social gathering at which coffee is consumed

a medium to dark brown colour

<dl>

<dt>Name</dt>

<dd>Value</dd>

<dt>Name</dt>

<dd>Value</dd>

<dt>Name</dt>

<dd>Value</dd>

</dl>

advantages of list in HTML

Flexibility: If you have to change the order of the list items in an ordered list, you simply move around the list item elements; when the browser renders the list, it will be properly ordered.

Styling: Using an HTML list allows you to style the list properly using CSS. The list item tags <li> are different from the other tags in your document, so you can specifically target CSS rules to them.

Semantics: HTML lists give the content the proper semantic structure. This has important benefits, such as allowing screen readers to tell users with visual impairments that they are reading a list, rather than just reading out a confusing jumble of text and numbers.

To put it another way, don’t code list items using regular text tags. Using text instead of a list makes more work for you and can create problems for your document’s readers. So if your document needs a list, you should use the correct HTML list format.

hope it is helpful thank you

Similar questions