demo-1 京东
base.css
@charset "UTF-8";
/*css 初始化 */
html, body, ul, li, ol, dl, dd, dt, p, h1, h2, h3, h4, h5, h6, form, fieldset, legend, img { margin:0; padding:0; }
fieldset, img,input,button { border:none; padding:0;margin:0;outline-style:none; }
ul, ol { list-style:none; }
input { padding-top:0; padding-bottom:0; font-family: "SimSun","宋体";}
select, input { vertical-align:middle; }
select, input, textarea { font-size:12px; margin:0; }
textarea { resize:none; } /*防止拖动*/
img {border:0; vertical-align:middle; } /* 去掉图片低测默认的3像素空白缝隙*/
table { border-collapse:collapse; }
body {
font:12px/150% Arial,Verdana,"\5b8b\4f53";
color:#666;
background:#fff
}
.clearfix:before,.clearfix:after{
content:"";
display:table;
}
.clearfix:after{clear:both;}
.clearfix{
*zoom:1;/*IE/7/6*/
}
a{color:#666; text-decoration:none; }
a:hover{color:#C81623;}
h1,h2,h3,h4,h5,h6{text-decoration:none;font-weight:normal;font-size:100%;}
s,i,em{font-style:normal;text-decoration:none;}
.col-red{color: #C81623!important;}
/*公共类*/
.w { /*版心 提取 */
width: 1210px;margin:0 auto;
}
.fl {
float:left
}
.fr {
float:right
}
.al {
text-align:left
}
.ac {
text-align:center
}
.ar {
text-align:right
}
.hide {
display:none
}
.headcut{
/*height: 30px;*/
line-height: 30px;
background-color: #f1f1f1;
width: 100%;
}
.headcut .w{
background-color: #f1f1f1;
}
.headcut li{
float: left;
padding: 0 10px;
}
.headcut .tel-li{
padding-left: 27px;
}
.tel-li .tel-icon{
width: 15px;
height: 20px;
background: url("./images/jd2015img .png");
position: absolute;
top:5px;
left: 7px;
}
.headcut .spacer{
width: 1px;
height: 12px;
padding: 0;
background-color: #DDD;
margin-top: 9px;
}
.headcut .dropdown{
position: relative;
padding-right: 25px;
}
.dropdown i{
position: absolute;
width: 15px;
height: 9px;
overflow: hidden;
/*display: inline-block;*/
top: 12px;
right: 6px;
}
.dropdown s{
position: absolute;
font: 400 15px/15px consolas;
color: #6A6A6A;
top: -6px;
left: 0;
}
index.html
demo-2 qq注册
qq注册
总结1:block,inline和inlinke-block 区别
- display:block
-
- block元素会独占一行,多个block元素会各自新起一行。默认情况下,block元素宽度自动填满其父元素宽度。
- block元素可以设置width,height属性。块级元素即使设置了宽度,仍然是独占一行。
- block元素可以设置margin和padding属性。
- display:inline
-
- inline元素不会独占一行,多个相邻的行内元素会排列在同一行里,直到一行排列不下,才会新换一行,其宽度随元素的内容而变化。
- inline元素设置width,height属性无效。
- inline元素的margin和padding属性,水平方向的padding-left, padding-right, margin-left, margin-right都产生边距效果;但竖直方向的padding-top, padding-bottom, margin-top, margin-bottom不会产生边距效果。
- display:inline-block
-
- 简单来说就是将对象呈现为inline对象,但是对象的内容作为block对象呈现。之后的内联对象会被排列在同一行内。比如我们可以给一个link(a元素)inline-block属性值,使其既具有block的宽度高度特性又具有inline的同行特性。
总结2:
总结3:
总结4: CSS position 属性
static 是默认值
relative 相对于父类
fixed 是以为相对于浏览器窗口Window进行定位
总结5: css中width:auto和width:100%的区别
https://my.oschina.net/u/2428791/blog/505234?p={{currentPage+1}}