View Full Version : white space around my images
nathalie123
08-11-2005, 07:27 AM
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... :mad:
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 :p
Make the window/frame smaller?
mwinter
08-11-2005, 10:11 AM
[...] the image opens in a target window (Iframe) with all margins 0Margins 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
nathalie123
08-11-2005, 11:01 AM
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 !!
FordCorsair
08-15-2005, 08:52 AM
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/dynamicindex1/switchmenu.htm
jscheuer1
08-15-2005, 11:20 AM
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:
<iframe src="photo1.jpg" width="140" height="225" scrolling="no" frameborder="0" marginHeight="0"></iframe>
mwinter
08-15-2005, 01:00 PM
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:
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
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.