Results 1 to 7 of 7

Thread: white space around my images

  1. #1
    Join Date
    Aug 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Angry white space around my images

    Hi there,

    I have trouble with opening my images in a new window or other target page....
    When i click a thumbnail the image opens in a target window (Iframe) with all margins 0 but still at the left and top of the image is a white space...
    This also happens when i use a open new window script.....

    <a href="images/MLC100(1)-thumpgroot.jpg" target="fotogroot">

    Do i need to put the image in a separate html document to prevent this or is there another solution?


    Nathalie

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Make the window/frame smaller?
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by nathalie123
    [...] the image opens in a target window (Iframe) with all margins 0
    Margins affect the space around an element. Removing the margins on an internal frame won't affect what's inside it.

    at the left and top of the image is a white space [...] Do i need to put the image in a separate html document to prevent this [...]?
    Yes. The spacing is imposed by the browser, and you can only remove it if you have the ability to specify CSS (which only exists with HTML).

    Mike

  4. #4
    Join Date
    Aug 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post

    Hi Mike,

    There is a css document linked to the page with te link and the target page.
    What do i have to specify in the css to solve this problem?

    thanks for your reaction !!

  5. #5
    Join Date
    Aug 2005
    Location
    Dorset, England
    Posts
    46
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    mmh... I'm no help but...

    I have this problem too when using Dreamweaver's behavior 'Open Browser' (mm_OpenBrWindow), I can't alter the code to set margins to 0 and for the image to align top and left. currently i use the 'default' padding and made the image window bigger so it seems to have a white border, not ideal but acceptable. Click linking about 100 photos was tedious this way too. Any better ideas?

    ::: once i found out what they were called, Switch Menu was my saviour :::

    http://www.dynamicdrive.com/dynamici...switchmenu.htm

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Well, since we are talking about iframes here as well, if you set the dimensions of the iframe to the dimensions of the image and set marginHeight or marginWidth to 0, there will be no whitespace within the iframe, ex:
    HTML Code:
    <iframe src="photo1.jpg" width="140" height="225" scrolling="no" frameborder="0" marginHeight="0"></iframe>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by nathalie123
    There is a css document linked to the page with te link and the target page.
    What do i have to specify in the css to solve this problem?
    First of all, I apologise for not responding earlier. I didn't see your reply to this thread.

    Add the following rule to your style sheet for the target document:

    Code:
    body {
      margin: 0;
      padding: 0;
    }
    This will remove the default 10 pixel (or so) spacing that the majority of browsers include around the edge of the document.

    Be aware that this may not be the only addition necessary. If you use certain elements in the document, they may add their own margins. If the problem persists, please post a URL to an example.

    Mike

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
  •