/ How to make a list in the list. HTML-manual for beginners

How to make a list in the list. HTML-manual for beginners

Pages of websites consist of many elements -tables, pictures, links, media files, lists. One of the most sought after items is just the list. With its help, you can organize information, submit it in a more concise and understandable form, to facilitate the perception. That's why you should know how to make a list in HTML and what kinds of lists there are. And also learn how to set the necessary parameters.

List Types

First, let's outline the main types of lists with which we can work. This is an ordered, unordered and drop-down list.

The first allows you to number the contents with numbers and letters. The second is a normal enumeration of those or other items, the third one allows you to select from the entire list the desired element.

Almost each of them can contain a list in the list. HTML allows you to easily create complex lists of information in a very short time.

First of all, decide which of the lists you need, and then proceed to create it. Below we will look at all three types of lists and find out exactly how to create them and what parameters they have.

list in html list

Ordered list

Let's start with the most used anda common list - orderly. In this case, the enumeration of certain information goes in a certain order, and each of the elements is numbered. For example, a class list:

  1. Ivanov.
  2. Petrov.
  3. Sidorov, and so on.

Specifies such a list using the pair tags <ol>and </ ol>. It starts with the opening tag <ol>, and ends with a </ ol> tag. Each new element of the list begins with the pair <li> tag and ends with a closing </ li>.

Now you know how to make an HTML list. As you can see, for this it is enough to remember only two tags.

A bit about the parameters of the <ol> - type tag and start.

The first one specifies the type of numbering - alphabetic or numeric. It can take such parameters: A, a, I, i, 1.

The first two values ​​specify a numbering in Latinletters - uppercase and lowercase, second two - large and small Roman numerals, the latter meaning is used if you want the list to be numbered with Arabic numerals.

It should be noted that in the default lists, the numbering is always specified using Arabic numerals.

The second parameter - start - specifies the number from which the numbering of the list begins.

Let's say a couple of words and about the parameters of the <li> tag. He also has two. The first value parameter can change the numbering order. And it will be changed until the moment when this parameter is not registered again (or to the end of the entire list).

The second parameter - type - will help to change the type of numbering for this item. Quite often there is a variant of a complex list. For example, let's take an approximate plan of writing:

  1. Introduction.
  2. Main part.
    a) the opinions of others;
    c) my opinion;
    c) Evidence.
  3. Conclusions.

Create such a list in the HTML list is prettyjust. It is enough to write one main list, and then create the second sub-item in the right place using a different numbering. Here is an example code based on our list:

  • <ol type = "1">.
  • <li> 1. Introduction </ li>.
  • <li> 2. The main part </ li>.
  • </ ol type = "A">
  • <li> opinions of others </ li>.
  • <li> My opinion </ li>.
  • <li> evidence </ li>.
  • </ ol>.
  • <li> 3. Conclusions </ li>.
  • </ ol>.

Unordered list

The second kind of list is unordered. It does not matter in which order the elements go. It can be a list of anything - purchases, guests, books, etc.

how to make a html list

This list is specified using the <ul> and </ ul> paired tag. In this case, each new element begins with the same paired tag <li> </ li>.

Has only one parameter - type, with the help ofwhich is the type of the marker. The marker can be a circle - painted or not, as well as a painted square. So, an empty circle has the value disc, the shaded circle. The square is given by square.

There is also the possibility to create a list in the HTML list. For this, as in the first case, you will have to create two lists, one of which is basic, the second is nested.

Drop-down list

drop-down list html
And the last type of lists is a dropdown. Basically, it is used with scripts and serves for the user to send this or that information to the owners of the site or a certain program.

Examples can be lists from which youyou should choose the country of residence, place of study or work, date of birth, evaluation of an article, etc. In doing so, you select the item you need from the list before sending the information.

In passing, we mention the tags by whicha drop-down list is created. HTML does not have full functionality to create list data. Note that when working with this type of list, you need to know not only the basics of page layout, but also have an understanding of CSS styles and java-scripts.

The list itself is specified using the <select> </ select> paired tags.

Each new element begins with the <option> </ option> paired tag.

If you decide to create such a list on your site, we recommend that you find special additions to your engine. With it, creating a drop-down list is much easier than writing yourself.

how to make a list in html

conclusions

One of the most used items onsite pages - lists. Create them is very simple, using just a few tags with simple parameters. If you want, you can make a list in the list. HTML markup allows you to create it in just a few minutes.

Read more: