css选择器

一、CSS优先级如何
1、内联style
2、id选择器
3、class选择器
4、标签
5、css长度单位:px(像素)\em(倍数)
常用选择器:
  1、标签
  2、id
  3、类
层级选择器
伪类选择器
  1. :hover
   img:hover{

    background:#f0f;//当鼠标放上去的时候出现颜色
    border-radius:256px;

}
  2.:focus
   .username:foucus{

       kackground:#f0f;

}
   3.::selection
   p::selection{


     backfround:#f00;
}
CSS常见的样式属性和值
1、字体与颜色
   funt
  (1)font-family//字体类型
   //字体名称:宋体,楷体,黑体
   (2)font-size //字体大小
      //30px
    (3)font-style   //字体样式
        //normal | italic
     (4)font-weight //字体加粗
       //bold
    
2、背景属性
    background
    1.background-color
    2.background-image
    3.background-repeat
    4.background-attachment
    5.background-position
    1.水平:left center  right
     垂直:  top   center bottom
3、文本属性
    letter-spacing   //字间距
      word-spacing   //此间距
      text-decoration  //none||underline||overline||line-through
     //none  用来把a标签的下划线去掉
     text-align
     //只能是文本居中
     text-indent  缩进
    line-height  行高
     color   颜色
     word-break   拆行
 
4、边框属性
5、鼠标光标属性
6、列表样式
7、定位属性
8、内外边框
9、浮动和清除浮动
10、滚动条
11、显示和隐藏

css背景样式
 

css过渡动画
 <style>

    img{
        transform:scale(1.5,1.5);

}
  </style>
 
<script>
 $('img').mouseenter(function(){


   $(this).css({


         'transform':'scale(1.5,1.5)'


});


});
 </script>

3d样式

1.rorateX(30deg);
2.rorayeY(30deg);
  <title></title>
  <style>
 
       .img{

           background:#ccc;
         width:256px;
        height:256px;
         border-radius:256px;
         overflow:hidden;//隐藏图片突出的部分

}
   </style>


<body>
   <div class='img'>
     <img src="xxx.png" alt="">
    </div>
</body>
    <script>
   s=0;
   v=10;
    $('.img').click(function(){
    setInterval(function(){

       s+=v;
    $('.img').css({'transform':'rotateX('+s+'deg)'});

},100);

    });
 

  //分栏
  多栏
  1.column-count
  2.column-gap
  3.column-rule
 <style>
     .art{

          border:2px dashed #00f;
          -webkit-column-count:3;
          -webkit-colimn-gap:30px;
          -webkit-column-rule:4px solid #f00;

}
 </style>
  <div class='art'> 文本</div>

  轮廓样式
   outline:2px solid #f00;
   outline-offset:13px;
    

















































































































































































  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值