By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,625 Members | 2,250 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,625 IT Pros & Developers. It's quick & easy.

height and width

P: n/a
Hi all,

For divs, do all browsers treat these the same?

I've been assuming that width and height are inclusive of margin and padding,
but the different appearance of my page in various browsers suggests to me my
assumption is incorrect.
--
Ben Thomas

Apparently less than 10% of accidents are caused by drivers exceeding the speed
limit.
Jul 20 '05 #1
Share this Question
Share on Google+
17 Replies


P: n/a
BenOne© wrote:
For divs, do all browsers treat these the same?
Treat what the same?
I've been assuming that width and height are inclusive of margin and padding,
but the different appearance of my page in various browsers suggests to me my
assumption is incorrect.


Padding is the space between an element and its border. Margin is the
space between elements.

http://www.w3.org/TR/REC-CSS2/box.html

--
Brian (remove "invalid" from my address to email me)
http://www.tsmchughs.com/
Jul 20 '05 #2

P: n/a
Brian wrote:
BenOne© wrote:
For divs, do all browsers treat these the same?

Treat what the same?


height and width of divs.
I've been assuming that width and height are inclusive of margin and
padding, but the different appearance of my page in various browsers
suggests to me my assumption is incorrect.

Padding is the space between an element and its border. Margin is the
space between elements.

http://www.w3.org/TR/REC-CSS2/box.html

--
Ben Thomas

Apparently less than 10% of accidents are caused by drivers exceeding the speed
limit.
Jul 20 '05 #3

P: n/a
On Tue, 27 Apr 2004 02:04:04 GMT, BenOne© <no**@m.thanks.mate> wrote:
Brian wrote:
BenOne© wrote:
For divs, do all browsers treat these the same?

Treat what the same?


height and width of divs.
I've been assuming that width and height are inclusive of margin and
padding, but the different appearance of my page in various browsers
suggests to me my assumption is incorrect.

Padding is the space between an element and its border. Margin is the
space between elements.

http://www.w3.org/TR/REC-CSS2/box.html

A more-expert may give a detailed answer, but my memory tells me
that the W3 world is virtual. In the real world browsers may treat
margins and padding differently. (I've heard of something called
"microsoft")

Mason C
Jul 20 '05 #4

P: n/a
oh, by the way: 97.6 percent of accidents are caused by excessive speed
Jul 20 '05 #5

P: n/a
MasonC <ma****@ix.netcom.xyz.com> wrote in message news:<u6********************************@4ax.com>. ..
oh, by the way: 97.6 percent of accidents are caused by excessive speed


And 97.6 percent of statistics are made up.

--
Dan
Jul 20 '05 #6

P: n/a
On 27 Apr 2004 05:02:43 -0700, Daniel R. Tobias wrote:
MasonC <ma****@ix.netcom.xyz.com> wrote in message news:<u6********************************@4ax.com>. ..
oh, by the way: 97.6 percent of accidents are caused by excessive speed


And 97.6 percent of statistics are made up.


Define 'cause' for starters..

A study something to the effect of..
'The causal attributions of young drivers'
found that more experienced drivers had
a higher rate of accepting responsibility
for an accident.

A less experienced driver was more likely
to say 'I crashed because it was raining and
the road was slippery'. The more seasoned
driver would report 'I was travelling too
fast in the rain'.

(shrugs) Lies, damned lies ..and statistics,
...and 'studies' for that matter!

Ultimately - "Never let the truth
get in the way of a good story" ;-)

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 20 '05 #7

P: n/a
MasonC wrote:

A more-expert may give a detailed answer,
In other words, even though you have nothing meaningful to contribute,
your fingers are itching to write something.
but my memory tells me that the W3 world is virtual.
Uhh, yeah, the world wide web is a virtual space. There are no people
living inside it. (You need to rely on some recollection to tell us that?)
In the real world
"In the real world" always introduces a statement that can be safely
ignored.
browsers may treat margins and padding differently.
Not "may," but "do." And that's hardly a surprise, since they *are*
different.

http://www.w3.org/TR/REC-CSS2/box.html
(I've heard of something called "microsoft")


Yes, MSIE, too, treats padding and margin differently.

--
Brian (remove "invalid" from my address to email me)
http://www.tsmchughs.com/
Jul 20 '05 #8

P: n/a
MasonC ma****@ix.netcom.xyz.com wrote:

oh, by the way: 97.6 percent of accidents are caused by excessive speed


not at all true...I had cause to look the research up last month...it's a
lot less than the high nineties...and the main factor is not excessive
speed, it's the differential in speed between the fastest and slowest
traffic that has the biggest effect...which makes excessive speed a factor
in a hell of a lot of accidents but fewer than you are suggesting

as it happens a lot of the best research is available from the UK's
Department of Transport web site...which happens to be one of the best
made government web sites I've ever seen...it's actually fairly competent

--
eric
www.ericjarvis.co.uk
"live fast, die only if strictly necessary"
Jul 20 '05 #9

P: n/a
MasonC wrote:
oh, by the way: 97.6 percent of accidents are caused by excessive speed


Which doesn't necessarily mean they were exceeding the speed limit. Which the
authorities conveniently don't mention so they can justify increasing speeding
fines, lowering tolerances, and lowering speed limits.

--
Ben Thomas

Apparently less than 10% of accidents are caused by drivers exceeding the speed
limit.
Jul 20 '05 #10

P: n/a
On Tue, 27 Apr 2004 21:33:03 GMT, BenOne© <no**@m.thanks.mate> wrote:
MasonC wrote:
oh, by the way: 97.6 percent of accidents are caused by excessive speed
Which doesn't necessarily mean they were exceeding the speed limit. Which the
authorities conveniently don't mention so they can justify increasing speeding
fines, lowering tolerances, and lowering speed limits.


shoot..... and I thought you were going to thank me for being
the only one to respond to your query. Did I drive too fast?
For divs, do all browsers treat these the same? I've been assuming that width and height are inclusive of margin and padding,
but the different appearance of my page in various browsers suggests to me my
assumption is incorrect.


An expert could give a brief detailed statement of how margins and paddings differ
among browsers.
Jul 20 '05 #11

P: n/a
MasonC wrote:
On Tue, 27 Apr 2004 21:33:03 GMT, BenOne© <no**@m.thanks.mate> wrote:

MasonC wrote:
oh, by the way: 97.6 percent of accidents are caused by excessive speed
Which doesn't necessarily mean they were exceeding the speed limit. Which the
authorities conveniently don't mention so they can justify increasing speeding
fines, lowering tolerances, and lowering speed limits.

shoot..... and I thought you were going to thank me for being
the only one to respond to your query. Did I drive too fast?


Couldn't help myself. :) Thanks, BTW.
For divs, do all browsers treat these the same?


I've been assuming that width and height are inclusive of margin and padding,
but the different appearance of my page in various browsers suggests to me my
assumption is incorrect.

An expert could give a brief detailed statement of how margins and paddings differ
among browsers.


Waiting patiently.
--
Ben Thomas

Apparently less than 10% of accidents are caused by drivers exceeding the speed
limit.
Jul 20 '05 #12

P: n/a
BenOne© wrote:
MasonC wrote:
On Tue, 27 Apr 2004 21:33:03 GMT, BenOne© <no**@m.thanks.mate> wrote: [snip]
For divs, do all browsers treat these the same?

I've been assuming that width and height are inclusive of margin and
padding, but the different appearance of my page in various browsers
suggests to me my assumption is incorrect.


An expert could give a brief detailed statement of how margins and
paddings differ among browsers.


Waiting patiently.


I'm a bit puzzled by this thread. Some experts have posted here, apparently
without answering your original question, even though they presumably know the
basis for the answer.

No, browsers don't all treat them the same. In particular, IE 5 screwed up
badly, and a Google search for
IE 5 box model
will reveal lots of stuff about it, and various workarounds.

Then for "compatibility" reasons the concept of being able to cause other
browsers to (nearly) emulate IE 5 arose, and a Google search for
quirks mode
will give you the sad tale. So authors can choose, to some extent, which other
browsers will also screw up.

(When I'm trying to match the sizes of elements to images such as photographs,
for example to make roll-over links, this particular issue tends to be my
biggest problem).

--
Barry Pearson
http://www.Barry.Pearson.name/photography/
http://www.BirdsAndAnimals.info/
http://www.ChildSupportAnalysis.co.uk/
Jul 20 '05 #13

P: n/a
Barry Pearson wrote:
BenOne© wrote:
MasonC wrote:
On Tue, 27 Apr 2004 21:33:03 GMT, BenOne© <no**@m.thanks.mate> wrote:
[snip]
For divs, do all browsers treat these the same?

I've been assuming that width and height are inclusive of margin and
padding, but the different appearance of my page in various browsers
suggests to me my assumption is incorrect.

An expert could give a brief detailed statement of how margins and
paddings differ among browsers.


Waiting patiently.

I'm a bit puzzled by this thread. Some experts have posted here, apparently
without answering your original question, even though they presumably know the
basis for the answer.

No, browsers don't all treat them the same. In particular, IE 5 screwed up
badly, and a Google search for
IE 5 box model
will reveal lots of stuff about it, and various workarounds.

Then for "compatibility" reasons the concept of being able to cause other
browsers to (nearly) emulate IE 5 arose, and a Google search for
quirks mode
will give you the sad tale. So authors can choose, to some extent, which other
browsers will also screw up.

(When I'm trying to match the sizes of elements to images such as photographs,
for example to make roll-over links, this particular issue tends to be my
biggest problem).


Thanks Barry. Looks like I'll have to design it for IE with a link on the page
for non-IE users to get a page that works. Or I could go for a more boring
layout with a menu bar at top and bottom of page instead of a side menu.

--
Ben Thomas

Apparently less than 10% of accidents are caused by drivers exceeding the speed
limit.
Jul 20 '05 #14

P: n/a
BenOne© wrote:
Barry Pearson wrote:
BenOne© wrote: [snip]
>For divs, do all browsers treat these the same? [snip]Waiting patiently.
[snip] No, browsers don't all treat them the same. In particular, IE 5
screwed up badly, and a Google search for
IE 5 box model
will reveal lots of stuff about it, and various workarounds. [snip] (When I'm trying to match the sizes of elements to images such as
photographs, for example to make roll-over links, this particular
issue tends to be my biggest problem).


Thanks Barry. Looks like I'll have to design it for IE with a link on
the page for non-IE users to get a page that works. Or I could go for
a more boring layout with a menu bar at top and bottom of page
instead of a side menu.


That shouldn't be necessary. Once you realise that the problem exists, it
should be possible to design round it. Most people do.

For example, I had to have an exact 180px sidebar in these templates (below),
because I had a background photograph for the rollovers. I ended up doing
various things to stop IE 5 blowing the layout apart, but I think what I got
was better than having a separate page. (It probably still blows apart in IE
Mac, but that is a grotty browser!)
http://www.barry.pearson.name/articles/templates/

--
Barry Pearson
http://www.Barry.Pearson.name/photography/
http://www.BirdsAndAnimals.info/
http://www.ChildSupportAnalysis.co.uk/
Jul 20 '05 #15

P: n/a
In article BenOne© wrote:
Hi all,

For divs, do all browsers treat these the same?
What? height and width as in subject line (include all to body, please)

No. In fact, most common browsers treat them more than one way...

http://gutfeldt.ch/matthias/articles/doctypeswitch.html
I've been assuming that width and height are inclusive of margin and padding,
Exactly opposite. Width and hight are content width and hight by CSS1, 2
and 2.1. There will most likely be option to use box width in CSS3. That
property works most browsers already though, but you might need to
include vedor prefix.
but the different appearance of my page in various browsers suggests to me my
assumption is incorrect.


Yes.

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
I'm looking for work | Etsin työtä
Jul 20 '05 #16

P: n/a
Lauri Raittila wrote:
In article BenOne© wrote:
Hi all,

For divs, do all browsers treat these the same?

What? height and width as in subject line (include all to body, please)

No. In fact, most common browsers treat them more than one way...

http://gutfeldt.ch/matthias/articles/doctypeswitch.html

I've been assuming that width and height are inclusive of margin and padding,

Exactly opposite. Width and hight are content width and hight by CSS1, 2
and 2.1. There will most likely be option to use box width in CSS3. That
property works most browsers already though, but you might need to
include vedor prefix.

but the different appearance of my page in various browsers suggests to me my
assumption is incorrect.

Yes.


Thanks for the reply Lauri.

--
Ben Thomas

Apparently less than 10% of accidents are caused by drivers exceeding the speed
limit.
Jul 20 '05 #17

P: n/a
BenOne© wrote in
<eo***********@192.168.11.2>
MasonC wrote:
On Tue, 27 Apr 2004 21:33:03 GMT, BenOne© <no**@m.thanks.mate> wrote:

MasonC wrote:

oh, by the way: 97.6 percent of accidents are caused by excessive
speed

Which doesn't necessarily mean they were exceeding the speed limit.
Which the authorities conveniently don't mention so they can
justify increasing speeding fines, lowering tolerances, and
lowering speed limits.

shoot..... and I thought you were going to thank me for being
the only one to respond to your query. Did I drive too fast?


Couldn't help myself. :) Thanks, BTW.

For divs, do all browsers treat these the same?


I've been assuming that width and height are inclusive of margin
and padding, but the different appearance of my page in various
browsers suggests to me my assumption is incorrect.

An expert could give a brief detailed statement of how margins and
paddings differ among browsers.


Waiting patiently.


http://www.thenoodleincident.com/tut...rkarounds.html
If only 10% of accidents are caused by drivers exceeding the speed limit,
that's 2,500 fatalities and serious injuries per year in Australia.

--
PeterMcC
If you feel that any of the above is incorrect,
inappropriate or offensive in any way,
please ignore it and accept my apologies.

Jul 20 '05 #18

This discussion thread is closed

Replies have been disabled for this discussion.