{"id":50,"date":"2006-04-19T09:41:44","date_gmt":"2006-04-19T14:41:44","guid":{"rendered":"http:\/\/stein.everybody.org\/brain\/css-advice\/"},"modified":"2011-03-10T10:57:33","modified_gmt":"2011-03-10T15:57:33","slug":"css-advice","status":"publish","type":"post","link":"https:\/\/jeremystein.com\/brain\/css-advice\/","title":{"rendered":"CSS Advice"},"content":{"rendered":"<ol>\n<li>Avoid fixed-position alignment.  It&#8217;s going to look bad on someone&#8217;s browser.  They might have large fonts or a small browser, etc.<\/li>\n<li>Consider using &#8220;em&#8221;-scaled sizes rather than &#8220;px&#8221;-scaled.  A  &#8220;width: 50em&#8221; will grow with the font where &#8220;width: 400px&#8221; won&#8217;t.  That&#8217;s particularly nice for the elderly who might bump up the font size on their browser.<\/li>\n<li>Before using a div or span, try to find an existing tag that matches what you&#8217;re trying to express.  You can still give it a class or id if it needs special formatting.  I mostly suggest this as a purist, but I suppose it would be helpful for screen readers or for old browsers that can&#8217;t handle CSS.<\/li>\n<li>IE is evil.  Test in IE.  It incorrectly implements the box model and widths don&#8217;t always work the way they should.<\/li>\n<li>When you can&#8217;t get it to work in CSS, just use a table.  Yeah, yeah, I know &#8212; that&#8217;s not the pure way.  Just blame it on buggy browsers.  It&#8217;s just one table &#8212; for major layout issues.  And you can set all the table\/row\/cell attributes through CSS.  Sometimes it is simply *not* possible to get things lined up the way you want with CSS.  Browsers have implemented tables very well for years.  They grow with text, things don&#8217;t leak out, and they&#8217;re good and dealing with fuzzy rules.  Try CSS first, but don&#8217;t kill yourself with CSS if a table will solve your problem.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Avoid fixed-position alignment. It&#8217;s going to look bad on someone&#8217;s browser. They might have large fonts or a small browser, etc. Consider using &#8220;em&#8221;-scaled sizes rather than &#8220;px&#8221;-scaled. A &#8220;width: 50em&#8221; will grow with the font where &#8220;width: 400px&#8221; won&#8217;t. That&#8217;s particularly nice for the elderly who might bump up the font size on their [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[],"class_list":["post-50","post","type-post","status-publish","format-standard","hentry","category-html"],"_links":{"self":[{"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/posts\/50","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/comments?post=50"}],"version-history":[{"count":0,"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/posts\/50\/revisions"}],"wp:attachment":[{"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/media?parent=50"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/categories?post=50"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/tags?post=50"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}