SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Evangelist ktown's Avatar
    Join Date
    May 2001
    Location
    toronto
    Posts
    478
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    getting rid of the margins in Opera

    Hi

    I guess its not that big of deal seeing how noone uses opera anymore.. but can i get rid of the margins that it creates, so there is that ugly space around my pages.

    <body leftmargin="0" rightmargin="0" topmargin="0" marginheight="0" marginwidth="0">

    this will stop it from doing so in EI & NS... Opera?

  2. #2
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    The accepted way of getting rid of margins in IE4+, Netscape 6+ and Opera 5+ is to use CSS...

    Code:
    <style>
    body {
      margin: 0px 0px 0px 0px;
    }
    </style>
    That will remove all margins. If you just want to remove the left and right margins then you can use:

    Code:
    <style>
    body {
      margin-left: 0px;
      margin-right: 0px;
    }
    </style>
    You should place that code in the head of your file. What you have already on the body tag will continue to remove the margins in Netscape 3.0 and IE 3.0. The rest of the browsers should use the style sheet which automatically overrides inline style attributes.
    Wayne Luke
    ------------


  3. #3
    SitePoint Evangelist ktown's Avatar
    Join Date
    May 2001
    Location
    toronto
    Posts
    478
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmm.. cool
    thanks Luke

  4. #4
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    But Wayne, don't forget that Opera will also automatically add some padding unless you tell it not to. That's why you should use this code, ktown.
    Code:
    <style type="text/css">
    <!--
    body {
      margin: 0;
      padding: 0;
    }
    -->
    </style>


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •