学习笔记《DIV+CSS》

页面命名:

整个页面的居中:

#nav {margin:0px auto; width:1200px}
#container, #footer {margin:0px auto; width:1440px}

字体:

body {font-family:PingFangSC-Regular, "Microsoft YaHei", sans-serif;}

链接样式的处理:

a:link { text-decoration: none;color: blue}
a:active { text-decoration:blink}
a:hover { text-decoration:none;color: red}
a:visited { text-decoration: none;color: blue}

奇偶间隔显示的伪类:

.cf2-like-product-item:nth-child(2n) .cf2-like-product-item-bottom {background:#fc6605;}
.cf2-like-product-item:nth-child(2n) .cf2-like-product-item-title {color:#fc6605;}

Margin Border & Padding:


学习笔记《DIV+CSS》_第1张图片

字符串截取:

overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;

扩展阅读:http://stackoverflow.com/questions/20792639/how-to-display-only-the-first-few-lines-of-a-div-clamping

你可能感兴趣的:(学习笔记《DIV+CSS》)