Closed Thread Icon

Topic awaiting preservation: margins using css (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=8032" title="Pages that link to Topic awaiting preservation: margins using css (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: margins using css <span class="small">(Page 1 of 1)</span>\

 
adaline
Bipolar (III) Inmate

From: look down!
Insane since: Jul 2001

posted posted 01-16-2002 20:04

How do I make the top and left margin be 0 using css. I should know this but damn if it didn't slip my mind. Heh.

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 01-16-2002 20:15

adaline:

margin-top: 0px;
margin-left: 0px;

See:
www.w3.org/TR/CSS2/box.html#margin-properties

Grab the PDF of the CSS2 specs from:
www.w3.org/TR/CSS2/css2.pdf

It is your friend.

Emps

[edit: Didn't quite answer the question]


Beware of men without beards and women with beards - Basque proverb

[This message has been edited by Emperor (edited 01-16-2002).]

kuckus
Bipolar (III) Inmate

From: Berlin (almost)
Insane since: Dec 2001

posted posted 01-16-2002 20:16

It's just as easy as you thought :

code:
<style ...>
body { margin: 0px; }
</style>



//edit: Aargh, Emps, I can't believe you were 2 seconds faster than me again!



[This message has been edited by kuckus (edited 01-16-2002).]

Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 01-19-2002 05:49

<style type="text/css">
body {margin: 0 0 0 0;}
</style>

That defines top, right, bottom, left IN THAT ORDER, in pixels. You could do less than four numbers, and the missing one gets the value from the opposite side. So margin: 0 3 would give you top and bottom of 0 and left and right of 3. Using margin: 0 would give you 0 all around.

You can use this same method for other items in CSS as well, like borders.

Hope this helps.

« BackwardsOnwards »

Show Forum Drop Down Menu