废话不多说先上代码和最终效果图。
代码:
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ul\li默认margin\padding测试</title>
<style>
html{overflow:auto}
body{font:12px Arial, Helvetica, sans-serif;background:#FFF}
body,h1,h2,h3,h4,h5,h6,p{margin:0;}
ul{margin-top:0;margin-bottom:0;padding-left:0;*margin-left:0;}
li{list-style:none}
.u_a li{background:url(images/li_dot.gif) no-repeat;padding-left:15px;line-height:25px;_width:95%;font-size:14px;overflow:hidden; white-space:nowrap;text-overflow:ellipsis;}
.u_a li a{color:#333; text-decoration:none}
.u_a li a:hover{color:#333; text-decoration:underline}
.d_a{width:450px;margin:50px auto 0;border