html - 我如何使用CSS来制作这个?

标签 html css colors ellipse

enter image description here

我怀疑使用线渐变?我知道怎么做椭圆,但我就是不明白如何让红线穿过中间?

最佳答案

我会做这样的事情: DEMO FIDDLE

CSS:

#container {
    position: relative;
    width: 200px;
    background-color:black;
    z-index:-2;
    padding: 10px 0;
    text-align:center;
}
#line {
    position: absolute;
    top: 50%;
    width: 80%;
    left:10%;
    height: 1px;
    box-shadow: 1px 1px 20px 5px red;
    z-index:-1;
    background-color: red;
}

#text{
    color:white;
    font-weight:bold;
    text-transform:uppercase;
letter-spacing:8px;
    text-shadow: 1px 1px 1px #ccc
}

HTML:

<div id="container">
    <div id="text">Text</div>
    <div id="line"></div>
</div>

关于html - 我如何使用CSS来制作这个?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30857193/

相关文章:

html - 如何在IE6中获得阴影效果

linux - 在 Linux 上使用 8 位颜色正确显示 Qt Gui。对话框中的点

HTML5 日期输入类型干扰 jQuery Datepicker

html - 信息在源文件 View 中不可见

jquery - 将 Masonry 与其他 jQuery 效果相结合

html - 对话框组件中的primefaces日历问题

html - 在 Chrome 上打开 Devtools 使整个页面旅行

html - Firebase Cookie 限制

python - 使用 python 模块 image 去除图像中的红色的函数

java - 在 Eclipse 中更改文本颜色