CSS cursor 和 opacity 属性

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>

 

posted @ 2017-06-27 10:16  切切歆语  阅读(537)  评论(0编辑  收藏  举报