我曾尝试给我的三角形添加阴影,但它不会工作,这太恼人了! 继承人我的代码:我怎样才能给这个三角形添加一个阴影
function section_about() {
$(".about").css("display", "inline-block");
$(".about").animate({opacity:"1"}, {duration: 1000, queue: false});
window.location.hash = "/About Us/";
}
function triangle_sizer() {
$(".triangle-up").css("border-left-width", jQuery(window).width()/2);
$(".triangle-up").css("border-right-width", jQuery(window).width()/2);
$(".triangle-up").css("top", jQuery(window).height()-125);
$(".triangle-down").css("border-left-width", jQuery(window).width()/2);
$(".triangle-down").css("border-right-width", jQuery(window).width()/2);
$(".triangle-down").css("top", jQuery(window).height()-125);
}
triangle_sizer();
jQuery(window).resize(function() {
triangle_sizer();
});
##style.css##
.triangle-down {
width: 0;
height: 0;
border-style: solid;
border-width: 100px 200px 0 100px;
border-color: rgba(39, 39, 39, 1) transparent transparent transparent;
box-shadow: 0 16px 10px -17px rgba(0, 0, 0, 0.5);
}
.triangle-down:after {
content: "";
position: absolute;
width: 0;
height: 0;
background: rgba(39, 39, 39, 1);
-webkit-transform: rotate(45deg);
box-shadow: -1px -1px 10px -2px rgba(0, 0, 0, 0.5);
}
.par {
position: absolute;
top: 200%;
width: 100%;
height: 0%;
}
/* Arrows */
.arrows {
width: 220px;
height: 144px;
position: absolute;
left: 50%;
top: 70%;
margin-left: -76.5px;
}
.arrows path {
stroke: white;
fill: transparent;
stroke-width: 1px;
}
/* Arrows */
.arrows-down {
width: 220px;
height: 144px;
position: absolute;
left: 50%;
top: 70%;
margin-left: -78.5px;
}
.arrows-down path {
stroke: white;
fill: transparent;
stroke-width: 1px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="par">
<div class="triangle-down">
<svg class="arrows-down" viewbox="0 0 102 102">
<path class="a1" d="M0 20 L30 52 L60 20"></path>
</svg>
</div>
</div>
我一直在寻找了很长时间的解决方案,并不能找到一个。这是当该代码是跑会发生什么: https://gyazo.com/c890a79c547f5624c97abacc66104fc1 https://jsfiddle.net/Lec8862y/2/
你确定你包括所有相关的CSS?在我的浏览器中,这看起来像这样:[image](https://i.gyazo.com/880048091bf26ec3c1fc8e10af8f9082.png)。小提琴玩弄:https://jsfiddle.net/Lec8862y/ – JohannesB
噢,我忘了一下 – xen
https://jsfiddle.net/Lec8862y/2/ – xen