Mudsaf Posted February 6, 2012 Share Posted February 6, 2012 Somehow i cannot display background-image on my div id. So i have this Div <div id="top_left"></div> and this css #top_left {background-image:url(img/bottom.jpg);background:no-repeat;background:top;background:left;width:25px;height:25px; somehow it doesn't show the background image? Any help please. My paths style.css (ROOT)index.html (ROOT)images (ROOT/img/) Link to comment Share on other sites More sharing options...
Ingolme Posted February 6, 2012 Share Posted February 6, 2012 Your background declarations are overwriting all your other background declarations. "background" is a property that writes all the different properties at once. If you had used another background declaration previously it will be overwritten by default values and the values you give it. Either write all the properties at once, or use separate properties. background-image: url(img/bottom-jpg);background-repeat: no-repeat;background-position: top left; Link to comment Share on other sites More sharing options...
Mudsaf Posted February 6, 2012 Author Share Posted February 6, 2012 Do you mean like this? #top_left {background-image:url(img/top_left_corner.jpg)background:no-repeatbackground:topbackground:leftwidth:25pxheight:25px;} If yes, still didin't work. Could you fix it for me. Either does this one above. #top_left {background-image:url(img/top_left_corner.jpg);background:no-repeat;background-position: top left;width:25px;height:25px;} Link to comment Share on other sites More sharing options...
Mudsaf Posted February 6, 2012 Author Share Posted February 6, 2012 Im trying to make website layout i got these images left top corner, top, right top corner, left, right, left bottom corner, bottom, right bottom corner. In the middle there should be background with black colour and text would go there. Link to comment Share on other sites More sharing options...
thescientist Posted February 7, 2012 Share Posted February 7, 2012 re-read his post carefully.... Your background declarations are overwriting all your other background declarations. "background" is a property that writes all the different properties at once. If you had used another background declaration previously it will be overwritten by default values and the values you give it. Either write all the properties at once, or use separate properties. background-image: url(img/bottom-jpg);background-repeat: no-repeat;background-position: top left; if you don't want to include all the background properties and values in one line, then you will need to list them out separately like in Ingolme's example. Otherwise you would have to do something like:background: url('image/path.jpg') no-repeat top left; this is known as shorthand just look in the tutorialshttp://www.w3schools..._background.asp Link to comment Share on other sites More sharing options...
dsonesuk Posted February 7, 2012 Share Posted February 7, 2012 Already done this once, can't remember seeing exceeded bandwidth, or last down-age problem, loss of postings, with old website http://w3schools.invisionzone.com/index.php?showtopic=32568 Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.