css小技巧

网页字体

font-size: 16px;font-family: "Microsoft Yahei", Arial, Helvetica, sans-serif; 网络常用来显高大上的名言警句字体 
font: 12px "宋体", Arial, Helvetica, sans-serif; 普通内容字体
color: #474645; 内容小标题 以及内容
 line-height: 20px 内容行高
  1. font-weight: bold; 字体加粗
  • color: #838383;
  • background: #f6f6f6; 颜色较浅的地方
 

选择器

.texts p:nth-child(2){} :取texts 类下的第二个p
:hover {}:当鼠标移到

动画控制

    /* -webkit-transition: all 1s; */
    -moz-transition: all 1s;       
    -o-transition: all 1s;
    transition: all 1s;        /*动画共1秒
    /* -webkit-transform: translate(60px); */
    -moz-transform: translate(60px);        /*沿x轴向右移60px*/
    -o-transform: translate(60px);
    -ms-transform: translate(60px);
    /* transform: translate(60px); */
-moz-transform: scale(1.1) 图片放大

整体效果调整

letter-spacing: 2px;  字与字间隔2px
text-shadow:0px 1px rgba(255,255,255,0.3) 字阴影
 box-shadow: #999 4px 5px 1px;  块区域阴影
overflow: hidden; 多余部分隐藏
border-radius: 100%;overflow: hidden; 变成圆形后 ,需设置内容隐藏
border-radius: 0 20px 20px 0; 右半圆
box-shadow: -2px -1px 5px #666;

 

扩展知识

line-height: 28px;  为达效果,当高度不能更改时,可以试着用行高
display: block 如果未达效果,试着设置
border-bottom: #474645 2px solid; 画一条线
margin: 0 20px 20px 20px 上 右 下 左
margin: 20px auto 上下 左右
margin: 20px 20px 20px 上 左右 下
阅读全文&gt;&gt; <<号
伪元素:给部分整体前添加 元素 并控制
.blogs::before { content: ""; width: 10px; height: 10px; border-radius: 50%; position: absolute; background: #cac1c1; border: 2px solid #fff; left: -27px; -webkit-transition: all 1s; -moz-transition: all 1s; -o-transition: all 1s; transition: all 1s; }
.blogs:hover::before { background: #474645 }
.dateview { position: absolute; left: -125px; top: 0px; z-index: 1; color: #F5F5F5; }
.blogs::after { content: ""; width: 121px; height: 29px; position: absolute; left: -148px; top: -9px; z-index: 0; background: #474645 url(../images/ti.png) no-repeat; opacity: 0; -webkit-transition: all 1s; -moz-transition: all 1s; -o-transition: all 1s; transition: all 1s; }
.blogs:hover::after { opacity: 1 }
或者:
a:before
{ content: " (" attr(href) ")";}

 a伪元素

选择未访问、已访问、悬浮和活动链接,并设置它们的样式:
a:link    {color:blue;}
a:visited {color:blue;}
a:hover   {color:red;}
a:active  {color:yellow;}

 

 

 结尾:给自己的的页面设置分享按钮 例如:分享到QQ 、新浪 、人人、微信 等等  

分享按钮-百度分享

它会告诉你

posted @ 2016-03-09 21:13  我_爱编程  阅读(324)  评论(0编辑  收藏  举报