Computers, Programming
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.
Types of lists
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.
Ordered list
Let's start with the most used and distributed 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:
- Ivanov.
- Petrov.
- Sidorov, and so on.
This list is specified using the
- and ol> paired tags. It starts with the opening tag
- 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
- - type tag and Start.
- 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, take an approximate plan of writing :
- Introduction.
- Main part.
A) the opinions of others;
C) my opinion;
C) Evidence. - Conclusions.
It's quite easy to create such a list in the HTML list. 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:
-
- .
- 1. Introduction li>.
- 2. The main part li>.
- Ol type = "A">
- opinions of others li>.
- My opinion li>.
- evidence li>.
- Ol>.
- 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.
This list is specified using the
- and ul> paired tag. In this case, each new element begins with the same paired tag
- li>.
It has only one parameter - type, which sets 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 specified using 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 the main list, the second one is nested.
Drop-down list
And the last type of lists is a dropdown. Basically, it is used with scripts and serves to allow the user to send this or that information to the owners of the site or a certain program. Examples can be lists from which you should choose the country of residence, the place of study or work, the date of birth, the evaluation of an article, etc. At the same time, you select the item you need in the list before sending the information.
In passing, we mention the tags that help create a drop-down list. HTML does not have the 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 idea about CSS styles and java-scripts.
The list itself is specified using the
Each new element begins with the
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.
conclusions
One of the most used elements on the pages of sites is 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.
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 are numbered in Latin letters - uppercase and lowercase, the second two - large and small Roman numerals, the latter value 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 the parameters of the
- 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).
- , and ends with a ol> tag. Each new element of the list begins with the pair
Similar articles
Trending Now