/    Sign up×
Community /Pin to ProfileBookmark

Opening Pic in New Window

Even if I resize my new window to the exact dimensions of a picture, when it opens a white border is on the top and left hand side. if i resize it smaller, the border becomes larger and on all sides! How can I open a picture in a new window and only have the picture shown, with no border?

?

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@fredmvJan 02.2004 — Welcome to the forums.

I'm guessing this is a problem with the default margins. Try adding this in the new window:<style type="text/css">
/*<![CDATA[*/
body {
margin: 0;
padding: 0;
border: 0;
}
/*]]>*/
</style>
Copy linkTweet thisAlerts:
@JenCauthorJan 03.2004 — where exactly does that go?
Copy linkTweet thisAlerts:
@fredmvJan 03.2004 — It can do anywhere (in the source code of the document containing the picture), however, it's usually placed in the [font=courier]<head>[/font] section.
Copy linkTweet thisAlerts:
@JenCauthorJan 03.2004 — what if the new window is only a jpg file? do i need to create it's own page for it?
Copy linkTweet thisAlerts:
@fredmvJan 03.2004 — You could either:[list=a]
  • [*]As you said, create it's own page, however, you could simplify this by using some rather simple server-side scripting to dynamically generate a page for it.
  • [*]Use JavaScript to create a new window with a reference to the image and the source code I provided in it. While this may seem like a good solution, it actually isn't because then users which don't have JavaScript support won't be able to use this feature.
  • [/list]
    ×

    Success!

    Help @JenC spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 6.2,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,

    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,
    )...