html background-color如何设置为透明?

如题所述

    html background-color设置为透明的方法如下:

<html>
<head>
<title>透明表格</title>
</head>
<body background="图片">
<table border="0">
<tr>
<td style="background-color:#336699;filter:Alpha(opacity=50)">表格内容</td>
</tr>
</table>
</body>
</html>

    background是用于在一个声明中设置所有背景属性的一个简写属性。

    背景 (background) 属性定义元素的背景效果

    元素的背景区包括前景之下直到边框边界的所有空间。因此,内容框与内边距都是元素背景的一部分,且边框画在背景上。

    CSS 允许应用纯色作为背景,也允许使用背景图像创建相当复杂的效果;CSS 在这方面的能力远远在 HTML 之上。

    background 是用于在一个声明中设置所有背景属性的一个简写属性。

    格式: background: {属性值}

    继承性: NO

    可能的值:

    background-color

    background-image

    background-repeat

    background-attachment

    background-position

温馨提示:答案为网友推荐,仅供参考
第1个回答  2017-12-27

html background-color设置为透明:

filter:alpha(opacity=50);-moz-opacity:0.5;-khtml-opacity: 0.5;opacity: 0.5;