codingmasterRS Posted June 11, 2011 Share Posted June 11, 2011 Hi Guys, I have images <img src="avatars/21.png" class="online" /> now class="online" SHOULD overlay a green box, but it is not currently, how can I fix this? Quote Link to comment https://forums.phpfreaks.com/topic/239036-clever-z-index/ Share on other sites More sharing options...
codingmasterRS Posted June 11, 2011 Author Share Posted June 11, 2011 this is the CSS position: absolute; background: #00FF00; width: 7.5px; height: 7.5px; margin-top: 23px; z-index: 5; Quote Link to comment https://forums.phpfreaks.com/topic/239036-clever-z-index/#findComment-1228216 Share on other sites More sharing options...
mikesta707 Posted June 11, 2011 Share Posted June 11, 2011 Please don't repost your questions. Especially don't repost them in the wrong board. This is the PHP help board. You probably want to post this in the css help forum. Doing a quick google search may also help you. I turned up with this: http://stackoverflow.com/questions/403478/css-how-to-overlay-images you aren't trying to overlay a small image over a larger one, but the concept is pretty much the same. Just don't use the small image. Quote Link to comment https://forums.phpfreaks.com/topic/239036-clever-z-index/#findComment-1228218 Share on other sites More sharing options...
codingmasterRS Posted June 11, 2011 Author Share Posted June 11, 2011 I wanted to avoid having to add a span etc, and just add a class to the <img> Quote Link to comment https://forums.phpfreaks.com/topic/239036-clever-z-index/#findComment-1228219 Share on other sites More sharing options...
mikesta707 Posted June 11, 2011 Share Posted June 11, 2011 dont know if thats possible. Im unaware of any CSS rules that would allow you to basically change how an image is rendered. The link a provided kind of spoofs this using absolute positioning of a span to position it over an image. This is what an overlay is. Quote Link to comment https://forums.phpfreaks.com/topic/239036-clever-z-index/#findComment-1228220 Share on other sites More sharing options...
codingmasterRS Posted June 11, 2011 Author Share Posted June 11, 2011 See the reason I wanted to do it this way is that when AJAX detects the user goes offline the jQuery uses removeClass from the id and when it detects goes online just addClass. So its simple and neat rather than adding and removing SPAN or DIV. But if anyone has any suggestions or ways of doing it better that work, please suggest.... Quote Link to comment https://forums.phpfreaks.com/topic/239036-clever-z-index/#findComment-1228222 Share on other sites More sharing options...
mikesta707 Posted June 11, 2011 Share Posted June 11, 2011 instead of using add/remove class you could just use hide/show Quote Link to comment https://forums.phpfreaks.com/topic/239036-clever-z-index/#findComment-1228224 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.