Centering content blocks with the "stretchy" layout
zubenelgenubi
Registered Users Posts: 67 Big grins
Hi,
I have what I hope is a simple question regarding page layout.
If I customize a smugmug page to use the "fixed" layout, then I'm given the option to specify that content blocks (a text box, for example) will be centered horizontally on the page. That's good; there's lots of times when I'd like that. But to use the fixed layout you have to specify a fixed pixel width, which seem like a bad idea given the huge range of screen resolutions that clients might use when browsing content.
So I'd far prefer to use the "stretchy" layout. But when I select that, I lose the option to center my content blocks. (I can't imagine why?) In any case the only way I can see to *force* a text box to be centered under the stretchy layout is to specify 100% for its width. This often looks ugly. So, does anyone know of a way to specify that all content blocks will be centered when used in the stretchy layout, even if their width is significantly less than 100%? Well actually, I'd be happy for now if I could just make a text box that is less than 100% wide be centered in the stretchy layout. I'm guessing there's a simple property I can set using some CSS code to achieve this. Not seeing any previous posts explaining how to do it, I even tried guessing how to do it in CSS, but so far without luck.
So, if anyone knows how to do it, I'd love to hear the solution!
Thanks,
- Mark
I have what I hope is a simple question regarding page layout.
If I customize a smugmug page to use the "fixed" layout, then I'm given the option to specify that content blocks (a text box, for example) will be centered horizontally on the page. That's good; there's lots of times when I'd like that. But to use the fixed layout you have to specify a fixed pixel width, which seem like a bad idea given the huge range of screen resolutions that clients might use when browsing content.
So I'd far prefer to use the "stretchy" layout. But when I select that, I lose the option to center my content blocks. (I can't imagine why?) In any case the only way I can see to *force* a text box to be centered under the stretchy layout is to specify 100% for its width. This often looks ugly. So, does anyone know of a way to specify that all content blocks will be centered when used in the stretchy layout, even if their width is significantly less than 100%? Well actually, I'd be happy for now if I could just make a text box that is less than 100% wide be centered in the stretchy layout. I'm guessing there's a simple property I can set using some CSS code to achieve this. Not seeing any previous posts explaining how to do it, I even tried guessing how to do it in CSS, but so far without luck.
So, if anyone knows how to do it, I'd love to hear the solution!
Thanks,
- Mark
0
Comments
You might try a variation of the code that Hikin' Mike posted in the thread Centering a content box.
--- Denise
Musings & ramblings at https://denisegoldberg.blogspot.com
.sm-page-widget-1234567 {
width: XXXpx;
margin: 0 auto;
}
Might play with min-width and max-width.
My Website index | My Blog
Thanks - I looked through Hikin' Mike's thread, as you suggested, and indeed I did find the solution I was after. The "margin" property did the trick for me. (See Mike's thread for details of what worked for me.)
Thanks,
- Mark
URL]http://zubenelgenubi.smugmug.com[/URL
Glad to help.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk