{"id":32,"date":"2009-08-29T13:36:00","date_gmt":"2009-08-29T19:36:00","guid":{"rendered":"http:\/\/benincosa.com\/blog\/?p=32"},"modified":"2014-11-19T11:27:19","modified_gmt":"2014-11-19T17:27:19","slug":"css-container-tricks","status":"publish","type":"post","link":"https:\/\/benincosa.com\/?p=32","title":{"rendered":"CSS container tricks"},"content":{"rendered":"<p>In CSS I always forget that when creating a box to put things in you want the box to expand with the contents that are inside of it.\u00a0 The secret to this I found out last year was to put overflow: auto in.<\/p>\n<p>Example:<\/p>\n<pre>content {<\/pre>\n<pre>\u00a0\u00a0\u00a0 background-color: #fff;\r\n    width: 960px;\r\n    margin: 0px auto;<\/pre>\n<pre>    overflow: auto;\r\n    text-align: left;\r\n}<\/pre>\n<p>The other trick was to put margin: 0px auto.\u00a0 That makes the element float in the middle of a page.\u00a0 This is the standard container CSS that I use.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In CSS I always forget that when creating a box to put things in you want the box to expand with the contents that are inside of it.\u00a0 The secret to this I found out last year was to put overflow: auto in. Example: content { \u00a0\u00a0\u00a0 background-color: #fff; width: 960px; margin: 0px auto; overflow:&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[24],"tags":[925,26],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/posts\/32"}],"collection":[{"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/benincosa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=32"}],"version-history":[{"count":2,"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/posts\/32\/revisions"}],"predecessor-version":[{"id":2852,"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/posts\/32\/revisions\/2852"}],"wp:attachment":[{"href":"https:\/\/benincosa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=32"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/benincosa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=32"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/benincosa.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=32"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}