请问如何给main.css添加一句代码自定义网页有背景图片?

以下是main.css中的开头,网页文件是PHP的。用的是emlog,高手来帮帮忙吧,你们最厉害了!
body { background: #ececec; color: #323232; text-align: center; font-size:14px; font-family: "微软雅黑", Arial, Helvetica, sans-serif; margin: 10px auto 10px; padding: 0; }
#wrap { background: #fff; width: 1090px; text-align: left; margin: 0 auto 0; border-radius: 10px; }
img { border: none; }
a:hover { color: #007BF7; text-decoration: underline; }
a:link, a:active, a:visited { color: #886353; text-decoration: none; }
a:hover { color: #06C; text-decoration: underline; }
* { margin: 0; padding: 0; border: 0; }
/*头部*/
#header { height: 120px; margin: 0 auto; padding: 0 30px; }
#header h1 a:link, #header h1 a:active, #header h1 a:visited { color: #1F1F1F; text-decoration: none; }
#header h1 a:hover { color: #06C; text-decoration: none; }
#headersite { width: 300px; float: left; height: 60px; margin-top: 30px; }
#headersite h1 { font-size: 30px; height: 30px; line-height: 30px; font-weight: 500; }
#headersite p { line-height: 14px; font-weight: normal; margin-top: 10px; }
#headerlogo { width: 300px; float: left; margin-top: 20px; }
#headersearch { float: right; background: #fefefe; margin-top: 35px; padding: 10px; }
#headersearch #edtSearch { background: url("images/search.png") no-repeat scroll 5px 5px transparent; border: 1px solid #ccc; border-radius: 3px; line-height: 1.2em; padding: 7px 10px 7px 28px; }
#headersearch #btnPost { background: #666; border: none; width: 50px; height: 26px; line-height: 26px; font-weight: bold; color: #FFFFFF; }

body 中 background: #ececec; ,改成 background:url(背景图片路径);这样就可以在页面中插入背景。其他地方添加背景也是采用这样的做法。追问

你好,背景图片路径应该怎么写,我是新手哈

追答

你将图片存在哪个文件夹下,就调用那个文件。例如文件名为bj.jpg,存放在网站根目录下images文件夹下,那么调用的路径就是url(你的网址/images/bj.jpg)

温馨提示:答案为网友推荐,仅供参考
相似回答