能否在 background-image
上添加 border-radius
?
是的,这是可能的:
div {
-webkit-border-radius: 50px;
-moz-border-radius: 50px;
border-radius: 50px;
border: none;
width: 500px;
height: 335px;
background: url(http://themescompany.com/wp-content/uploads/2012/02/6402.jpg);
}
background-position: 50px background-repeat: no-repeat
,背景图像仅会被 div 的边框裁剪。 - Michał Urbanbackground-size: cover;
,则图像的显示会出现问题。 - Andrew Brownbackground-size: cover
或类似的方式来完成。 - lubosdz试试这个
div {
border: 10px solid white;
-moz-border-radius: 10px;
background:url(map_background_box_right.png);
}
body
、一个随机的div
或者甚至是一个pre
元素的背景?请更具体一些。 - Jelmer