zoukankan      html  css  js  c++  java
  • css中transition的使用以及:before:after的使用(小样式)

    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8">
        <title>css小样式</title>
    </head>
    <style type="text/css">
    body{
      margin: 0px;
      padding:0px;
      background:pink;
    }
    .mo-tab-default{
      display: block;
       33.333%;
      height: 30px;
      line-height: 30px;
      text-align: center;
      position: relative;
      cursor:context-menu;
      float: left;
      overflow: hidden;
    }
    .mo-tab-default:before{
      position: absolute;
      content: "";
      background:steelblue;
      left: -100%;
      bottom: 0px;  
      height: 1px;
       50%;
      transition: all 0.5s ease-out;
      -webkit-transition: all 0.5s ease-out;  
    }
    .mo-tab-default:after{说
      position: absolute;
      content: "";
      background:steelblue;
      right: -100%;
      bottom: 0px;  
      height: 1px;
       50%;
      transition: all 0.5s ease-out;
      -webkit-transition: all 0.5s ease-out;  
    }
    .mo-tab-default:hover::before{
      left: 0;
    }
    .mo-tab-default:hover::after{
      right: 0;
    }
    </style>
    <body>
    <a class="mo-tab-default">11</a>
    <a class="mo-tab-default">22</a>
    <a class="mo-tab-default">33</a>
    </body>
    </html>
    

      

  • 相关阅读:
    [Leetcode]@python 76. Minimum Window Substring
    [Leetcode]@python 75. Sort Colors
    HTNL表单
    第二天
    开学心德
    HTML表单
    网页制作
    2nd day
    开课心得
    CF10D/POJ2127 LCIS 题解
  • 原文地址:https://www.cnblogs.com/TTTK/p/6113438.html
Copyright © 2011-2022 走看看