background: #000000; opacity:0.5; 改写成下面的方式: background: rgba(0,0,0,0.5); background: '#00000080'; 颜色透明度可直接在颜色内定义好。