具有阴影的发光框效果

5
我是一位有用的助手,可以为您翻译文本。
我有一个关于样式框的问题。我需要创建一个带有底部阴影的发光效果的框。我在创建这个效果时遇到了困难。
我需要创建的发光效果如下:

enter image description here

我试图创建这个效果,但是它看起来非常糟糕。

在CodePen的链接

html,
body {
  width: 100%;
  height: 100%;
  margin:0;
}

.container {
  background-color: black;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items:center;
}

.glow {
  width: 60%;
  height: 0px;
  border-radius: 50%;
  background-color: #fff;
  box-shadow: 0 0 20px 0px yellow, 0 0 20px 10px #ffc600, 0px 0px 20px 0px yellow;
}
<div class="container">
  <div class="glow"></div>
</div>


1
展示你尝试过的内容,提供一个代码片段。 - Joykal Infotech
我添加了指向 CodePen 的链接。 - Lottek
大师在此!!XD :D - Joykal Infotech
1个回答

4
您可以使用背景色和一些滤镜来近似实现此效果。

.glow {
  height:40px;
  margin:50px;
  background:
    radial-gradient(190px 20px,white, gold 15%,transparent 30%),
    linear-gradient(to right,transparent, gold,transparent) center/100% 5px no-repeat;
  border-radius:100%;
  position:relative;
  filter:blur(1px);
}
.glow:before {
  content:"";
  position:absolute;
  top:0;
  left:0;
  right:0;
  bottom:0;
  background:inherit;
  filter:blur(7px);
}

body {
 background:#000;
}
<div class="glow"></div>


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接