<分区>
Possible Duplicate:
background-size in shorthand background property (CSS3)
<!DOCTYPE html>
<meta charset="utf-8">
<title>An HTML5 Document</title>
<style>
div {
width: 500px;
height: 400px;
background: red url(https://www.google.com/images/logos/google_logo_41.png) 50% 50% cover no-repeat;
}
</style>
<div></div>
我想定义一个值为 cover
的 CSS background-size
属性。但我不倾向于编写单个 background-size
属性。我想将它组合到 background
属性中。但是背景不显示。
如何将 CSS background-size
值 cover
添加到 background
属性的值?
谢谢。