记一次 css样式的使用

1.实现效果:

1.1.代码

<div class="s_center">
   <span style="letter-spacing: 10px;">居中文字</span>  <!--letter-spaciing:设置文字间间距-->
</div>
<style scoped>
   .s_center{
      z-index:999;          /*层级设置*/
      width: 200px;
      height: 200px;
      line-height: 200px;    /*上下: line-height 要和 height设置高度一样*/
      text-align: center;    /* 左右 */
      border: 1px solid #cccccc;  /* 设置 实现边框*/
      box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.2);   /* 设置 边框阴影*/
      opacity:1;   /* 背景透明度 0:透明,1 :不透明 ,0-1间:设置不同的透明度*/
      border-radius: 4px;   /* 设置边框圆角 */
    }
</style>

 

2. element-ui 隐藏滚动条

  /*隐藏滚动条*/
  ::-webkit-scrollbar {
    height: 0 !important;
  }
  ::-webkit-scrollbar {
    height: 0 !important;
  }

3.设置无边框,无选中样式

    border: none;
    outline: none;

 4.定位

<div style="position:relative;">  
    相对的父标签
    <div style="positon:absolute;">    <!--fix:绝对定位-->
        相对定位的子标签
    </div>
</div>  

 

posted @ 2020-05-12 18:17  yin_zhaozhao  阅读(140)  评论(0编辑  收藏  举报