473,326 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Centering and equal margins

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

May 3 '06 #1
3 2726
wmasterj wrote:
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)
May 3 '06 #2
On Wed, 03 May 2006 23:19:15 +0200, wmasterj <vd********@gmail.com> wrote:
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.
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:
| weblog | http://www.pretletters.net/weblog/weblog.html |
| webontwerp | http://www.pretletters.net/html/webontwerp.html |
|zweefvliegen | http://www.pretletters.net/html/vliegen.html |
May 4 '06 #3
> 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.
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
vd********@gmail.com.invalid
"Dead fish float alongstream,
living fish swim against the stream"

May 4 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Erik Schulp | last post by:
Hi all, I am trying to get a CSS defined layout to center on the page, have tried doing this with the <center></center> tags but than everything is centered, including text etc etc. What...
3
by: Haines Brown | last post by:
I thought I had understood this issue and implemented a work around, but now when I check on IE5, it is not working: ... #IE-hack { margin-left: auto; margin-right: auto; width: 20em;...
9
by: Pierre Jelenc | last post by:
Is there a way to center (horizontally) a UL list of unknown width? I can put it in a DIV that's centered with "margin-left: auto; margin-right: auto;" but I then have to specify a width; otherwise...
15
by: red | last post by:
How do I center two side by side divs ? I've been writing css pages for a while but there's one thing tha still eludes me. I can center a div with margin auto. I can place two divs side by side...
13
by: Raffi | last post by:
Hi, We have an application that requires IE. We recently incorporated CSS scroll areas. The scroll fields are supposed to be centered. They are except for IE5 for the Mac. I have tried various...
1
by: Arnost Sobota | last post by:
Hello, I am aware that the correct way to center a block-level element is to set the left and right margins to auto. However, this seems to only if the element to be centered has a width...
5
by: Markus Ernst | last post by:
Hello This is a test example: http://www.markusernst.ch/anthracite/ http://www.markusernst.ch/anthracite/living_divani.html After googling and experimenting for several hours, I ended up...
4
by: lister | last post by:
I am trying to center a DIV horizonally, but I want the DIV fluid so that it is just wide enough to encompass its contents. I've tried margin:auto with no joy :( I've set up a demo here:...
9
by: CJM | last post by:
I've inserted a new banner in an existing page and I want the banner image to be centered (horizontally) within its container. I'm not bothered whether the accompanying line of text is restricted...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.