mike12255 Posted June 14, 2011 Share Posted June 14, 2011 Hello, im trying to set background images using a css file but I just cant get them to show up and I have no idea why. The paths are correct ive checked that, any help is appriciated. here is my CSS: @CHARSET "UTF-8"; * * { margin:0; padding:0; background-color:black; } #box { margin-left:auto; margin-right:auto; width: 992px; margin-top:none; } #header { height: 222px; background-image:url('..images/header.jpg'); z-index: 5; } #menu { background-image:url('..images/menu_bar.png'); height:100px; position: absolute; left: 0px; top: 190px; z-index: 10; } and here is the html: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert title here</title> <link rel = "stylesheet" type="text/css" href=" styles/main_style.css" > </head> <body> <div id = "box"> <div id ="header"><img src="images/header.jpg"/></div> <div id="menu"> <ul> <li>test</li> </ul> </div> </div> </body> </html> Link to comment https://forums.phpfreaks.com/topic/239345-why-wont-my-background-images-show-up/ Share on other sites More sharing options...
cssfreakie Posted June 14, 2011 Share Posted June 14, 2011 you made a small error: this: background-image:url('..images/menu_bar.png'); should be background-image:url('../images/menu_bar.png'); Link to comment https://forums.phpfreaks.com/topic/239345-why-wont-my-background-images-show-up/#findComment-1229546 Share on other sites More sharing options...
mike12255 Posted June 14, 2011 Author Share Posted June 14, 2011 of course i always make stupid mistakes when its been a while since ive codded, thanks. Link to comment https://forums.phpfreaks.com/topic/239345-why-wont-my-background-images-show-up/#findComment-1229549 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.