quote:
Originally posted by lhunath
quote:
Originally posted by fluffy_lobster
<body topmargin="0"><table align="center">...
Ewww!
God's sake.
HTML:
<iframe id="myframewhichiwantcentered" ....></iframe>
CSS:
#myframewhichiwantcentered {
position: absolute;
top: 0px;
width: [framewidth]px;
left: 50%;
margin-left: -[framewidth]px;
}
Don't do it in CSS, then don't do it at all, or perlease keep it XHTML compliant...
or if you can't be bothered to keep the CSS somewhere seperate; do it the lame way:
<iframe style="position: absolute; top: 0px; left: 50%; width: [framewidth]px; margin-left: -[framewidth]px;" .....></iframe>
Btw, Iframes are ghay =)
~lhun
You're right - I wasn't aware the topmargin attribute was no longer valid. However blade was asking for an HTML solution, so I hardly see preaching that mess of a css hack a tidy alternative. All that actually needs to be done is give the body the margin-top: 0px; style, and seeing as it's a lone attribute there's no real reason why not to use inside the tag; <body style="margin-top: 0px;">
For the horizontal centering, either raceprouk's align: center; style or the html attribute align="center" are valid and intercompatible.
By the way, racepro, the vertical-align: top; is obsolete because that's the default for members of the <body> element. The issue with top aligning it was that there is a default top margin of something like 10px