/    Sign up×
Community /Pin to ProfileBookmark

Making body size equal window size?

Hi
I am working on a design in which rightly or wrongly I think a 4 px black border would look good around your entire viewable window area. Anyway I would like a way of trying this out and using CSS to give the body tag a four pixel black border does not do this. It appears that the body size does not equal the window size. The height of my body tag does not equal my window size. So can anybody tell me how to make body tag size equal window size. Or some other way of accomplishing a 4 px black border around your entire viewable window area.

Sincerely
Marc

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@DokMay 17.2007 — [code=html]<html>
<head>
</head>
<body style="border: 4px solid #000000; margin: 0px; overflow: auto;">
</body>
</html>[/code]

Works in IE. Not sure about FF
Copy linkTweet thisAlerts:
@MarcMillerauthorMay 18.2007 — [code=html]<html>
<head>
</head>
<body style="border: 4px solid #000000; margin: 0px; overflow: auto;">
</body>
</html>[/code]

Works in IE. Not sure about FF[/QUOTE]

no not in IE OR FF.
Copy linkTweet thisAlerts:
@DokMay 18.2007 — Works for me - IE7 on WinXP SP2
Copy linkTweet thisAlerts:
@Typhoon101May 18.2007 — Works in IE, but not in FF.

The problem is, one browser reduces the size of the body to allow for the border, the other does not resulting in the need for scroll bars. You would need some more advanced CSS for it to work in both browsers.

This question is probably more suited in the CSS forum rather than the JavaScript forum. It could be achieved with JavaScript, but would be much better if CSS was used instead.
×

Success!

Help @MarcMiller 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 5.19,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...