<style>
blockquote, body, button, dd, dl, dt, fieldset, form, h1, h2, h3, h4, h5, h6, hr, input, legend, li, ol, p, pre, td, textarea, th, ul{
margin: 0;
padding: 0;
}
h3 {
display: block; 变成块级元素
margin: 0;
padding: 0;
}
.cat {
position: relative;
width: 150px;
background: #f8f8f8;
border: 1px solid #bbb;
}
ol, ul {
list-style: none; 去掉list前默认圆点
}
li {
z-index: 2;
position: relative;
display: block;
height: 31px; 设置高度和行高完成居中
line-height: 31px;
overflow: hidden;
margin: 1px 10px 0;
vertical-align: bottom;
border-bottom: 1px solid #dedede
}
li h3 {
font-size: 14px; 字体大小
font-weight: 400; 字体粗细
}
li i {
display: inline; 转换成内联元素 不换行
float: left;
margin: 3px 10px 0 0;
height: 24px;
width: 30px
}
<body>
<div class="cat">
<ul >
<li>
<i></i>
<h3>服装内衣</h3>
</li>
<li class="cat-2">
<i></i>
<h3>鞋包配饰</h3>
</li>
<html>
<head>
<style>
blockquote, body, button, dd, dl, dt, fieldset, form, h1, h2, h3, h4, h5, h6, hr, input, legend, li, ol, p, pre, td, textarea, th, ul {
margin: 0;
padding: 0;
}
.container {
width: 220px;
margin-right: 35px;
background: #ebf2fa;
border: 1px solid #d4d4d4;
border-bottom-color: #AAA;
border-top: 0;
height: 692px;
box-shadow: 0 1px 1px #CCC;
background: #ebf2fa url(http://a.xnimg.cn/n/apps/login/v6/cssimg/sidebar-bg.png) left top no-repeat;
margin-top: -2px;
}
.login-form {
padding: 35px 15px 15px;
}
.login-form dl {
line-height: 20px;
}
.login-form dl.pwd {
margin: 15px 0 0;
}
.bottom {
margin-top: 15px;
}
.top dd,.pwd dd{
width: 186px;
background: #FFF url(http://a.xnimg.cn/n/apps/login/v6/cssimg/bg.png) 0 -76px no-repeat;
border: 1px solid #adb6c9;
border-radius: 3px;
height: 32px;
box-shadow: 0 0 1px #FFF;
padding: 1px;
}
.login-form .input-text {
background: transparent;
font-size: 14px;
height: 32px;
line-height: 32px;
padding: 0;
margin: 0 0 0 30px;
width: 155px;
border: 0;
}
.login-btn {
width: 190px;
height: 38px;
text-indent: -9999em;
border: 0;
background: url(sp.png) no-repeat;
cursor: pointer;
}
.regnow {
margin: 0 15px;
padding: 17px 0 15px;
}
.regnow input{
background-position: 0 -38px;
border: 0;
padding: 0 0 3px 0;
}
</style>
</head>
<body>
<div class="container">
<form method="post" class="login-form">
<dl class="top clearfix">
<dd>
<input type="text" name="email" class="input-text">
</dd>
</dl>
<dl class="pwd clearfix">
<dd>
<input type="text" name="email" class="input-text">
</dd>
</dl>
<dl class="bottom">
<input type="submit" class="input-submit login-btn" value="登录">
</dl>
</form>
<div class="regnow">
<input type="button" class="input-button login-btn" value="注册" >
</div>
</div>
</body>
</html>