css中list-style-image無法準確定位通過li的背景類比或相對定位的解決

來源:互聯網
上載者:User
這個list-style-image的定位問題也是經常有人問的,解決的辦法一般是用li的背景類比,這裡採用相對定位的方法也可以解決.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh"> <head profile="http://www.w3.org/2000/08/w3c-synd/#"> <meta http-equiv="content-language" content="zh-cn" /> <meta http-equiv="content-type" content="text/html;charset=gb2312" /> <title>blueidea</title> <style type="text/css"> li { list-style:url("http://bbs.blueidea.com/attachments/2006/11/10/arrowb_kJrcZheJmiIF.gif"); } li a { position:relative; top:-5px; font:12px/25px 宋體; } </style> </head> <body> <ul> <li><a href="#">web標準常見問題大全</a></li> <li><a href="#">web標準常見問題大全</a></li> <li><a href="#">web標準常見問題大全</a></li> <li><a href="#">web標準常見問題大全</a></li> <li><a href="#">web標準常見問題大全</a></li> </ul> </body> </html>
相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.