Skip to main content

CSS List Property

You can create mainly two types of List through HTML. First, Unordered List which is also called Bullet List. And another Ordered List is also called Number List. CSS List Properties have been created to customize HTML List. By List Properties of CSS, you can customize List Style, Position, Color, etc. according to you. Various CSS List Properties Many properties are provided to customize the HTML list as per the need. Whose names are being given below? list-style-type list-style-position list-style-image list-style list-style-type property The style of the Bullets and Numbers of the list is defined by the list-style-type property. It is also called List Style Marker. Depends on the type of Style List Type of Marker. There can be four possible values ​​of an unordered list. None – Marker is removed from this value. Disc – This value is the default value of the Unordered List. It is a filled circle. Like a CD or DVD. Circle – You can compare this Style Marker with the circle. Its textur

CSS List Property

CSS List Property

You can create mainly two types of List through HTML. First, Unordered List which is also called Bullet List. And another Ordered List is also called Number List.

CSS List Properties have been created to customize HTML List. By List Properties of CSS, you can customize List Style, Position, Color, etc. according to you.

Various CSS List Properties

Many properties are provided to customize the HTML list as per the need. Whose names are being given below?

  • list-style-type
  • list-style-position
  • list-style-image
  • list-style

list-style-type property

The style of the Bullets and Numbers of the list is defined by the list-style-type property. It is also called List Style Marker. Depends on the type of Style List Type of Marker.

There can be four possible values ​​of an unordered list.

  1. None – Marker is removed from this value.
  2. Disc – This value is the default value of the Unordered List. It is a filled circle. Like a CD or DVD.
  3. Circle – You can compare this Style Marker with the circle. Its texture looks like this.
  4. Square – This gives a filled square as a List Marker.

Similarly, there are many values ​​in the order list as well. Below we are telling you only about the most used values.

  1. none – This removes all the markers.
  2. Decimal – In this value Order List Numbers i.e. 1, 2, 3, 4 are shown. This is the default in the Marker Style Order List.
  3. decimal-leading-zero – This value is clear from the name itself. In this Marker Style, 0 shows before the number. Like 01, 02, 03 etc.
  4. lower-alpha – In this value, the Marker Style shows the Lower Alphabets Characters. For example, a, b, c, d, etc.
  5. upper-alpha – Capital alphabets are shown in this value. For example, A, B, C, D, etc.
  6. lower-roman – Style Marker Shows in Roman Number in this value. Which are displayed in smaller i.e. lower size. For example, i, ii, ii, iv, etc.
  7. upper-roman – This value has Roman Number Capital Display. Like, I, II, III, IV, etc.


Try it

<!DOCTYPE html>

<html>

<head>

<title>CSS List Type Examples</title><style type=”text/css”>

ul {

list-style-type: circle;

}

ol {

list-style-type: upper-alpha;

}</style>

<body>

<ul>

<li>Computer<li>

<li>Tablet<li>

<li>Mobile<li>

</ul>

<ol>

<li>Mango<li>

<li>Banana<li>

<li>Grapes<li>

</ol>

</body></html>


The above code will give a result like this.

css list property

list-style-position property

By this property, you set the position of List Markers. It has two possible values.

  • outside – If the position of the marker is outside set, then there is a lot of distance between the list content and the marker. And the second line of text also starts from below the first line.
  • Inside – By setting the position of the marker inside, the marker becomes indented in the first line and the second line starts from the bottom of the marker. Learn the best html css course in Delhi from the best training institute...


Try it

<!DOCTYPE html>

<html>

<head>

<title>CSS List Style Position Examples</title><style type=”text/css”>

ul {

list-style-position: outside;

}

ol {

list-style-position: inside;

}</style>

<body>

<ul>

<li>This is a list of Internet Deices. First is computer, second is tablet and last one is mobile. This is a list of Internet Deices. First is computer, second is tablet and last one is mobile.</li>

<li>Computer<li>

<li>Tablet<li>

<li>Mobile<li>

</ul>

<ol>

<li>This is a list of fruits. First is manog, second is banana and last one is grapes. This is a list of fruits. First is manog, second is banana and last one is grapes.</li>

<li>Mango<li>

<li>Banana<li>

<li>Grapes<li>

</ol>

</body></html>


The above code will give a result like this.

css list property

list-style-image

By this property, you can use any image for List Marker. Which can make your List Content very attractive. Syntax of using Image as List Marker is exactly the same as Background Image Property.

Next-G Education is the best web development institute Delhi, which provides advanced courses...


Try it


<!DOCTYPE html>

<html>

<head>

<title>CSS List Style Image Examples</title><style type=”text/css”>

ul {

list-style-image: url(‘greenarrow.png’);


}</style>

<body>

<ul>

<li>Computer<li>

<li>Tablet<li>

<li>Mobile<li>

</ul>

</body></html>

The above code will give a result like this.

css list property

If the browser does not get the image, then it shows the default marker according to the list type.

Note – While using Image as Style Marker, keep in mind the Image Size which should be according to the Marker Style.


list-style property

All List Styles can be declared simultaneously by this property. It is called Shorthand Property.

When using list-style property, list properties have to be declared in proper order. If you do not declare anyone property, then the subsequent property is declared.

In the Shorthand Style Rule, the order of List Properties remains as follows.

list-style-type → list-style-position → list-style-image


Try it


ul {

list-style: inside circel;

}

Other List Properties

So far you have learned about List Properties Provided by CSS. You can also use some other CSS properties for HTML List. You can also use CSS Color, Background, Margin & Padding Properties, etc.


What have you learned?

In this tutorial, we have given you information about CSS List Property. You have learned about different types of List Properties through examples. We hope that this tutorial will prove useful for you.


Also Read:

Comments

Popular posts from this blog

How to Make a Free Blog on Blogger?

Creating a blog on Blogger.com is very easy. You can create your own website by following a few easy steps. And in this post, we will tell you how to create a free blog on Blogger / BlogSpot? How to Create a Free Blogger Blog? Step: #1 First go to blogger.com. Step: #2 Click on Create a Blog. Step: #3 Sign in with Google Account. Step: #4 Write Blog Title. Step: #5 Write a Blog Name and also write a description. Step: #6 and click on Create Blog. Step: #7 View the blog by going to the View blog. Your blog has been created. ➤ Step: #1 First of all, go to the official website of Blogger To go to Blogger's website, type blogger.com in the address bar of your browser. Or you can also go to blogger by clicking on the link. ➤ Step: #2 By doing this, you will reach the homepage of Blogger and the homepage of blogger.com will be open in front of you. From here you click on CREATE YOUR BLOG. ➤ Step: #3 Now, where will you go to sign in? For this, you use a Google account. And sign in by E-m

What is Adobe Premiere Pro and How to Download It?

Give your video a new look by editing it with  Adobe Premiere Pro ! Many types of videos are made on social media today, for which video editing applications are used. The use of these applications gives a new look to the video. Adobe Premiere Pro is also a software application that is used to do video editing. Today we will know in this post what is Adobe Premiere Pro . This type of application is mostly used for YouTube videos. With which users can give new effects to their videos. How good animation is used in movies and videos today. Due to which the video becomes of better quality.  So let's now know what is Adobe Premiere? After knowing about which you can use it to improve your video. What is Adobe Premiere Pro? It is a kind of video editing program. By which the video is edited, cut, cropped. With this, you can also make movies and dynamic videos. It does graphic design. You can also do text animation in your video and there are many other types of animation that you can