HighDots Forums  

Centering and equal margins

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Centering and equal margins in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
wmasterj
 
Posts: n/a

Default Centering and equal margins - 05-03-2006 , 04:19 PM






I have a div
i want it to be max a certain width - thats done already
But - i want the empty sides of the div
to have the same width - like with frames (cols="*,800, *")
So no matter how much i resize the window, the div stays in the middle.
I should know this from before but i'm just blacking out and need some
help.

the page in doing it on is: http://dinpc.no-ip.com:83/portal/jeroen

Thx


Reply With Quote
  #2  
Old   
Jim Moe
 
Posts: n/a

Default Re: Centering and equal margins - 05-03-2006 , 05:22 PM






wmasterj wrote:
Quote:
I have a div
i want it to be max a certain width - thats done already
But - i want the empty sides of the div
to have the same width - like with frames (cols="*,800, *")

div { margin-left: auto; margin-right: auto; }

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)


Reply With Quote
  #3  
Old   
Barbara de Zoete
 
Posts: n/a

Default Re: Centering and equal margins - 05-04-2006 , 12:38 AM



On Wed, 03 May 2006 23:19:15 +0200, wmasterj <vde.jeroen (AT) gmail (DOT) com> wrote:

Quote:
I have a div
i want it to be max a certain width - thats done already
But - i want the empty sides of the div
to have the same width - like with frames (cols="*,800, *")
So no matter how much i resize the window, the div stays in the middle.
If you set no width for the div, the content will resize with the size of
the viewport and you wouldn't have that problem.

Quote:
the page in doing it on is: http://dinpc.no-ip.com:83/portal/jeroen
Ouch. You have bigger problems then just centering that div. Nine
different stylesheets? Hidden content? Pixel perfect design? Micro fonts?

Is this some template you're trying to readjust?

Anyway, putting a block level element centered in its parent block level
element:

div {
margin:$top auto $bottom auto; }

But you should really read some things on liquid design, font sizes and
such.


--
______PretLetters:

Reply With Quote
  #4  
Old   
wmasterj
 
Posts: n/a

Default Re: Centering and equal margins - 05-04-2006 , 07:07 AM



Quote:
Ouch. You have bigger problems then just centering that div. Nine
different stylesheets? Hidden content? Pixel perfect design? Micro fonts?

Is this some template you're trying to readjust?
Yes it is, it's a Plone/Zope CMS. Not mine, had to jump in to it. Crazy
but with a little bit effort i think it will work great.

Quote:
But you should really read some things on liquid design, font sizes and
such.
Is that a homepage or an expression? I have been in the army (swedish)
10 months, so now when i'm coming back it's quite alot to catch up on.
I can google it but if you have any especially good page i can look at
that would be helpfull.

Thank you both!

Jeroen van den Eijkhof
vde.jeroen (AT) gmail (DOT) com.invalid
"Dead fish float alongstream,
living fish swim against the stream"



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.