W3School TIY
编辑您的代码:
<!DOCTYPE html> <html> <head> <style> div.background { width: 400px; height: 266px; margin:15px; background: url('/i/tulip_peach_blossom_w.jpg') no-repeat; border: 1px solid black; } div.transbox { width: 338px; height: 204px; margin:30px; padding:0; background-color: #ffffff; border: 1px solid black; /* for IE */ filter:alpha(opacity=60); /* CSS3 standard */ opacity:0.6; } div.transbox p { margin: 30px 40px; color: #000000; font:bold 12px Verdana, Geneva, sans-serif; line-height:1.5; } </style> </head> <body> <div class="background"> <div class="transbox"> <p> This is some text that is placed in the transparent box. This is some text that is placed in the transparent box. This is some text that is placed in the transparent box. This is some text that is placed in the transparent box. This is some text that is placed in the transparent box. </p> </div> </div> </body> </html>
查看结果: