468,135 Members | 1,449 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,135 developers. It's quick & easy.

padding

<div style="width: 100px; padding-left: 10px; border: 1px solid
Black;">padding</div><br>
<div style="width: 100px; border: 1px black solid;">no padding</div>
firefox increases the width of the div to 110px.
ie includes the padding in the 100.

is there an easier work-around than
reducing the width by 10px if firefox?
Jul 25 '05 #1
8 1982
cosmic foo wrote:
<div style="width: 100px; padding-left: 10px; border: 1px solid
Black;">padding</div><br>
<div style="width: 100px; border: 1px black solid;">no padding</div>
firefox increases the width of the div to 110px.
ie includes the padding in the 100.

is there an easier work-around than
reducing the width by 10px if firefox?


I think you should ask that question in an appropriate group:

comp.infosystems.www.authoring.stylesheets
--
Rob
Jul 25 '05 #2

"RobG" <rg***@iinet.net.auau> wrote in message
news:qa****************@news.optus.net.au...
cosmic foo wrote:
<div style="width: 100px; padding-left: 10px; border: 1px solid
Black;">padding</div><br>
<div style="width: 100px; border: 1px black solid;">no padding</div>
firefox increases the width of the div to 110px.
ie includes the padding in the 100.

is there an easier work-around than
reducing the width by 10px if firefox?


I think you should ask that question in an appropriate group:

comp.infosystems.www.authoring.stylesheets
--
Rob


don't worry about it Rob
Jul 25 '05 #3
VK
> > cosmic foo wrote:
<div style="width: 100px; padding-left: 10px; border: 1px solid
Black;">padding</div><br>
<div style="width: 100px; border: 1px black solid;">no padding</div>
firefox increases the width of the div to 110px.
ie includes the padding in the 100.
is there an easier work-around than
reducing the width by 10px if firefox?


Yes there is: stop using browsers for hyperspace experiments. The outer
div has width 100px and left padding 10px. The math tells us that you
have 90px of available width inside. And you insert there another div
of 100px width.

This leaves the browser with two options only:
1) Transpode your div's into Riemann Space to accomodate both oblect on
the n-dimentional sphere.
2) Stay in the conventional Euclidean Space and change the size of one
of div's.

Strangely enough browsers prefer the Euclidean Space. You may file a
complain about it if you want. But if would be much simplier to use
realistic sizes.

And really <comp.infosystems.www.authoring.stylesheets> is the place to
put such questions.
Or <sci.math> if the hyperspace is really calling for you...

Jul 26 '05 #4

Well, 1st off, whenever you start any CSS block, must have as 1st line:

* {margin: 0;padding: 0}

to avoid user-agent defaults, which is I think the case here, from there
on, override, what you think is padding, is probably something else, like
letter-spacing or font glyph calculation using user-agent defaults, start
by setting all to 0, to avoid user-agent default issues, then override.
If the browser doesn't find an explicit defined value for the property,
it'll use an educated-one, and the educated-one is up to the browser
discretionary judgement, which varies from browser to browser.

Danny
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Jul 26 '05 #5

"VK" <sc**********@yahoo.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
cosmic foo wrote:
> <div style="width: 100px; padding-left: 10px; border: 1px solid
> Black;">padding</div><br>
> <div style="width: 100px; border: 1px black solid;">no padding</div>
> firefox increases the width of the div to 110px.
> ie includes the padding in the 100.
> is there an easier work-around than
> reducing the width by 10px if firefox?

Yes there is: stop using browsers for hyperspace experiments. The outer
div has width 100px and left padding 10px. The math tells us that you
have 90px of available width inside. And you insert there another div
of 100px width.


thanks but these are two separate divs used for illustration
(i am not inserting the other div)

This leaves the browser with two options only:
1) Transpode your div's into Riemann Space to accomodate both oblect on
the n-dimentional sphere.
2) Stay in the conventional Euclidean Space and change the size of one
of div's.

Strangely enough browsers prefer the Euclidean Space. You may file a
complain about it if you want. But if would be much simplier to use
realistic sizes.

And really <comp.infosystems.www.authoring.stylesheets> is the place to
put such questions.
Or <sci.math> if the hyperspace is really calling for you...

Jul 26 '05 #6
On 26/07/2005 01:14, VK wrote:

[Quoting levels adjusted]
cosmic foo wrote:
<div style="width: 100px; padding-left: 10px; border: 1px solid
Black;">padding</div><br>
<div style="width: 100px; border: 1px black solid;">no padding</div>
firefox increases the width of the div to 110px.
You need to be careful here: Firefox does nothing to the width. It is
the 100 pixels you requested. However, the box that completely contains
the element has been expanded by ten pixels of padding, and this is what
should happen.
ie includes the padding in the 100.
Clearly, your document must be rendered in Quirks mode, or the IE
version you're looking at is prior to 6.

Microsoft used a box model that was different than the one specified by
the W3C wherein the padding and borders of an element were considered to
be part of the width of that element, whereas CSS considers these to be
external and the width property refers solely to the content.
is there an easier work-around than
reducing the width by 10px if firefox?

Place your document into Standards mode by including a complete DOCTYPE
declaration and fix your style sheet. If you need (or want) to support
IE5.5 and earlier, you'll also want to read up on the "Box Model bug"
and it's solutions.
Yes there is: stop using browsers for hyperspace experiments. The outer
div has width 100px and left padding 10px. The math tells us that you
have 90px of available width inside.


No, it doesn't. Perhaps you should read a CSS specification (any of them
will do).

[snipped usual rubbish]

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Jul 26 '05 #7

"Michael Winter" <m.******@blueyonder.co.uk> wrote in message
news:Ab******************@text.news.blueyonder.co. uk...
On 26/07/2005 01:14, VK wrote:

[Quoting levels adjusted]
cosmic foo wrote:
<div style="width: 100px; padding-left: 10px; border: 1px solid
Black;">padding</div><br>
<div style="width: 100px; border: 1px black solid;">no padding</div>
firefox increases the width of the div to 110px.
You need to be careful here: Firefox does nothing to the width. It is
the 100 pixels you requested. However, the box that completely contains
the element has been expanded by ten pixels of padding, and this is what
should happen.
ie includes the padding in the 100.
Clearly, your document must be rendered in Quirks mode, or the IE
version you're looking at is prior to 6.

Microsoft used a box model that was different than the one specified by
the W3C wherein the padding and borders of an element were considered to
be part of the width of that element, whereas CSS considers these to be
external and the width property refers solely to the content.
is there an easier work-around than
reducing the width by 10px if firefox?


Place your document into Standards mode by including a complete DOCTYPE
declaration and fix your style sheet. If you need (or want) to support
IE5.5 and earlier, you'll also want to read up on the "Box Model bug"
and it's solutions.
Yes there is: stop using browsers for hyperspace experiments. The outer
div has width 100px and left padding 10px. The math tells us that you
have 90px of available width inside.


No, it doesn't. Perhaps you should read a CSS specification (any of them
will do).

[snipped usual rubbish]

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.

thanks.
Jul 26 '05 #8
"Michael Winter" <m.******@blueyonder.co.uk> wrote in message
news:Ab******************@text.news.blueyonder.co. uk...
On 26/07/2005 01:14, VK wrote:
Yes there is: stop using browsers for hyperspace experiments. The
outer
div has width 100px and left padding 10px. The math tells us that you
have 90px of available width inside.


No, it doesn't. Perhaps you should read a CSS specification (any of
them will do).


If you don't want a simple to understand explanation of the box models
used by IE (in Quirks mode or prior to version 6) and other browsers,
and ways of designing CSS to circumvent those diffferences, check out
<url:
http://www.communitymx.com/content/a...989953B6F20B41
/>.

I'm not endorsing their techniques, but I found the explanation of the
box model more informative than trying to read and understand the CSS
specification.

--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 27 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Red | last post: by
2 posts views Thread by Knoxy | last post: by
4 posts views Thread by Wilhelm Kutting | last post: by
13 posts views Thread by Amarendra | last post: by
36 posts views Thread by phil-news-nospam | last post: by
11 posts views Thread by john_aspinall | last post: by
5 posts views Thread by Hallvard B Furuseth | last post: by
12 posts views Thread by Kislay | last post: by
6 posts views Thread by maya | last post: by
3 posts views Thread by vippstar | last post: by
1 post views Thread by gcdp | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.