i have list of links
- link1
- link2
- link3
how can i add an image left on each link with css style not html tags?
i have list of links
how can i add an image left on each link with css style not html tags?
Use CSS to suppress the existing list bullets (list-style:none
) then specify your own image using background
, as in this snippet:
li {
list-style: none;
background: url(16-heart-red-xxs.png) no-repeat left center;
...
For more information, see: http://webdesign.about.com/od/css/a/aa012907.htm
EDIT:
See below for new source code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Page</title>
<style type="text/css">
li
{
list-style: none;
background: url(/images/servers.png);
background-repeat: no-repeat;
background-position: left;
}
</style>
</head>
<body>
<ul>
<li><a href="http://trading-it.ru/Category/1--.aspx">??????? ? ????????? ????????????</a></li>
<li><a href="http://trading-it.ru/Category/2--.aspx">????? ??? ????????</a></li>
<li><a href="http://trading-it.ru/Category/3--.aspx">??????????, ????????</a></li>
<li><a href="http://trading-it.ru/Category/4--apple.aspx">????????? Apple</a></li>
<li><a href="http://trading-it.ru/Category/10--.aspx">??????????? ???????????</a></li>
<li><a href="http://trading-it.ru/Category/11--.aspx">???????????? ?????????????</a></li>
<li><a href="http://trading-it.ru/Category/12--.aspx">????????? ? ??????? ???????</a></li>
<li><a href="http://trading-it.ru/Category/13--.aspx">????????? ?????????</a></li>
<li><a href="http://trading-it.ru/Category/14-.aspx">?????????</a></li>
<li><a href="http://trading-it.ru/Category/15--.aspx">?????????? ? ??????</a></li>
<li><a href="http://trading-it.ru/Category/16--.aspx">??????????????? ????????????</a></li>
<li><a href="http://trading-it.ru/Category/17--.aspx">??????? ????????????</a></li>
<li><a href="http://trading-it.ru/Category/21-111.aspx">111</a></li>
</ul>
</body>
</html>
You can also use the list-style-image
property for that:
li {
list-style-image: url("/images/servers.png");
}
This will add the image and not a circle, square etc. to each element of the list.