View Full Version : alignment
Blank Verse
October 26th, 2002, 17:35
I know I've forgotten the answer to this question on hundreds of occassions, but how do you get an image to align with the edge of the browser, say on the top left?
aphel aura
October 26th, 2002, 19:17
Using tables or CSS absolute positoning, depedning on your requirements.
Blank Verse
October 27th, 2002, 01:50
via tables, but what exactly do I have to code?
acidmist_mike
October 27th, 2002, 06:24
I'd say css is easier.
<img src src="adsf" style="position: absolute; left: 0px; top: 0px;">
ansa
October 27th, 2002, 13:05
Also, make sure you've got body tag of
<body topmargin="0" leftmargin="0">
otherwise it'll be slightly offset
Andy.
Bruce
October 27th, 2002, 13:11
Originally posted by ansa
Also, make sure you've got body tag of
<body topmargin="0" leftmargin="0">
otherwise it'll be slightly offset That really does nothing at all...
<body marginheight="0" marginwidth="0"> would be the correct way.
ansa
October 27th, 2002, 13:45
For which i humbly apologise. This is always the way i've done it before, and it works (even though it's not in the HTML spec :()
Andy.
Bruce
October 27th, 2002, 13:53
Originally posted by ansa
and it works Only in IE.
ansa
October 27th, 2002, 13:59
ah, that'll be it then :(
damn me! how could i be so stupid ;)
meow
October 27th, 2002, 16:43
Not more stupid than him since marginheight/marginwidth only works in Netscape. :confused2
Yo Blank Verse! :p
<style type="text/css">
body { margin: 0; padding 0 }
</style>
If you want it to work in old Netscape you have to hack it a little. Following will get rid of all margins in modern browsers and top and left margins in NN4.
<style type="text/css">
/*For NS4 */
body { margin:-10px 0 0 -10px }
/* For good browsers. NN4 doesn't understand it */
html body { margin:0; padding: 0}
</style>
If it's worth it to you to use old, proprietary markup to get rid of the right margin in NN4, by all means, jam the lot in there.
Bruce
October 27th, 2002, 19:59
Originally posted by meow
Not more stupid than him since marginheight/marginwidth only works in Netscape. :confused2 Like I realy care about IE anyway... :rolleyes:
So just use both, or CSS as you suggested.
Blank Verse
October 28th, 2002, 00:35
Yup, works great. Thanks all.
Powered by vBulletin® Version 4.1.7 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.