473,473 Members | 2,044 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

height and width

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
17 2192
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
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
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
oh, by the way: 97.6 percent of accidents are caused by excessive speed
Jul 20 '05 #5
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
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
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
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
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
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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: John | last post by:
I have a table with two rows. On the first row is a text box and in the second row is an image. I have set the table cellpadding to 0 and cellspacing to 0. The table is leaving extra spaces in the...
12
by: Kepler | last post by:
How do you get the height of the client browser in IE? Both document.body.clientHeight and document.body.offsetHeight return the height of the document. If the page is long and there's a vertical...
5
by: Kevin Myers | last post by:
How can one obtain obtain the height of a MS Access 2K form? There is a width property, but I don't see a corresponding height property. I need to obtain the height of the form so that I can...
1
by: polocar | last post by:
Ciao a tutti, leggendo qua e là per il forum ho scoperto che non sono l'unico ad avere questo problema. Se si inserisce un controllo ComboBox in un form di C#, non è possibile impostare la sua...
1
by: comp.lang.php | last post by:
Sorry folks, I'm on a roll!!! I need to calculate the height or width of an image if you change either the width or height and don't change BOTH of them at the same time, this is to "vector" the...
4
by: reycri | last post by:
I have a page that works as I intend in IE but not in Firefox: <html> <head> <title>Overflow Test</title> </head> <body style='overflow:hidden; margin:0; padding:0;'> <table border='0'...
8
by: Kentor | last post by:
Hello, I have users that submit images to my website. By default I choose to make the width bigger than the height because usually pictures are taken horizontally... But in some cases people take...
1
by: mascouta | last post by:
I have a lot of problems with IE browser, one of them is described in this topic. in my website i have div Calculator with background image. it displayed perfectly with Firefox browser however in IE...
1
by: pravinnweb | last post by:
can anyone tell me how to set auto height to outer div that is in green box id "gray-background" it should increase relatively to inner div "smbox" here is the css and html code it should work in...
4
by: AAaron123 | last post by:
<body runat="server" id="MainBody"> <form id="form1" runat="server" style="background-color:green; width: 100%; height: 100%"> <br /> Table1" runat="server" Style="background-color:Yellow;...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.