Css background-image does not appear -
i having problem image appearing on background of schedules id section. when in firbug though appears image there! tried different images still having same problem. help
body, header,nav,h1 { margin:0; padding:0; border:none; outline:none; padding:none; } header{ width:100%; height:160px; background:#363436; border-radius:5px; -moz-border-radius:5px; -webkit-border-radius:5px; background-color:#333; } nav ul { text-align:center; list-style-type:none; } nav ul li { display: inline-block; padding:1.7em; } nav ul li a{ text-decoration:none; color: #fff; font-size:large; } nav ul li a:hover { color:#999; } #heading { text-decoration:none; color: #999; ; } #logo { float:left; margin-left:2%; margin-top: -10px; } #gallery { margin-left:5%; margin-top:20px; } #crossimages { float:left; } //this part not work image not load if background-image:url("imgs/hours.png"); #schedules{ float: left; margin-left:10%; background-image: url(file:///c|/wamp/www/web/crosscafe/imgs/hours.png); } span { font-weight:bold; }
as said before, , make sure, if you're using wamp need access webpage through localhost
or address provided purpose. accessing through file://
ignores of server-side usage wamp provides with.
that being said, think problem simple. if using framework file structure have following strcture:
- imgs/
- css/
- js/
- index.html
so, , since you're working on css in css
subfolder, url needs following:
background-image:url("../imgs/hours.png");
the 2 points (../
) tell browser go parent folder, imgs
folder , search hours.png
.
Comments
Post a Comment