Help - Search - Members - Calendar
Full Version: Need Help With Sidebar Code
Movable Type Community Forum > Additional Resources > Tips and Tricks
cowm007
Hey,

I am working on a new template for my site. I'm trying a "modular" approach, where every element is in it's own box with background, etc. Check it out to see for yourself here: GotMex.net

I need help with the sidebar because I have not been able to figure out how to center each of the elements in it. Right now, they are all aligned left which looks fine, but a centered alignment would make it look much more modular like I want it. I know how to center elements using CSS, but only by giving them a specific width and using the "margin-left: auto; margin-right: auto;". In this case, I want the width's of each element to be unspecified so that they can grow or shrink depending on font-size the user uses.

I have tried many things and I am starting to think this might not be possible so any help would be greatly appreciated.
cowm007
So after hours of searching and trial and error, I found out a way to do this content centering. Basically, what I did was give each div that I needed centered the margin-left/margin-right auto attributes, and then gave it the attribute "display: table;" Frankly, I am not sure why that worked, but I am grateful for the website I saw that from.

It'd still be nice if anyone else that knew how to accomplish this would let me know. I'm always hungry to find out the limits of CSS design.

CowM007
Hil
hi cowm007

definitely can't help...i'm a newbie.

but i just wanted to say that i like your site design. i have no idea how you even did that but i like it anyway!

huh.gif smile.gif

hil
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.