Okay, I was half right before, just mixed up the margin and padding
positions. The width is still only of the inside content with the margin and
padding being added to that. Here's the w3c specs if anyone cares:

---
The width of an element is the width of the content, i.e., the distance
between left inner edge and right inner edge.

The horizontal position and size of a non-floating, block-level element is
determined by seven properties: 'margin-left', 'border-left',
'padding-left', 'width', 'padding-right', 'border-right' and 'margin-right'.
The sum of these seven is always equal to the 'width' of the parent element.
---

So Raymond, the solution you came up with of nesting the elements to get the
effect you want is a fine example of both these rules used together.

-Kevin

----- Original Message ----- 
From: "Kevin Graeme" <[EMAIL PROTECTED]>
To: "CF-Community" <[EMAIL PROTECTED]>
Sent: Tuesday, September 02, 2003 9:49 AM
Subject: Re: simple css question


> Well hell. You made me go and double-check myself, and it looks like
you're
> right. Here's the w3c page:
> http://www.w3.org/TR/CSS1#block-level-elements
>
> Grrr. And I thought I was sure on this because I had just run into it
> working on something last night. Sorry Raymond. Now I have to go back and
> look at what I was doing at 2am.
>
> -Kevin
>
> ----- Original Message ----- 
> From: "Ben Doom" <[EMAIL PROTECTED]>
> To: "CF-Community" <[EMAIL PROTECTED]>
> Sent: Tuesday, September 02, 2003 9:41 AM
> Subject: RE: simple css question
>
>
> > My understanding is that padding is supposed to be inside, and margin is
> > supposed to be outside, but not all browsers render it that way.  I've
> > noticed differences, for example, between Mozilla and Safari which are
> both
> > different from IE6/Win.
> >
> > IE5/Mac is just fubared.
> >
> > Anyway, the only way I know of to fix this is with JS.
> >
> > HTH.
> >
> >
> > --  Ben Doom
> >     Programmer & General Lackey
> >     Moonbow Software, Inc
> >
> > : -----Original Message-----
> > : From: Raymond Camden [mailto:[EMAIL PROTECTED]
> > : Sent: Tuesday, September 02, 2003 10:15 AM
> > : To: CF-Community
> > : Subject: simple css question
> > :
> > :
> > : I've got this style def:
> > :
> > : .header {
> > : color: #dd0000;
> > : font-family: Verdana, Arial, Helvetica, sans-serif;
> > : font-size: 24px;
> > : font-weight: bold;
> > : border: thin solid;
> > : padding: 5px;
> > : width: 100%;
> > : }
> > :
> > : which works fine, except that the box stretches past the right edge of
> > : the browser. It's like width is calculated first, then padding is
added
> > : but instead of creating a padding _inside_ the box, the box has 10
> > : pixels added to it's width. I assume I've made a simple mistake, but I
> > : don't see it.
> > :
> > : -rc
> > :
> > :
> > :
> >
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:5
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:5
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.5

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com

Reply via email to