gpt4 book ai didi

html - CSS中的虚线背景叠加效果

转载 作者:太空宇宙 更新时间:2023-11-03 19:38:43 25 4
gpt4 key购买 nike

我试图在这个网站上实现背景效果: http://mountaintheme.com/themeforest/mountain/home.html

背景图片似乎被点状覆盖物覆盖。

有没有办法只用 CSS 来创建这种效果?

最佳答案

有点晚了,但这是一个仅使用 CSS 的解决方案,它使用 radial-gradient 创建的模式来创建点覆盖。

.image {
width: 800px;
height: 600px;
position: relative;
background: url('https://upload.wikimedia.org/wikipedia/commons/6/6e/Rathong_from_Zemathang2.jpg');
background-size: cover;
}
.image:after {
content: '';
display: block;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
background: rgba(127, 127, 127, 0.5);
background-image: radial-gradient(black 33%, transparent 33%);
background-size: 2px 2px;
}
<div class="image"></div>

关于html - CSS中的虚线背景叠加效果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28652571/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com