/    Sign up×
Community /Pin to ProfileBookmark

Finding the document width in NN.

In IE I can use expression() to find out the current width of the document and return a calculated value to set a <div> width, like this:

width: expression( document.body.clientWidth – 400 + “px” )

where what I want to do is set the width of a middle <div> surrounded by a right and left <div> of fixed widths.

What is the equivalent process in NN?

Thank you.

JME

to post a comment
CSS

5 Comments(s)

Copy linkTweet thisAlerts:
@SamMay 10.2004 — how is the client's browser width related to your design? The best solution is to make a design that works at any width.
Copy linkTweet thisAlerts:
@gil_davisMay 10.2004 — You have used IE proprietary objects that no other browser supports. [i]clientWidth[/i] is not a W3C recommended standard. [i]document.body[/i] should work in all browsers. [i]expression[/i] is also an IE proprietary feature.

If you want your page to work in many different browsers, visit the W3C and find a recommended way to do it. There may still be quirks, since everyone has their own idea of what the W3C means, but it is a start.

http://www.w3.org/Style/CSS/
Copy linkTweet thisAlerts:
@jmedgarauthorMay 10.2004 — I am familiar with W3, that is, I've read most of the standards. That does not mean I actually know what to do with them.

My browser width and document width are the same (minus the usual borders, etc.)

What I like about the IE expression() function is that one can evaluate a DOM object property in-line, on the fly, without having to use javascript or some other scripting language.

I can find nothing similar in NN, and am simply wondering if I am missing something -- or in fact it does not exist.

Thanks
Copy linkTweet thisAlerts:
@gil_davisMay 11.2004 — Netscape exposes window.innerWidth which is the usable browser area inside the borders. They also support document.width.

Netscape 4 had a proprietary method of using calculations in CSS. I do not know if newer versions support it, but I doubt it. They adhere to W3 recommendations, and that feature is not currently included. See http://developer.netscape.com/docs/manuals/communicator/dynhtml/layers32.htm#1038571 for an explanation.
Copy linkTweet thisAlerts:
@jmedgarauthorMay 11.2004 — "Netscape 4 had a proprietary method of using calculations in CSS"

You are right, this sort of inline code does not seem to work beyond NN5.

Thanks for the tip, though.
×

Success!

Help @jmedgar 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.20,
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,
)...