Re: using css for centering
by Kid Stevens <Kidstevens(at)comcast.net>
|
Date: |
Mon, 03 Jun 2002 17:35:39 -0600 |
To: |
Darrell King <darrell(at)webctr.com>, hwg-techniques(at)hwg.org |
References: |
services king |
|
todo: View
Thread,
Original
|
|
See you are talking Windows I am talking the Web.
At 6:18 PM -0400 6/3/02, Darrell King wrote:
>Actually, you center a block-level element in compliant browsers with
>margin: auto. This does not work in IE5.5, but that is a browser bug and
>doesn't change the validity of the technique.
>
>As a workaround in IE5.5, you can place the block-level element to be
>centered inside a div that has text-align: center assigned to it. Then, to
>endure that compliant browsers also center the target element, assign
>margin: auto to that element as well.
>
>D
>
>
>----- Original Message -----
>From: "Kid Stevens" <
>
>A struggle I understand all too well. I use the latest program from
>Western Civilization to help and it seems that CSS does not have any true
>way to give every CSS1 compliant browser a center function. Padding and
>Margin is the only way I have found to do it. I can use percentages and
>define the right and left margins based on subtracting the width of the
>widest object from an arbitrary window size.
>
>largest element 320 px wide:
>Window base size 640 px wide:
>left-margin = 25%:
>right-margin =25%:
>leaving 25% on each side.
>Now if you could tell the bounding box for your element to be 50% the page
>stays centered all the time. No matter how large the window.
>
>CSS doesn't quite work that easy.
>
>Western has a lite tool for both Mac and Windows. http://www.westciv.com/
>
>At 11:26 AM -0400 6/3/02, Nate Harel wrote:
>>Hi all,
>>
>>I am trying to be a law abiding citizen and am working as much as I can
>>learning and using CSS.
>>
>>One of the things I am struggling with is how to center a design.
>>
>>I want to produce a page that is entirely centered on the page. Using
>>tables, this is easy. I simply make a table with a particular width and
>>center it. Then no matter the size of the screen, the contents are
>centered.
>>
>>How do I do the same with CSS?
>>
>>
>>Nate
>>
--
Sincerely,
Kid Stevens
"I spend so much time alone that I begin to lose my humanity."
Yes I stole that from the movie "Wing Commander" and changed 3 words to suit me
HWG hwg-techniques mailing list archives,
maintained by Webmasters @ IWA