css描边问题 如何写颜色的30%透明度? 求 相应css代码段

html-css078

css描边问题 如何写颜色的30%透明度? 求 相应css代码段,第1张

透明色可以是任意的颜色,就是一种颜色加的透明度。

CSS透明度的代码:

opacity:0.3

filter:alpha(opacity=30)

background:#000

这个的意思就是在黑色的基础上,透明度是百分五十。

根据你需要的颜色自己选择色值就行了。

了解 opacity 属性  不透明是100  要求30%  就是

opacity:0.3

       filter:alpha(opacity=30)

<html>

<head>

<title>css圆角效果--七度空间网页教学网</title>

<meta http-equiv="content-type" content="text/htmlcharset=gb2312">

<style type="text/css">

div.RoundedCorner{background: #9BD1FA}

b.rtop, b.rbottom{display:blockbackground: #FFF}

b.rtop b, b.rbottom b{display:blockheight: 1pxoverflow: hiddenbackground: #9BD1FA}

b.r1{margin: 0 5px}

b.r2{margin: 0 3px}

b.r3{margin: 0 2px}

b.rtop b.r4, b.rbottom b.r4{margin: 0 1pxheight: 2px}

</style>

</head>

<body>

<div class="RoundedCorner">

<b class="rtop"><b class="r1"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b></b>

<br>无图片实现圆角框<br><br>

<b class="rbottom"><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r1"></b></b>

</div>

</body>

</html>

可以看出fillText实心文字先绘制,strokeText空心文字后绘制,他们坐标一致,所以直接覆盖可实心文字,形成了像文字内部描边

通过text-shadow添加文字阴影可以形成对文字的外描边

注释:Internet Explorer 9 以及更早版本的浏览器不支持 text-shadow 属性。

可以看下这个文章,关于text-shadow

https://www.cnblogs.com/wuchuanlong/p/5985350.html