on air

CSS List Style Types.

back home » Web Tutorials » CSS » CSS List Style Types.


Scenario.

In HTML, creating the ORDERED, or UNORDERED list could be designed only with either numbers, or bullets.

In this example, you'll learn how the CSS List properties could be used to boost the ORDERED, and UNORDERED lists to a higher level. The list-style-type gives you the possibility to design your list styles using images, and different list item markers.

Ordered List Style.

Below is how to set up an ordered list in CSS. This list item marker is defined using the property, list-sytle-type. See illustration below.

<head>
<style>
<!--
ol.fontie1 {list-style-type: upper-roman;}
ol.fontie2 {list-style-type: lower-latin;}
ol.fontie3 {list-style-type: upper-alpha;}
-->
</style
</head>

Unordered List Style.

Below is how to set up an ordered list in CSS. This list item marker is defined using the property, list-sytle-type. See illustration below.

<head>
<style type="text/css">
<!--
ul.discos {list-style-type: disc;}
ul.roundy {list-style-type: circle;}
ul.quardy {list-style-type: square;}
-->
</style
</head>

List Item Image Marker.

Below is the easiest way to add image as a list marker. This method is still incompatible with many browsers. See illustration below.

<head>
<style type="text/css">
<!--
ul{
list-style-image:url(images/arrow.png);
}
-->
</style>
</head>

Cross-Browser Solution [CBS]

Below is the right method to use, when setting up image marker list in CSS. This is compatible with the cross-browser solution. See the illustration below.

<head>
<style type="text/css">
<!--
ul{
list-style-type: none;
padding: 0px;
margin: 0px;
}
li{
background-image: url(arrow.png);
background-repeat: no-repeat;
background-position: 0px 5px;
padding-left: 15px;
}
-->
</style>
</head> 

Explaining The Cross-Browser Solution. [CBS]

It's strictly advisable to coop with the method in the script above. This is the right way to achieve the cross-browser solution when using image as a list marker.

  • In the <ul> selector's definition.
    • The list-style-type should be set to "none." This will remove the default list item marker.
    • For Cross-browser compatibility, both margin, and padding should be set to 0px.
  • In the <li> selector's definition.
    • Set the URL of the preferred image. This will load the preferred image into the list.
    • Set its background-repeat to no-repeat; This will stop browser loading the image more than one.
    • Set the background-position as desired in pixels. This will position the image as desired.
    • And position the list text with padding-left, giving it a suitable amount of pixels.

FastLane Tip:

Preview in browsers to see how they'll format your list. And troubleshoot the amount of pixels used for the background-position, and padding-left.

The above scripts are all created in the head section of HTML. Learn creating them in an external stylesheet.

CSS List Style Types.

Clicks4UrMind

Man will give you worldly powers, and make you feel on top of all, note this is temporally and could be redrawn at anytime sending you back to the ground floor of life. However, the Lord Almighty, the one and the only rightful ruler of the Universe, blesses everlastingly.

Brain

Knowledge is Power, but Power is not Knowledge. Wisdom is the truthful Power that identifies the Knowledge within the man. And only, I repeat 3x. Only the almighty God has the power to bless the man with his Wisdom forever.

To achieve the Lord's blessings, cease not praying daily, asking for his Wisdom, and you'll be blessed abundantly...

SPYERA PHONE

Spyera Phone

Spyera Phone version is software that you install on a smart phone to monitor everything happening on the phone. After installation, SPYERA secretly records events (sms, call history, phone book, location, emails, What's App messages, IM, Facebook Chat, Skype, See photos taken and many more...) that happen on the phone and delivers these information to a web account, where you can view these reports 24/7 from any Internet enabled computer or mobile phone. SPYERA also allows you to listen to the surroundings of the target mobile , listen to the phone conversation and to know the location of the device.


Please, Kindly Donate What You Can, Enabling Us Pay Hosting And Domain Costing, And Do More.

Please Donate