UL Li background Small icon property settings generally have two kinds of situation: the definition in the UL and Li, these two definitions in what circumstances use, in the following gives a detailed introduction, often div+css layout of friends may wish to refer to, I hope to help
here we are listed in two ways:
① when the icon before the title is a long strand rather than a single point or similar icon, in the definition background figure background to be defined in <ul>. Because it's so long, I put it in <ul> outside of <li>.
② when the icon in front of the title is a single bit or a square or other similar icon, define the background map background to be placed in <li>
A
Copy Code code as follows:
<style>
. test1 {width:100px; height:265px background:url (http://www.86image.cn/statics/images/show/li.jpg) no-repeat Scroll 0 8px; }
. test1 li {padding-left:30px; line-height:27px; list-style-type:none;}
</style>
<ul class= "Test1" >
<li>one</li>
<li>two</li>
<li>three</li>
<li>four</li>
<li>five</li>
<li>six</li>
<li>seven</li>
<li>eight</li>
<li>nine</li>
<li>ten</li>
</ul>
As illustrated:
B
Copy Code code as follows:
<style>
. test1 li {padding-left:15px; Background:url ("Http:www.86image.cn/statics/images/tpl1/images/icon_fk.gif") No-repeat scroll 1px 8px; line-height:22px; List-style-type:none;}
</style>
<ul class= "Test1" >
<li>1</li>
<li>2</li>
<li>3</li>
</ul>
As illustrated: