Topic: Annoying CSS alignment problem (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=21921" title="Pages that link to Topic: Annoying CSS alignment problem (Page 1 of 1)" rel="nofollow" >Topic: Annoying CSS alignment problem <span class="small">(Page 1 of 1)</span>\

 
Grover
Neurotic (0) Inmate
Newly admitted

From:
Insane since: May 2004

posted posted 05-24-2004 09:22

I'm trying to align a table with a picture I have on my page and I can't for the life of me figure out how.
Basically I have a banner on the top of my page and I'd like to align the left side of my table with the left side of the banner. My knowledge of CSS being less than perfect, I can't get it to align at all.
I know that if I were to use a table, it'd take me about 10 seconds to get it fixed, but I'm trying to avoid using tables as much as possible.
I already have one, which is being used as a menu, I'd like to avoid nesting it within another. And if I eventually figure this out, I'll probably get rid of that table anyway and turn it into divs.
I tried doing a search, but it didn't turn out anything interesting, nor did looking through pages of posts
Can anyone help me out a little?

Blaise
Nervous Wreck (II) Inmate

From:
Insane since: Jun 2003

posted posted 05-24-2004 10:16

Try absolutely positioning your elements (position: absolute; ) then you can specify top and left properties, alternatively you could try and set the margins for each element.

Remember though that tables have borders and padding set as default so if you don't specify these they may make things look out of alignment.

If you're using a table for a menu, I assume you have one column and lots of rows? or lots of rows and one column? If this is the case try looking into using an unordered list (<ul> and list elements (<li>, the ul will work as a div because it's a block level element.

Let us know how you get on.

Cheers,

Blaise

(Edited by Blaise on 05-24-2004 10:16)

Grover
Obsessive-Compulsive (I) Inmate

From:
Insane since: May 2004

posted posted 05-24-2004 18:12

The problem with absolute positioning is that it doesn't scale well when you view it on a lower resolution.
My banner is 748 pixels wide, and it's centered. If i position it absolutely, it'll either be too far to the left at high resolution or too far to the right at lower resolutions, unless I set up a resolution script to figure out which resolution is being used, but that's jsut a hassle as well.

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 05-24-2004 18:29

Can you post the page?

There are a ton of variables here, and without seeing the page it leaves us shooting in the dark...

One thing is for certain though - don't use absolute positioning for something like this!

I X I
Bipolar (III) Inmate

From: beyond the gray sky
Insane since: Apr 2004

posted posted 05-25-2004 01:05

I'm learning CSS as well. You can check out my post and see my site transform from a table hack to using CSS. There are MANY links that other inmates have posted that were very helpful.

http://www.ozoneasylum.com/21796

Also, feel free to comment about my site, I always like to hear what other people think.

quote:
DL-44 said:

Can you post the page?



This would be very helpful.

Hope you get it figured out,




...Of all the things I've lost, I miss my mind the most (ozzy osbourne)



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu