Closed Thread Icon

Preserved Topic: communicating with the body margin... (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=18285" title="Pages that link to Preserved Topic: communicating with the body margin... (Page 1 of 1)" rel="nofollow" >Preserved Topic: communicating with the body margin... <span class="small">(Page 1 of 1)</span>\

 
CPrompt
Maniac (V) Inmate

From: there...no..there.....
Insane since: May 2001

posted posted 01-25-2002 17:47

I have searched through the archives and can't find anything relating to this so I appologize if already been discussed, but...

Using Javascript, how do I set the body's margins? If I already have them in a style sheet set to: margin: 0px 0px 0px 0px; How do I "communicate" in Javascript that I want to change them.

I know that you can change the attributes of a <div> but I want to change the style sheet attribute.

Does this make sense? I'm quite tired today.

Later,
C:\


~Binary is best~

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 01-25-2002 20:23

document.body.style.margin = "whatever px"

CPrompt
Maniac (V) Inmate

From: there...no..there.....
Insane since: May 2001

posted posted 01-25-2002 20:24

Thanks

Later,
C:\


~Binary is best~

CPrompt
Maniac (V) Inmate

From: there...no..there.....
Insane since: May 2001

posted posted 01-28-2002 17:16

OK, that worked OK but now I need to get the top margin only. I have tried margin.top, margin-top and just top, but nothing seems to give me what I need. Any suggestions?

Later,
C:\


~Binary is best~

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 01-28-2002 17:21

a CSS property

something-somethingelse

turns into the JS property

somethingSomethingelse

so use marginTop.

CPrompt
Maniac (V) Inmate

From: there...no..there.....
Insane since: May 2001

posted posted 01-28-2002 19:25

Thanks for the info. That will help me greatly!



Later,
C:\


~Binary is best~

« BackwardsOnwards »

Show Forum Drop Down Menu