[英]How to remove the border box-shadow provides?
So I have this 'floating-card' which has a box-shadow around it. 所以我有这张“浮动卡”,上面有一个盒子阴影。 On one side I want to put a colored border.
一方面,我想放置一个彩色边框。 But the box-shadow gives an extra white border.
但是盒子阴影给人额外的白色边框。 I want this removed but I dont know how.
我要删除此内容,但我不知道如何。 I want to keep the box-shadow.
我想保留盒子阴影。 I tried several things including the answer of this question.
我尝试了几件事,包括这个问题的答案。
CSS Box-Shadow adds arbitrary white border to Div CSS Box-Shadow为Div添加任意白色边框
To show specifically what I want removed: 具体显示我要删除的内容:
The little small white border on the left of the blue. 蓝色左侧的白色小边框。
Here is a JSFiddle and the code: 这是一个JSFiddle和代码:
https://jsfiddle.net/pg5omtqq/ https://jsfiddle.net/pg5omtqq/
.floating-card { background-color: white; border-left: 5px solid blue; box-shadow: 0px 0px 10px grey; margin: 1.0em; padding-top: 5px; padding-bottom: 10px; padding-left: 25px; padding-right: 25px; }
<div class="floating-card"> <h3 class="tile_title">Title</h3> </div>
EDIT : To be clear, I want to keep the box-shadow. 编辑 :明确地说,我想保留盒子阴影。 But have the small white border removed.
但是,删除白色的小边框。
添加到您的CSS
box-shadow: none;
This will remove the shadow on the left 这将消除左侧的阴影
-webkit-box-shadow: 10px 2px 15px 0px rgba(0,0,0,0.75);
-moz-box-shadow: 10px 2px 15px 0px rgba(0,0,0,0.75);
box-shadow: 10px 2px 15px 0px rgba(0,0,0,0.75);
You can adjust this by using this generator box shadow. 您可以使用此生成器框阴影对其进行调整。 source: https://www.cssmatic.com/box-shadow
来源: https : //www.cssmatic.com/box-shadow
remove left box-shadow by using below css. 使用下面的css删除左盒阴影。
.floating-card{ background-color: white; border-left: 5px solid blue; -webkit-box-shadow: 0px 0px 10px 0px grey; -moz-box-shadow: 0px 0px 10px 0px grey; box-shadow: 0px 0px 10px 0px grey; margin: 1.0em; padding-top: 5px; padding-bottom: 10px; padding-left: 25px; padding-right: 25px; }
<div class="floating-card"> <h3 class="tile_title">Title</h3> </div>
-webkit-box-shadow: 2px 1px 10px grey;
-moz-box-shadow: 2px 1px 10px grey;
box-shadow: 2px 1px 10px grey;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.