quelle Posted August 16, 2012 Share Posted August 16, 2012 I have <img> element called right after <body> one. The image element includes following id with attributes and serves as a background of whole page(body) with possibility of resizing(thats the function of this part of code): #img.source-image { width: 100%; position: absolute; top: 0; left: 0; } How come this image overrides following id's background #mainPicture { clear:both; width:670px; height:345px; background-color:#160306; } And not just this id, every div which includes id from css with background What I want is actually this picture to be under everything Quote Link to comment https://forums.phpfreaks.com/topic/267199-image-css-problem/ Share on other sites More sharing options...
quelle Posted August 16, 2012 Author Share Posted August 16, 2012 @z-index attribute is needed here Quote Link to comment https://forums.phpfreaks.com/topic/267199-image-css-problem/#findComment-1370036 Share on other sites More sharing options...
Christian F. Posted August 17, 2012 Share Posted August 17, 2012 If you want the picture to be under/behind everything, why not use background-image: ? Seeing as that is, in fact, what you want to use it as. Quote Link to comment https://forums.phpfreaks.com/topic/267199-image-css-problem/#findComment-1370042 Share on other sites More sharing options...
quelle Posted August 17, 2012 Author Share Posted August 17, 2012 If you want the picture to be under/behind everything, why not use background-image: ? Seeing as that is, in fact, what you want to use it as. Background image isnt resizable, and in my case trick works based on browser size Quote Link to comment https://forums.phpfreaks.com/topic/267199-image-css-problem/#findComment-1370081 Share on other sites More sharing options...
Mahngiel Posted August 17, 2012 Share Posted August 17, 2012 Background image isnt resizable, and in my case trick works based on browser size background images ARE resizeable in CSS. What the OP seems to need is background-size: cover; Quote Link to comment https://forums.phpfreaks.com/topic/267199-image-css-problem/#findComment-1370153 Share on other sites More sharing options...
quelle Posted August 17, 2012 Author Share Posted August 17, 2012 Background image isnt resizable, and in my case trick works based on browser size background images ARE resizeable in CSS. What the OP seems to need is background-size: cover; I obviously missed somewhere the part where i say without CSS 3 please Quote Link to comment https://forums.phpfreaks.com/topic/267199-image-css-problem/#findComment-1370335 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.