On 11 May 2010, "Jenn" <> wrote:
> freemont wrote:
>> On Tue, 11 May 2010 19:28:11 -0500, Jenn writ:
>>>
>>> If you want to add padding this will work:
>>>
>>>
>>> #article
>>> {
>>> border: green solid 1px;
>>> width: 60%;
>>> float:left;
>>> border-collapse: collapse;
>>> }
>>>
>>> .article
>>> {
>>> margin: 0 auto 0 auto;
>>> padding: 0 8px 0 8px;
>>>
>>> }
>>>
>>>
>>> <div id="article" class="article"> //add this class to this div
>
>
>> Ahem.
>>
>> I will try to be nice(er).
>>
>> Please explain for all of us the difference between what you have
>> above, and the css that exists on the page now. Other than the
>> obvious difference in padding values and units.
>>
>> Why, WHY? create a new class just to put a couple of values into?
>> What does it accomplish?
>
>> For those not following along, the advantage of using the markup
>> above, as opposed to:
>>
>> #article
>> {
>> border: green solid 1px;
>> width: 65%;
>> float: left;
>> margin: 0 auto 0 auto;
>> padding: 0 2% 0 2%;
>> border-collapse: collapse;
>> }
>> <div id="article">
>>
>> /This/ I want to hear. Enlighten us.
>
>
>
> I did this to see if it would work:
>
> In order to test it, I created a class that would apply only to the
> margin and padding so I could test them separately.
>
> The #article ID deals with the div container .. like the border of a
> table, so I kept that separate from the class that deals with the
> padding and margins.
>
> I then resized the window width until it wouldn't get any smaller and
> then I gave the class a 4px left and right padding and then adjusted
> the % in the width of the #article until the right nav went into it's
> proper place. I got that to work.. then raised the pixels to 8px
> padding both left and right, and adjusted the #article width to 60%.
> If you want more padding, you will need to adjust the width. Keeping
> them separate gives you the option of using the class of that padding
> elsewhere.
>
> It works ok in IE, but if you resize the window in Firefox, which
> allows it to get even smaller than IE does the boxes on either sides
> move. I'm thinking in order to take care of that issue, the body
> style may need a static pixel width, but not sure since I haven't
> looked at it too closely yet.
The easy way to do this is wrap whatever div(s) is/are involved in
another div(s) and sizing each outer div while putting padding or
margins on the inner ones.
--
Neredbojias
http://www.neredbojias.org/
http://www.neredbojias.net/