开发者

link with image

i have list of links

  • link1
  • link2
  • link3

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>


It sounds like what you are really wanting to do is to change the • circular bullet point to an image that you have specified. Like so:

<UL id="navlist">

#navlist
{
list-style: none;
}

#navlist li 
{
padding-left: 10px;
background-image: url(images/arrow.gif);
background-repeat: no-repeat;
}


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜