HTML: 簡單的懸停效果

來源:互聯網
上載者:User

標籤:blog   http   color   os   io   for   ar   div   代碼   

1. [圖片] 捕獲.jpg    
?2. [代碼][CSS]代碼     
body {
    background: #000;
    overflow-y: scroll;
  }
  .items {
    margin: 40px auto;
    width: 1110px;
  }
  a {
    color: #FFF;
    cursor: pointer;
    margin: 0 0 20px 620px;
    text-align: center;
    text-decoration: none;
  }
  a:HOVER {
    color: red;
  }
  a:HOVER ~ div.items {
    border: 1px solid #FFF;
    background: url(‘http://farm5.staticflickr.com/4059/4710746077_03125f9331.jpg‘) no-repeat scroll center center transparent;
    height: 500px;
  }
  a:HOVER ~ div.items > *{
    display: none;
  }
  .item {
    border: 10px solid #FFF;
    cursor: pointer;
    float: left;
    height: 231px;
    width: 350px;
     
    -moz-transform: scale(0.8);
    -moz-transition: all 0.5s ease-in-out 0s;
  }
  .item > div {
    background: rgba(0,0,0,0.7);
    height: 100%;
    left: 0;
    position: absolute;
    top: 0;
    width: 100%;
     
    -moz-transition: all 0.5s ease-in-out 0s;
  }
  .item:HOVER {
    -moz-transform: scale(1);
  }
  .item-1:HOVER > div {
    height: 0%
  }
  .item-2:HOVER > div {
    height: 0%;
    top: 50%;
  }
  .item-3:HOVER > div {
    height: 0%;
    left: 50%;
    top: 50%;
    width: 0%;
  }
  .item-4:HOVER > div {
    height: 0%;
    left: 50%;
    top: 50%;
    width: 0%;
     
    -moz-transform: rotate(360deg);
  }
  .item-5:HOVER > div {
    height: 0%;
    left: 50%;
    top: 50%;
    width: 0%;
     
    -moz-transform: rotate(-360deg);
  }
  .item-6 > div {
    height: 50%;
    width: 50%;
  }
  .item-6 > div:NTH-CHILD(2) {
    left: 50%;
    top: 0;
  }
  .item-6 > div:NTH-CHILD(3) {
    left: 0;
    top: 50%;
  }
  .item-6 > div:NTH-CHILD(4) {
    left: 50%;
    top: 50%;
  }
  .item-6:HOVER > div {
    height: 0;
    width: 0;
    /*-moz-transform: rotate(-360deg);*/
  }
  .item-6:HOVER > div:NTH-CHILD(2) {
    left: 100%;
    /*-moz-transform: rotate(360deg);*/
  }
  .item-6:HOVER > div:NTH-CHILD(3) {
    top: 100%;
  }
  .item-6:HOVER > div:NTH-CHILD(4) {
    left: 100%;
    top: 100%;
    /*-moz-transform: rotate(360deg);*/
  }
  .clear:AFTER {
    clear: both;
    content: ‘\0020‘;
    display: block;
    height: 0;
    overflow: hidden;
    visibility: hidden;
    width: 0;
  }
  #preloader {
    background-image: url(‘http://farm5.staticflickr.com/4059/4710746077_03125f9331.jpg‘);
    height: 0;http://www.bizhizu.cn/shouhui/?
    width: 0;
  }
3. [代碼][HTML]代碼    
<body>手繪圖片
  <a class="clear">請不要點我。</a>
  <div class="items clear">
    <div class="item item-1">
      <div></div>
      <img src="350x231/1.jpg" />
    </div>
    <div class="item item-2">
      <div></div>
      <img src="350x231/2.jpg" />
    </div>
    <div class="item item-3">
      <div></div>
      <img src="350x231/3.jpg" />
    </div>
    <div class="item item-4">
      <div></div>
      <img src="350x231/4.jpg" />
    </div>
    <div class="item item-5">
      <div></div>
      <img src="350x231/5.jpg" />
    </div>
    <div class="item item-6">
      <div></div>
      <div></div>
      <div></div>
      <div></div>
      <img src="350x231/6.jpg" />
    </div>
  </div>
  <div id="preloader"></div>
</body>

HTML: 簡單的懸停效果

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.