Did I get this html and css center div code right?
ChancyRat
Registered Users Posts: 2,141 Major grins
I'm about to use this code in multiple galleries so hope to confirm I got it right first.
Goal is to center a table type box with description inside.
If I could have the code for padding left and right margins a bit, I don't think what I have in the html is right. I could not find consistent codes for this that worked.
Any other code I could/should use to help with formatting?
Is there a way to have the box resize automatically if the browser is resized? (The page is set to no-stretch.)
Thanks.
Goal is to center a table type box with description inside.
If I could have the code for padding left and right margins a bit, I don't think what I have in the html is right. I could not find consistent codes for this that worked.
Any other code I could/should use to help with formatting?
Is there a way to have the box resize automatically if the browser is resized? (The page is set to no-stretch.)
#box { width: 700px ; margin-left: auto ; margin-right: auto ; }
<div style="font-size: 20px;"> <div id="box"> <div style="background-color:#FFFDBA; border: 4px ridge #ccc; padding: 5px; color: #444; margin-right: 40px;">
Thanks.
0
Comments
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
Hey and thanks. The closing DIV is present, I just forgot to include it on DG.