<ul type="">
Disclosure: Your support helps keep the site running! We earn a referral fee for some of the services we recommend on this page. Learn more
- Attribute of
- <ul> HTML Tag
- What does
<ul type="">
do? - Was used to set list types.
Code Example
<ul type="circle">
<li>This is a list item.</li>
<li>The items in this list don't need to be in order.</li>
<li>This is an unordered list.</li>
</ul>
- This is a list item.
- The items in this list don't need to be in order.
- This is an unordered list.
Styling List Markers
The type
attribute is used to tell the browser which type of list marker to apply to a list. The accepted values include disc, circle, and square. The default value applied by the browser is circle, so when no value is provided, that is the value used. List markers can also be controlled with CSS, and that is the proper way to style list markers now that the type
property has been deprecated. The list-style-type
CSS property will accept many different values. The values appropriate for an unordered list include the same values that were previously used with the type
attribute. There are many additional values that are appropriate for use with ordered lists.
<style> .disc { list-style-type: disc; } .circle { list-style-type: circle; } .square { list-style-type: square; } </style> <ul class="disc"> <li>This is a list with disc list markers.</li> <li>The items in this list don't need to be in order.</li> <li>This is an unordered list.</li> </ul> <ul class="circle"> <li>This is a list with circle list markers.</li> <li>The items in this list don't need to be in order.</li> <li>This is an unordered list.</li> </ul> <ul class="square"> <li>This is a list with square list markers.</li> <li>The items in this list don't need to be in order.</li> <li>This is an unordered list.</li> </ul>
Let’s see how the browser handles each case.