473,800 Members | 2,541 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2236
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.infosystem s.www.authoring.stylesheets
--
Rob
Jul 25 '05 #2

"RobG" <rg***@iinet.ne t.auau> wrote in message
news:qa******** ********@news.o ptus.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.infosystem s.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.infosyste ms.www.authorin g.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**********@y ahoo.com> wrote in message
news:11******** **************@ g14g2000cwa.goo glegroups.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.infosyste ms.www.authorin g.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.******@bluey onder.co.uk> wrote in message
news:Ab******** **********@text .news.blueyonde r.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.******@bluey onder.co.uk> wrote in message
news:Ab******** **********@text .news.blueyonde r.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*****@agrico reunited.com>
comp.lang.javas cript 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
1843
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 1px on 3 sides. It looks the same in firefox and ie. Then the same box is wrapped in yet another box with a red border on the bottom. In Firefox the 'middle' box still has padding on only 3 sides, and the red border is showing on the bottom. In...
2
19188
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 stylesheet file: ..formContentTable
4
4289
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 <div id="padding0">
13
3895
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 keys; char padding;
36
3053
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 get this kind of inconsistent result. -- ----------------------------------------------------------------------------- | Phil Howard KA9WGN | http://linuxhomepage.com/ http://ham.org/ |
11
2470
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 either IE or Firefox. Ive done exactly the same with the left padding and thats worked fine. Whats the crack??? http://www.ainewmedia.co.uk/css_page.htm #bodyContent { font-family:Verdana, Arial, Helvetica, sans-serif;
5
4054
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 before fwrite(), to shut up memory debuggers like Valgrind about writing uninitialized data to the file. Simplified code: static const struct S default_value = ...; struct S s, t;
12
4808
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
4713
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 changing the width of it? (for example: I have a div that's 320px wide, content inside is 300px and I added padding-left:10px but it increased with of div to 330px.. I want width of it to remain 320px but I need a padding on the left of 10px..)
3
3866
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 find anything relevant to bit padding, only byte padding for structs, which more or less I understand. All sections are from n1256
0
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10274
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10033
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
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 we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2945
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.