I have a simple Div that's got a left of 50px, inside is a span that should be aligned 75px from the left side of the div, but what I'm using fails to work:
<style type="text/CSS">
div {
position: absolute;
left: 50px;
background-color: #000000;
}
span {
left: 75px; /* this doesn't work.(or at least not in IE)*/
background-color: #FFFFFF;
}
</style>
<div>
<span>Some content goes here</span>
</div>
This example neglects the fact that I use dynamic content(which means the position can be absolute since I don't know how much content will go in the message before it...) and that I will have various spans contained within this div.Hi!
What about adding 'padding-left:75px;' to the css for the div?
Cheers - PitAssuming I understand correctly, either add "position: relative" to the span, or else for the span change "left:" to "margin-left:".
Hope that helps.that works now, thank's nogdog.
And thanks for the try Pittimann.
<style type="text/CSS">
div {
position: absolute;
left: 50px;
background-color: #000000;
}
span {
left: 75px; /* this doesn't work.(or at least not in IE)*/
background-color: #FFFFFF;
}
</style>
<div>
<span>Some content goes here</span>
</div>
This example neglects the fact that I use dynamic content(which means the position can be absolute since I don't know how much content will go in the message before it...) and that I will have various spans contained within this div.Hi!
What about adding 'padding-left:75px;' to the css for the div?
Cheers - PitAssuming I understand correctly, either add "position: relative" to the span, or else for the span change "left:" to "margin-left:".
Hope that helps.that works now, thank's nogdog.
And thanks for the try Pittimann.