如何在背景颜色上给出背景图像

时间:2017-05-22 11:30:43

标签: 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>
&#13;
&#13;
&#13;

2 个答案:

答案 0 :(得分:3)

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

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

答案 1 :(得分:2)

您可以使用background代替background-image&amp; background-color。检查更新的代码段

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