473,322 Members | 1,504 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

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 2213
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Red | last post by:
This is apparently an ie display bug, I can't seem to figure out which ie bug this is. a 3 sided border is created by wrapping the 'inner' box in the 'middle' box and padding the 'middle' box...
2
by: Knoxy | last post by:
Hello, I've noticed one or two people post on this before but nobody seems to have replied so raising the issue again... is this a known IE6 CSS bug? I have placed the following in my...
4
by: Wilhelm Kutting | last post by:
hi, when i use the padding-left attribut, i like to overwrite a default value like that ..padding30 {margin-left: 30px;} ..padding0 {margin-left: 0px;} <div class="padding30"> Padding 30...
13
by: Amarendra | last post by:
Folks, This structure padding issue is bothering me now, could not locate a satisfactory answer on clc, so here it goes... I have a structure, given below: typedef struct { int flag; char...
36
by: phil-news-nospam | last post by:
Here is a simpler (no drop shadows) example of the padding bug I see: http://phil.ipal.org/usenet/ciwas/2006-05-08/buttons-1.html So far I find nothing in the CSS2 document that says I should...
11
by: john_aspinall | last post by:
I want to put a simple padding on the right hand side of my text container to stop the text from overflowing out of the box. Ive added a padding-right rule and it refusing to recognise it in...
5
by: Hallvard B Furuseth | last post by:
Does struct assignment copy padding bytes? Some compilers do, but I couldn't find anything in the standard which says they must. What I need is for any padding bytes to contan initialized values...
12
by: Kislay | last post by:
case 1 : struct s { char c1; // 8 double d; // 8 int i1; // 4 char c2; // 4 int i2; // 4 };
6
by: maya | last post by:
hi, I recently discovered the hard way that when you had padding-right or padding-left to a div it increases the with of the div... how do you add left-padding or right-padding to a div w/o...
3
by: vippstar | last post by:
Hey comp.lang.c I'm somewhat confused with bit padding. I tried searching the FAQ, but there isn't a search feature, so I used google and the search query: site:c-faq.com padding. I did not...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.