用sublime或者DW 写CSS时插入怎么插入背景图片啊,我按照属性的地址添加进去后依然咋就网页中显示不出来
.top{
width: 100%;height: 27px;background:url(E:\buju\images\top_bg.jpg)0 0 repeat-x;
}
.top{
width: 100%;height: 27px;background:url(E:\buju\images\top_bg.jpg)0 0 repeat-x;
}
2015-12-09
<!DOCTYPE HTML> <html> <head> <title>企业网站</title> <meta http-equiv="Content-Type" Content="text" charset="utf-8"> <style> *{ margin: 0;padding: 0;font-size: 12px; } body{ background: #f5f5f5 } .top{ width: 100%;height: 27px;background:url(http://img1.sycdn.imooc.com//user/5458506b0001de5502200220-40-40.jpg) 0 0 repeat-x; } </style> </head> <body> <div class="top"> <div class="top_content"> <ul> <li>设为首页</li> <li>设为收藏</li> <li>联系我们</li> <!--你这里少一个结束的ul---> </ul> </div> </div> <!-- top结束 --> </body> </html>
没有问题的,如果还是不显示就是你的图片路径的问题
<!DOCTYPE HTML>
<html>
<head>
<title>企业网站</title>
<meta http-equiv="Content-Type" Content="text" charset="utf-8">
<link rel="stylesheet" type="text/css" href="css/mu.css">
</head>
<body>
<div class="top">
<div class="top_content">
<ul>
<li>设为首页</li>
<li>设为收藏</li>
<li>联系我们</li>
</div>
</div> <!-- top结束 -->
</body>
</html>
*{
margin: 0;padding: 0;font-size: 12px;
}
body{
background: #f5f5f5
}
.top{
width: 100%;height: 27px;background:url(E:\buju\images\top_bg.jpg)0 0 repeat-x;
}
举报