背景图片居中

来源:互联网 发布:垃圾回收算法 编辑:程序博客网 时间:2024/06/11 05:45
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>标题</title>
</head>
<body style=" background:url(psb.jpg) top center no-repeat #000">
</body>
</html>.bgcolor{background:url("images/image.jpg") no-repeat top #999;}top是给图片定位的 当然你也可以改成left、right或者bottom
背景图片和背景颜色是可以共存的。{background:#000 url(img/img.jpg) center top no-repeat;}


w3cbackground-image:url("images/image.jpg") no-repeat center center;background-color:#000;这样就行。第一是背景图片 不重复平铺  左右居中 上下居中 第二句背景色黑色

0 0
原创粉丝点击