Did I get this html and css center div code right?

ChancyRatChancyRat Registered Users Posts: 2,141 Major grins
edited November 10, 2013 in SmugMug Customization
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.)
#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.

Comments

Sign In or Register to comment.