This topic created in 5571 days ago, the information mentioned may be changed or developed.
比如
div id=1
div id=2
/div
/div
这样的结构,对div1设置css透明,div2也变成透明的了,即使单独设置opacity值为1也没用,网上找了几个方法,都很麻烦。
我现在想实现的效果是透明边框(div1块包裹div2),内容区域(即div2块)为不透明背景,大家有什么好的方法吗?
3 replies • 1970-01-01 08:00:00 +08:00
 |
|
1
sparanoid Feb 8, 2011
不是复杂的边框的话可以在 border 或 box-shadow 上用 rgba
|
 |
|
2
kayue Feb 8, 2011
<div id="container"> <div id="content" /> <div id="background" /> </div>
<style> #container { position: relative; width: 100px; height: 100px; } #background { position: absolute; top:0; left: 0; background: green; } #content { margin: 10px; width: 90px; height:90px; background: red; } </style>
|