我正在查看上面有图像的页面。我看到在css中,图像设置为背景,但是图像不在页面顶部。所以我的基本问题是试图理解下面的CSS
#p_background {
background:url(/Content/images/test.gif) no-repeat center 108px;
}
特别是中心和108px代表什么?
最佳答案
它是以下形式的缩写:
#p_background {
background-image:url(/Content/images/test.gif);
background-repeat: no-repeat;
background-position: center 108px;
}
请参见http://www.w3schools.com/css/css_background.asp和http://www.w3schools.com/cssref/pr_background-position.asp