godoprod Posted September 1, 2006 Share Posted September 1, 2006 Hi,How do I make text follow the background image as the browser window switches size.I want some text to align on a specific place on the background image at all times, how can I make that happen??Should I use DIV or AREA, or something else?? Link to comment Share on other sites More sharing options...
Jack McKalling Posted September 1, 2006 Share Posted September 1, 2006 You could position the text onto the correct place, using pixels. When the window would move or resized, the text would stay on that position But text only cannot be positioned. Only block-level elements, like DIV as you mention. ...<div style="position:absolute; left:100px; top:150px">positioned text</div>You would change the red coloured of cource to whatever position you want Link to comment Share on other sites More sharing options...
godoprod Posted September 1, 2006 Author Share Posted September 1, 2006 This wuold not do it you see:I got the HTML script saying:<div id="text">Something</div>And the CSS file saying:#text { position: absolute; top: 84px; left: 775px;}But when I make my browser window smaller, the text stay still, due to the "position: absolute;". I want it to follow the center align.... Link to comment Share on other sites More sharing options...
Jack McKalling Posted September 1, 2006 Share Posted September 1, 2006 Oh, center alignment. Then you should center align it too :)You should place this div at the absolute vertical position the background image is on, and inside a full-width element, to be able to just by style center align it. <body><div id="holder"><div class="text">something</div></div>...</body> #holder { width:100%; }#text {text-align:center;position: absolute;top: 84px;} Another possibility to center align a block element like div, is to apply margin:auto; to it. It keeps getting recommended, but it never worked for me. Link to comment Share on other sites More sharing options...
godoprod Posted September 2, 2006 Author Share Posted September 2, 2006 I see what you mean, but this does not work for me.. Do you know any other way to make text float? Link to comment Share on other sites More sharing options...
Jack McKalling Posted September 2, 2006 Share Posted September 2, 2006 I don't ever use float, sorry Can't help you there Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now