Code in html Body:
Reply to discussion (solution)
I said the display is correct. . .
Try removing the comments
The css comment is
/* css comment syntax */
to: yingying901029
This code is just The background color is set, and the background image is set in another file.
After removing the comment or changing it to /* --- */, the background color displays normally, but I also wrote this in other files. Some background images can be displayed, and some cannot. This Why?
My background color is displayed here.
Follow the steps below to solve the problem:
2. The background color will not be displayed when there are pictures. Remove the color.
3. If the folder where your CSS is located is at the same level as the folder where the image is located; change the image path to background:url(../images/head_02.jpg) and refresh the test.
4. Check whether there is any interference from other CSS.
If you can’t find the problem anymore, create a new page and insert a background image to take a look.
I suggest that the poster take a look at all the involved files, so that you can’t see them one by one.
There is an images folder and Untitled-1.html, Untitled under the site. The files in -2.css, index.html and index.css, Untitled-1.html, Untitled-2.css are as follows:
@charset "utf-8";/* CSS Document */body{width:980px; margin:0 auto; font-family:"宋体";font-size:13px; line-height:18px;}a{text-decoration:none;}.aHover a:hover{color:#00A9B3;}.clear{clear:both;}.center{text-align:center;}img{border:0px;} ul{padding:0;}/*经典项目*/.best{background:url(images/best.jpg) no-repeat; width:262px; height:350px; padding-top:20px;}.best a{color:#626262;}.best ul{ height:20px; }.best ul li{float:left; width:130px; text-align:center;list-style:none; }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><link rel="stylesheet" type="text/css" href="Untitled-2.css"/></head><body><!--经典项目--> <div class="best"> <ul style="margin-top:70px;"> <li><a href="#">数字2C无缝丰胸</a></li> <li><a href="#">鼻部综合整形</a></li> </ul> <ul style="margin-top:52px;"> <li><a href="#">美肤OPT王者风范</a></li> <li><a href="#">除皱 3+全效除皱</a></li> </ul> <ul style="margin-top:50px;"> <li><a href="#"> 韩式改脸型</a></li> <li><a href="#">眼部综合整形</a></li> </ul> <ul style="margin-top:58px;"> <li><a href="#">360度环状立体吸脂</a></li> <li><a href="#">专利微创瘦小腿</a></li> </ul> </div><!--class="best"--></body></html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><link rel="stylesheet" type="text/css" href="index.css"/></head><body> <img src="images/head_01.jpg" /> <div class="banner"><img src="images/banner.jpg" /></div> <!--flash新闻--> <div class="flash"> <div class="flashHead"> </div><!--class="flashHead"--> <div class="flashCont"> <img src="images/flashNews_04.jpg" /> </div><!--class="flashCont"--> <div class="flashBottom"> </div> </div> <!--经典项目--> <div class="best"> <ul style="margin-top:70px;"> <li><a href="#">数字2C无缝丰胸</a></li> <li><a href="#">鼻部综合整形</a></li> </ul> <ul style="margin-top:52px;"> <li><a href="#">美肤OPT王者风范</a></li> <li><a href="#">除皱 3+全效除皱</a></li> </ul> <ul style="margin-top:50px;"> <li><a href="#"> 韩式改脸型</a></li> <li><a href="#">眼部综合整形</a></li> </ul> <ul style="margin-top:58px;"> <li><a href="#">360度环状立体吸脂</a></li> <li><a href="#">专利微创瘦小腿</a></li> </ul> </div><!--class="best"--></body></html>[code=CSS]@charset "utf-8";/* CSS Document */body{width:980px; margin:0 auto; font-family:"宋体";font-size:13px; line-height:18px;}a{text-decoration:none;}.aHover a:hover{color:#00A9B3;}.clear{clear:both;}.center{text-align:center;}img{border:0px;} ul{padding:0;}/*flash新闻*/.flash{width:275px; height:350px; float:left;}.flashHead{background:url(images/flashNews_01.jpg) no-repeat; height:4px;}.flashCont{background:url(images/flashNews_08.jpg) repeat-y; height:auto; padding:3px;}.flashBottom{background:url(images/flashNews_09.jpg) no-repeat; height:5px;}.flashCont img{width: 266px; height:340px;}/*经典项目*/.best{background:url(images/best.jpg) no-repeat; width:262px; height:350px; padding-top:20px;}.best a{color:#626262;}.best ul{ height:20px; }.best ul li{float:left; width:130px; text-align:center;list-style:none; }
<style>#footer{background-color:#17AEC9; height:3000px; text-align:center; width:980px; overflow:hidden;}#footer a{color:#FFDDDF; margin:auto 10px;}</style><div id="footer"> <a href="#">医院介绍</a>| <a href="#">医院环境</a>| <a href="#">美容设备</a>| <a href="#">文化活动</a>| <a href="#">新闻动态</a>| <a href="#">专家介绍</a>| <a href="#">整形博客</a>| <a href="#">联系我们</a> </div>
The code given behind is filtered, and the first two are not The problem is that the background images of the two latter ones are not displayed because there are other divs inside. There are also some problems with the arrangement. Could you experts please take a look at it.
I am also struggling with this issue~~