| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
Held Together!
|
CSS centering issues
Hey, on my site I'm trying to have all of the thumbnails centred on the white 'content' div. Unfortunately being a fluid layout anything I try seems to fail miserably. Could anyone give me a friendly nudge in the right direction? One other thing, I trying to make the site as XHTML 1.0 Strict, but am having a few issues, again with centering. If I try and validate it at the minute I get an error, flagging <div align="center"> as being invalid. Does anyone know how I can get around this, using css to center the content but in a strict compliant way? Thanks! P.S. Could people refrain from critting the design, I'm gonna post in the showcase where everyone can have a bash once I've got the coding right. Feel free to point out any coding errors or faux pas Last edited by LOI Kratong : 30-10-2006 at 04:08. |
|
|
|
|
|
#2 (permalink) |
|
i'm done, son
Join Date: Jan 2005
Posts: 12,262
|
You can center things by: <div class="someContainerElement"> <img src="/path/to/image.jpg" /> <p>Caption!</p> </div> .someContainerElement { text-align: center; } .someContainerElement img, .someContainerElement p { margin: 0 auto; text-align: left; } Alternatively, you should be able to use the selector: ".someContainerElement *", which should center everything inside someContainerElement. |
|
|
|
#3 (permalink) |
|
Held Together!
|
That isn't working for me, although I don't doubt the code as I've seen it in many places. My thumbnails are placed as an unordered list, but I'm not sure how to get the entire block of thumbnails centred inside the content div. Are there any other suggestions? |
|
![]() |