How to create an HTML list? Very simple!


HTML at the moment is the most popularlanguage used for marking web pages. Many developers do not even know that there are other tools for creating websites. This language is devoted to many books, courses and seminars. About him and this article. Of course, I will not be able to fit all the potential of this language into several pages, but I did not try to do it. This article will allow you to get acquainted with an object such as an HTML list. We'll look at its types and tags, allowing you to display the users on the screen.

general information

html list
The HTML list is used quite often. Since it allows you to quickly and efficiently provide the desired information to users. There are two kinds of lists: ordered and unordered. Their structure remains the same. The only difference is that the ordered list uses numbers as markers, which go in order. Next, we will consider each species separately.


how to create a list in html
Such an HTML list begins with the <ol> tag andends with a closing element </ ol>. The <ol> tag is fully supported by all modern browsers, operating systems and platforms. To indicate a list item, use the <li> tag. Very often this kind of markup is called numbered. Although at the same time as a marker can be used not only numbers, but, for example, letters. The <ol> tag has three characteristic attributes, which will be further described.

  • Type. Allows you to select the type of marker. As mentioned above, not only the usual Arabic numerals, but also other symbols can be used. If the attribute type is set to "A", then the list will be ordered in uppercase Latin letters. The value of "a" - lowercase letters; "I" - the Roman numerals; "I" - lowercase Roman numerals; "1" is Arabic numerals.
  • Reversed. It offers the browser a countdown, for example 3, 2, 1, etc. It should be noted that many browsers do not support this attribute and are not included in any specification (except for HTML 5).
  • Start. The value can be a number that will indicate where the countdown will begin.


unordered list of html
In another way, this species is called unnumberedlist of HTML. Decorative markers are used as a designation for the beginning of an element. In the past paragraph was used just such a list. With CSS, you can generally remove the display of markers, this happens with the use of the property "list-style-type", with the value "none". The <ul> tag is used to indicate the beginning of an unnumbered list. It contains <li> elements. For the <ul> tag, there is only one individual attribute, namely "type", which indicates the type of the marker. Its values ​​can be keywords: disc, circle, square. The first denotes a filled circle, the second contour of the circle and the third a square. Using the property "list-style-image" (from CSS), you can assign your own markers that look like small pictures.


The question of how to create a list in HTML is specifiedquite often in various forums and portals. Therefore, a separate article for this information does not hurt to fully satisfy the curiosity of novice programmers. And remember that the HTML list can be used sometimes not for its intended purpose. But this topic is already beyond the scope of this article.