html - 如何在背景颜色上提供背景图像

标签 html css

我试图给背景图像而不是背景颜色,任何人都可以帮忙。 这是我的代码,

.next {
    width: 40px;
	height: 45px;
	border-radius: 100%;
        border: 1px solid #000;
	background-image: url(http://placehold.it/10x10);
        background-color: #fff;
}
<div class="next"></div>

最佳答案

这就是你想要的,试试这个

.next {
	width: 40px;
	height: 45px;
	border-radius: 100%;
	background: #fee8fe url(http://placehold.it/10x10) no-repeat center;
}
<div class="next"></div>

关于html - 如何在背景颜色上提供背景图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44111772/

相关文章:

css - 如何重置填充以便正确显示列表填充?

HTML 表格 - 不显示边框

php - Recaptcha V2.0 始终返回 bool(false)

html - 悬停时菜单如何保持静止?

jQuery 向上/向下滑动 : not effect content below it?

html - PrimeFaces:布局完整页面设置为“false”导致页脚消失

html - Bootstrap 4 图像缩略图类

html - 如何使图像在多个部分之间连续,中间有中断?

javascript - 创建 div 元素后在其下方保留一个单击按钮

javascript - 使 div 位置的子项固定在滚动时 div 的顶部,并设置子项的动画高度