Alexxosipov Asked:2020-04-02 23:51:37 +0000 UTC2020-04-02 23:51:37 +0000 UTC 2020-04-02 23:51:37 +0000 UTC 如何使用 css 使相对于另一个元素的透明度? 772 大家好。有这个块: 蓝线是这样实现的: .first-page .frame { width: 80%; border: 10px solid rgb(19,74,136); position: absolute; top: 35px; height: 175px; left: 70px; z-index: -1; } 我用 制作了蓝线上方的文本z-index,但它看起来像这样: 怎样才能让文字下面没有蓝线,但是有图片呢?background-color: transparent对文本不起作用(也不应该) css 1 个回答 Voted Best Answer programmer403 2020-04-03T00:14:38Z2020-04-03T00:14:38Z 它不适用于透明度,但我认为有可能像这样 #ramka { width: 80%; border: 10px solid rgb(19,74,136); border-left:0; position: absolute; top: 35px; height: 175px; left: 70px; z-index: -1; } #ramka::before { content: ""; border-left:10px solid rgb(19,74,136); height:20px; position:absolute; left:0; top:0; } #ramka::after { content: ""; border-left:10px solid rgb(19,74,136); height:20px; position: absolute; bottom:0; left:0; } <div id="ramka"> </div>
它不适用于透明度,但我认为有可能像这样