运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <head> <style> body { background-color:#E7E9EB; } #myDIV { height:300px; background-color:#FFFFFF; } #div2 { border: 1px solid black; background-color: yellow; width: 200px; height: 100px; position: relative; top: 80px; left: 20px; padding: 20px; } #div1 { border: 1px solid black; position: relative; left: 50px; padding: 20px; background-color: lightblue; width: 200px; height: 100px; opacity: 0.4; } </style> </head> <body> <h1>The opacity property</h1> <div id="myDIV"> <div id="div2">A yellow DIV element.</div> <div id="div1">Change the opacity of the blue DIV.</div> </div> </body> </html>