div 背景透明,字体不透明
.demo{ background:transparent;<!--背景透明--> color:#fff;<!--字体颜色--> background-color:rgba(255,255,255,0.15)<!--最后一个参数设置透明度,前面三个是RGB颜色值--> }
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style type="text/css"> .aa{ width: 400px; height: 200px; background-image: url(../../img/360/5yuq4ivk.bmp); background-size: 100% 100%; } .demo{ width: 200px; height: 100px; color: yellow; /*background:transparent;*/ background-color:rgba(144, 238 ,144, 0.6); } </style> </head> <body> <div class="aa"> <div class="demo"> 大家辛苦了! </div> </div> </body> </html>