faqts : Computers : Programming : Languages : JavaScript : Document

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

44 of 51 people (86%) answered Yes
Recently 7 of 10 people (70%) answered Yes

Entry

How can I set the margins of a page?
How can I set the page margins to 0?
How can I set the page margins to 0?

Jul 5th, 2001 08:41
Marcelo Coelho, Martin Honnen,


IE and NN have different BODY attributes for that.
IE
  TOPMARGIN
  LEFTMARGIN
  BOTTOMMARGIN (optional)
  RIGHTMARGIN (optional)

(NOTE: If BOTTOMMARGIN isn't specified, IE uses the TOPMARGIN 
parameter. If RIGHTMARGIN isn't specified, IE uses the LEFTMARGIN 
parameter)

NN
  MARGINHEIGHT
  MARGINWIDTH

Thus
  <BODY LEFTMARGIN="0" TOPMARGIN="0" MARGINHEIGHT="0" MARGINWIDTH="0">
will set the page margins to 0 in a cross browser way.