Home > Web Front-end > HTML Tutorial > Why doesn't my background image appear? Is there something wrong with my code? _html/css_WEB-ITnose

Why doesn't my background image appear? Is there something wrong with my code? _html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:57:36
Original
1865 people have browsed it









css code

@charset "utf-8";
/* CSS Document */
.nav li{ list-style-type:none ; front-size:12px;float:left; width:90px;height:35px;text-align:center;background:url(background gray.jpg); background-repeat:no-repeat;}
body { front -size:16px; line-height:20px; front-family:"official script","宋体",Arial;}
p{text-align:center;}
.nav.first { background-image: url(background.jpg);width:70px;front-size:14px;front-width:bold;color:#FFF;}


Reply to discussion ( Solution)

.nav.first { background-image:url(background.jpg);width:70px;front-size:14px;front-width:bold;color:#FFF;


There is less space between .nav and .first

.nav.first { background-image:url(background.jpg);width:70px;front-size: 14px;front-width:bold;color:#FFF;


There is less space between .nav and .first

Still not working...

.nav .first { background-image:url(background.jpg);width:70px;front-size:14px;front-width:bold;color:#FFF;}
There must be a problem with missing spaces. You can tell me the specific difference. Check it yourself.

If it still cannot be displayed, check it in the browser's developer tools, usually F12. Use this tool to check the CSS style of your .first li to see if it is an image path. Wrong? The size is wrong? It has been loaded but the display is incomplete.

LZ try first

.nav .first { background-image:url(background.jpg );width:70px;front-size:14px;front-width:bold;color:#FFF;}
There must be something wrong with the missing spaces. You can check the specific difference yourself.

If it still works It cannot be displayed. Check the developer tools of the browser, usually F12. Use this tool to check the CSS style of your .first li to see if the image path is wrong? The size is wrong? Or has it been loaded? But the display is incomplete.

LZ will try it first



Thank you
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template