PDA

View Full Version : Dynamically centered content



TimHolley
04-24-2006, 06:22 PM
ok, so i've designed my site in Dreamweaver MX when i realise that you can dynamically center the content...however, my original design didn't take that into account. I'm not much an HTML/CSS expert so any help is greatly recieved. I've tried to put a <div> tag around the other <div> tags so that they keep thier absolute locations. e.g.

"<div id="master"
<div id="Layer2" style="position:absolute; left:4px; top:4px; width:2px; height:13px; z-index:2"><img src="navbar/gsqure.gif" width="22" height="22">
</div>"

Where master is linked to an external CSS file where the box is dynamically centered. Is there any way to fix my problem without redesigning the whole site?

Twey
04-24-2006, 06:24 PM
"Dynamically center" the content? I think your definition of "dynamically" differs slightly from mine/ours. Please clarify.

TimHolley
04-24-2006, 07:04 PM
Ah! Sorry if I've been using the wrong term...by dynamic I mean that the page content is centered in the brower window regardless of the window size. e.g. http://news.bbc.co.uk/2/hi//default.stm is not centered whereas http://www.lufthansa.com is centered.

A bit clearer now?

Twey
04-24-2006, 07:20 PM
Aha, yes. Well, images are inline elements, so simply surrounding the code with:
<div style="text-align:center;"><p>Text blah blah blah<img src="image">more text isn't this fascinating</p></div>