Jasper de Vries wrote:
Els wrote: somebody wrote:
For example, I want to have column represented by xhtml code
<body><p style="width:15ex;">x x x x x x x x x x x x x x x x x x x x x
x</p></body>
in the horizontal center of browser window.
For standards following browsers:
p{
margin-left:auto;
margin-right:auto;
}
For IE5 on Windows:
body{
text-align:center;
}
p{
text-align:left;
}
Combine the two methods for allround effect :-)
Another method (works in IE5+ and modern browsers):
p {
position: absolute;
left: 50%;
margin-left: -7.5ex;
}
And then see what happens if your window is narrower than 15ex.
That, and if there are any other elements below that <p>aragraph, the
layout will be messed up; position:absolute takes the element out of
the flow, meaning that whatever element is next in the HTML file, will
move up.
--
Els
http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: Meat Loaf - Paradise By The Dashboard Light