【发布时间】:2020-03-14 16:35:44
【问题描述】:
所以我圈出了 div(带有border-radius),每个都用一条线连接。问题是它们是半透明的,它们是从 div 的中心连接起来的,所以你可以看到一条穿过 div 的线。我可以使 div 不透明,但我不想显示背景。那么,有没有办法隐藏 div 后面的特定元素,但显示页面的背景?即使它使用的是 js/jquery。
这是我的模拟情况(在我的代码行中自动生成):
https://jsfiddle.net/muud6rqf/2/
body{
background: url(http://www.intrawallpaper.com/static/images/abstract-mosaic-background.png) no-repeat center center fixed;
background-size: cover;
}
.circle{
border: 2px solid red;
width: 36px;
height: 36px;
border-radius: 100%;
position: absolute;
box-shadow: 0 0 8px 2px rgba(255,0,0,0.6), inset 0 0 8px 2px rgba(255,0,0,0.6);
}
.simulated-line{
position: absolute;
width: 181px;
height: 4px;
background: green;
top: 64px;
left: 118px;
transform-origin: 0% 50%;
transform: rotate(25deg);
}
<div class="circle" style="left: 100px; top: 46px"></div>
<div class="circle" style="left: 260px; top: 121px"></div>
<div class="simulated-line"></div>
编辑:这就是它的样子:
这就是我想要的:
【问题讨论】:
-
你能发布你的代码示例吗?
-
您需要发布您的代码...在 sn-p 之前投反对票
-
为什么不使用带有 css 圆圈的 div,而只使用 circle.png 作为该 div 的背景?
-
好的,我会编辑对不起没有代码,但请不要投票他们会删除帖子:(
-
嘿!你最近发布的小提琴很有趣。我建议您编辑您的问题以使其更准确。分段吧!解决问题......从概念的角度来看,您尝试做的事情看起来有点复杂。你想让我做什么 ?我赞成反对下跌;)
标签: javascript jquery html css