1. 程式人生 > >CSS cursor 和 opacity 屬性

CSS cursor 和 opacity 屬性

mov 屬性 級別 element poi oss ogr ont 舉例

cursor :一些不同的光標,當設置該屬性之後,鼠標指上去會隨著屬性而改變。

舉例:

<span style="cursor:crosshair">十字線</span><br>
<span style="cursor:default">默認的</span><br>
<span style="cursor:help">幫助</span><br>
<span style="cursor:move">指示某對象可被移動</span><br>
<span style
="cursor:n-resize">出現左右箭頭</span><br> <span style="cursor:pointer">一只手</span><br> <span style="cursor:progress">正在加載</span><br> <span style="cursor:text">文本</span><br>

opacity:用於設置元素的透明度,元素的不透明度級別描述了透明度級別,當不透明度為 1 時表示完全不透明,當不透明度為 0.5 時表示半透明,當不透明度為 0 時表示完全透明。

opacity: value|inherit;

value取值說明:不透明度,從 0.0 (完全透明)到 1.0(完全不透明)。

inherit取值說明opacity屬性的值應該從父元素繼承。

為了兼容IE8 以及更早的版本支持替代的 filter 屬性。可以這樣設置:filter:Alpha(opacity=50)。

<div>This element‘s opacity is 0.5! Note that both the text and the background-color are affected by the opacity level!</div>
/** *css設置透明度 */ <style> div { background-color:red; opacity:0.5; filter:Alpha(opacity=50); } </style>

CSS cursor 和 opacity 屬性