With this code the "TEXT" doesn't show up in IE 7. I think its behind the input? Giving it a zindex dosn't help, and i can't use position:relative because it messes other stuff up. any ideas of how to fix?
<!DOCTYPE html>
<input/><span style='margin-left:-50px;'>TEXT</span>
Same thing in IE 6. Adding position: absolute;
solved it in IE 6, so hopefully it does the same in IE 7:
<span style='margin-left:-50px; position: absolute;'>TEXT</span>
Margins are not reliable on inline elements. Newer browsers handle it ok, but older ones still don't work the way you expect them to in many cases. So you may need to make the element a block level element (which will then cause you to potentially need to use a float to bring it back inline before positioning it over the form element, which is what I assume is the intended final position.
Also, z-index will only work for elements that are positioned. I'm surprised that position: relative messes other things up, but position: absolute doesn't, my go to fix would be to use { position: relative; left: -50px; z-index: 10; } to slide the span over.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With