Forum Moderators: not2easy

Message Too Old, No Replies

making margins reduce beore content

how can i accomplish that?

         

Ghiro

9:12 am on Nov 23, 2004 (gmt 0)

10+ Year Member



Nice to meet you all.
I ' m kinda stuck here with a little misunderstanding with my friends Mozilla and Konqueror:

i have this content div:

div #content {
margin-left:auto;
margin-right:auto;
width:60%;

that correctly displays centered, but i'd like it to behave in a way that reducing the witdth of the page makes the the margins reduce first, and then when they totally disappear makes the div itself reduce gracefully.
i tried different solutions, for example forcing a minimal absolute width, but it clearly makes the div unstrechable. if i omitt the min-width, all the page (both margins and div content) is reducing proportionally.
Is there a way to accomplish the requested behavior?
all hints and suggestions are appriciated.

Thanks,
Luca Ghirotti

DrDoc

4:41 pm on Nov 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld! [WebmasterWorld.com]

Well, setting the width to 60% will make it 60% wide always, regardless of browser window width. So, what you want to do is set the width to 100%, but then specify a max-width (in pixels or some other fixed unit).

Ghiro

1:46 pm on Dec 21, 2004 (gmt 0)

10+ Year Member



thank you