想要的效果是:div的background是url(img)且图片透明,且撑满全屏,无论窗口大小
div内有个表格且文字不透明
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<link href="./style/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
body {
margin: 0;
overflow: auto;
}
#demo {
background: url(img/backpic.png);
background-color: rgba(0,0,0,0.1);
}
li {
font-size: 20px;
font-family: Arial;
text-decoration: none;
}
.ul {
margin: 0;
padding: 0;
padding-left: 17px;
}
a {
text-decoration: none;
font-family: Tahoma, Arial;
font-size: 15px;
color: Blue;
}
td {
vertical-align: text-top;
line-height: 18px;
}
table {
margin: auto;
width: 70%;
}
a:hover {
color: red;
}
</style>
</head>
<body>
<div id="demo">
<table>
<tr>
<td>
<br />
<br />
<br />
<b>System</b>
<ul class="ul">
<li><a href="./MRTS.html" target="_blank">MRTS</a></li>
</ul>
<br />
</td>
</tr>
</table>
</div>
</body>
</html>
你要兼容哪种浏览器先?如果是ie8-也要兼容文字和透明层分开到不同容器,不能共用一个容器
其他浏览器可以用rgba颜色
background-color:rgba(0,0,0,0.5);