【问题标题】:How to make a glass effect?如何制作玻璃效果?
【发布时间】:2017-05-07 20:21:22
【问题描述】:

我正在尝试做这样的事情。 (http://prnt.sc/f58ksy) 但我不知道如何制作这种玻璃效果,我试图改变不透明度但没有奏效。我的代码:

        .Head {
   position: absolute;
   top:200px;
   margin-left: 20%;
   color:white;
   background-color: #2acec3;
   margin-left: 8%;
   font-size: 400%;
   font-family: Calibri,Candara,Segoe,Segoe UI,Optima,Arial,sans-serif;
   opacity: 0.7;
   display: block;
}

.ParaPlanes {
   position: absolute;
   top:220px;
   margin-left: 20%;
   color:white;
   background-color: #2acec3;
   margin-left: 8%;
   font-size: 400%;
   font-family: Calibri,Candara,Segoe,Segoe UI,Optima,Arial,sans-serif;
   opacity: 0.7;
   display: block;
}

我的结果:http://prntscr.com/f58njn

谢谢! :-)

【问题讨论】:

    标签: css styles


    【解决方案1】:

    opacity 属性也改变了它的子元素的透明度... 试试 -

    background-color:rgba(red, green, blue, opacity ( decimal b/w 0 to 1))
    

    示例 -

    #justadiv {
         background-color : rgba(24, 180, 140, 0.5);
    }
    

    RGB 值必须大于 0 且小于 255。 谢谢!

    【讨论】:

    • 感谢您的支持。我试过你的想法,它看起来像这样:prntscr.com/f58r8a
    • @MadCatz... 您需要完全删除 opacity 属性。
    • 你需要一个图片背景才能看到它的工作......纯色背景只会改变它的颜色。您能否更新帖子的更改?谢谢
    • 谢谢我的朋友! :-)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-01
    • 1970-01-01
    • 1970-01-01
    • 2015-11-06
    • 2014-05-02
    相关资源
    最近更新 更多