關於CSS3的一些小知識

來源:互聯網
上載者:User
本文主要和大家聊聊關於CSS3的一些小知識,希望能協助到大家。下面跟隨小編一起來看一下吧。

  1. box-shadow向 p 元素添加陰影
    box-shadow: h-shadow v-shadow blur spread color inset;
    h-shadow:必需的。水平陰影的位置。允許負值
    v-shadow:必需的。垂直陰影的位置。允許負值
    blur:可選。模糊距離
    spread:可選。陰影的大小
    color可選。陰影的顏色。在CSS顏色值尋找顏色值的完整列表
    inset可選。從外層的陰影(開始時)改變陰影內側陰影
    2.transform:旋轉 p 元素
    相容性問題:
    -ms-transform:rotate(7deg); /* IE 9 */
    -moz-transform:rotate(7deg); /* Firefox */
    -webkit-transform:rotate(7deg); /* Safari 和 Chrome */
    -o-transform:rotate(7deg); /* Opera */
    3.transition:請把滑鼠指標移動到藍色的 p 元素上,就可以看到過渡效果。
    <<p>請把滑鼠指標移動到藍色的 p 元素上,就可以看到過渡效果。</p>

    !DOCTYPE html><html><head><style> p{width:100px;height:100px;background:blue;transition:width 2s;-moz-transition:width 2s; /* Firefox 4 */-webkit-transition:width 2s; /* Safari and Chrome */-o-transition:width 2s; /* Opera */}p:hover{width:300px;}</style></head><body><p></p>

    <p><b>注釋:</b>本例在 Internet Explorer 中無效。</p>

    </body>
    </html>

相關文章

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.