Dave,

You're exactly right. This approach does require extra divs but 
according to the advice I frequently get from experts-exchange.com that 
is the best technique.

Here's an example:

Me: "I had a top margin on the left menu to bring it down but the top 
part of the text is hidden under the top menu."

EE: "If you put a margin on the left menu div, the div and margin 
together gets higher than the page. Put another div inside it and set 
the margin on that."

Me: "I created a div called leftMenuPad that sits inside of leftMenu and 
all is well on IE. On FF, however it's an entirely different story. The 
entire page is pushed down by the top margin set in leftMenuPad. I tried 
adding a contentPad like leftMenuPad for the section in grey but I get 
the same results. Works on IE but not on FF.

On IE the left menu now extends the length of the browser however the 
content body in grey does not."

EE: "Add top: 0; to the top menu class."

The "boundary" div provides the general characteristics required (width, 
height, etc.) and the "padding" div allows you to get more specific. 
This technique, at least for me, overcomes many browser deficiencies 
(i.e. IE/win) and works with with compliant browsers.

If you contact me offline I'd be happy to send you one of my CSS files 
so you can see the big picture.

- Tim


Dave M G wrote:
> Moxy,
>
> Thank you for responding.
>
>> I was advised to use padding early in my CSS learning. The 
>> recommendation was to create a "boundary div" specifying margin:0 and 
>> padding:0 as shown in #leftMenu and then define internal margins, 
>> padding in a "padding div" as shown in #leftMenuPad below. That 
>> approach has served me well.
>
> I am trying to understand the principle behind what you are suggesting 
> so that I might apply it to my situation.
>
> However, I don't quite grasp it. It seems that you are just putting in 
> an extra div with padding inside another div without padding. How 
> exactly does this make a difference?
>
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to