gpt4 book ai didi

html - 如何用中间的文字和图像作为圆圈的背景绘制圆圈?

转载 作者:行者123 更新时间:2023-11-28 03:32:31 25 4
gpt4 key购买 nike

我想知道如何画一个中间有文字、背景为图片的圆圈?

这张图片应该是圆圈的背景

我试过放图片,但没有得到完整的背景图片,只能得到一部分图片作为背景。

#circle {
width: 200px;
height: 200px;
border-radius: 50%;
font-size: 50px;
color: #2098D1;
line-height: 200px;
text-align: center;
background-image: url("http://7bna.net/images/background-wallpapers/background-wallpapers-9.jpg");
}
<div id="circle"> Hello </div>

www.intrawallpaper.com/static/images/abstract-mosaic-background.png

最佳答案

#circle {
width: 200px;
height: 200px;
border-radius: 50%;
font-size: 50px;
color: #2098D1;
line-height: 200px;
text-align: center;
background-image: url("http://intrawallpaper.com/static/images/abstract-mosaic-background.png");
background-size: 150% 150%;
background-repeat: no-repeat;
background-position: 97% 75%;
}
<div id="circle"> Hello </div>

可以使用background-position调整背景显示区域。

了解更多 here .

或者,您可以将 background-size: containbackground-position: center 结合使用。

关于html - 如何用中间的文字和图像作为圆圈的背景绘制圆圈?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44657832/

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