Professional Documents
Culture Documents
HTML <ul>tag marked unordered lists with bullet symbol disc or square or
circle .
The list-style property is a shorthand property. It is used to set all the list
properties in one declaration. This property consist with list-style-type, list-
style-position, list-style-image.
Syntax :
list-style : list-style-type list-style-position list-style-image;
When using the shorthand property, the order of the property values are:
If one of the property values above are missing, the default value for the
missing property will be inserted. list-style-image property is not required
whether list-style-type is specified.
Source Code :
Page 1
<!DOCTYPE html>
<html>
<head>
<style>
ul
{
list-style:decimal inside;
background : yellow;
}
</style>
</head>
<body>
<h1>List Style</h1>
<ul>
<li>List1</li>
<li>List2</li>
<li>List3</li>
</ul>
</body>
</html>
In above example defined in internal style sheet. <ul> tag used as selector of
style rule. list-style property of style rule defines
Output :
Page 2
List-style-type property
List-style-type property can define in style rule different type of list item
markers. Such as circle, square, upper-roman, lower-roman, decimal etc.
<ol class="c">
<li>Blockchain</li>
<li>Big Data</li>
<li>Image Processing</li>
Page 3
</ol>
<ol class="d">
<li>Blockchain</li>
<li>Big Data</li>
<li>Image Processing</li>
</ol>
</body>
</html>
Note :
Above HTML page is example of different CSS list-style-type. Class selector
‘a’, ‘b’ defines style rule of unorder list and ‘c’, ‘d’ defines style rule of order
list using list-style-type property of CSS.
Output:
List-style-position property
Example of list-style-position Property –
Source Code :
<!DOCTYPE html>
<html>
<head>
Page 4
<style>
ul.a {list-style-type: circle;list-style-position:inside;background : cyan;}
Output :
Page 5
List-style-image property
The list-style-image property specifies a graphical image as the list item marker
makes the page more attractive. list-style-image property specify the url of an
image(gif)file.
Whether the image file is not available in picture folder in that case
download .gif file by Google search engine.
Page 6
<ul class="c">
<li>Blockchain</li>
<li>Big Data</li>
<li>Image Processing</li>
</ul>
</body></html>
Note : In above example a , b & c class of ul tag define in style rules image as
list marker. Above three classes(a,b,c) are only applicable for <ul> tag. This is
an example of sub selector.
Output :
Page 7