Mandarin Logo
MainBlogFAQsBox TipsText TricksColor ChartFree GalleryCSS Opacity
TWO CENTS CURRENT ISSUE 2006 WEST SACRAMENTO CALIFORNIA
FAQsHTML and CSS Frequently Asked Questions
"For People Who Make Mistakes" ...

DIV to Center Squares

foxglove 1 Decorative images. fox3

Q: I just also took note from your May 30 'Little Squares' post, that you put the IMGs in their own DIV. What does that buy you? I want to understand more of this stuff.

A:The div is a container for the three images. I used it to center the images. That's all.

1. Images in a Div

foxglove 1 Decorative images. fox3

2. Images not in a Div

foxglove 1 Decorative images. fox3

One could use the paragraph tag or other block level tags to center the three squares but I like the way the <div align="center"> behaves.

<div align="center"> images go here... </div>

Another way, the more purist method I think, is to use <div style="margin:0px auto;">. But that doesn't work in every browser, particularly in one older browser that I use. Your mileage may vary.

<div style="margin:0px auto;"> images go here... </div>
Div to Center Squares
#  Last Updated:  Sunday, June 13, 2004
You are viewing one post
VIEW ALL    BACK TO TOP
MAIN BLOG FAQs CSS:Boxes TRICKS About CSS Style Color Chart GALLERY PureText
Validate HTML Validate Style Sheet Elements of Style Yahoo Buzz Google Zeitgeist Lycos 50 TP TP2 TF Technorati Sitemeter
Mandarin Archives 2005: J F M A M J J A S O N D   2004: J F M A M J J A S O N D   2003: J F M A M J J A S O N D   2002: F M A M J J A S O N D
Clean PC Banners Free Banners Tag Board Gator ColdFusion Fade Images Refer Grouping Web Help Drop Caps
This work is licensed under a Creative Commons License