{"id":904,"date":"2013-11-21T17:34:08","date_gmt":"2013-11-22T01:34:08","guid":{"rendered":"http:\/\/hellbach.us\/blog\/?p=904"},"modified":"2013-11-21T17:34:08","modified_gmt":"2013-11-22T01:34:08","slug":"css-measurements","status":"publish","type":"post","link":"https:\/\/hellbach.us\/blog\/tech\/dev\/css-measurements\/","title":{"rendered":"CSS Measurements"},"content":{"rendered":"<div class='__iawmlf-post-loop-links' style='display:none;' data-iawmlf-post-links='[{&quot;id&quot;:4471,&quot;href&quot;:&quot;http:\\\/\\\/demosthenes.info\\\/blog\\\/775\\\/Which-CSS-Measurements-To-Use-When&quot;,&quot;archived_href&quot;:&quot;&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[],&quot;broken&quot;:false,&quot;last_checked&quot;:null,&quot;process&quot;:&quot;new&quot;}]'><\/div>\n<h2><a href=\"http:\/\/demosthenes.info\/blog\/775\/Which-CSS-Measurements-To-Use-When\" target=\"_blank\" rel=\"nofollow\">Which CSS Measurements To Use When<\/a><\/h2>\n<ul>\n<li>\n<p><strong>Pixels (px)<\/strong><br \/><span style=\"text-decoration: underline;\">Use for:<\/span> hairline borders and general elements when creating fixed-width designs; values for <span style=\"text-decoration: underline;\">CSS shadow<\/span> displacement. Avoid using in @media breakpoints, as doing so <span style=\"text-decoration: underline;\">breaks pages when they are zoomed<\/span>: use rem or em instead. <br \/><span style=\"text-decoration: underline;\">Don\u2019t use for:<\/span> typography. (Exception: setting a base font-size in a <span style=\"text-decoration: underline;\">CSS reset<\/span>).<\/li>\n<li>\n<strong>Percentage (%)<\/strong><br \/> <span style=\"text-decoration: underline;\">Use for:<\/span> making <span style=\"text-decoration: underline;\">responsive images<\/span> and <span style=\"text-decoration: underline;\">containers<\/span>; setting height on the body in some cases. <br \/><span style=\"text-decoration: underline;\">Don\u2019t use for:<\/span> typography. (Exception: font-size <span style=\"text-decoration: underline;\">CSS reset<\/span>.)<\/li>\n<li><strong>em, ex<\/strong><br \/> <span style=\"text-decoration: underline;\">Use for:<\/span> typography, and elements related to typography (margins, for example), with the understanding that em and ex have a subtle \u201cgotchas\u201d when used in complex layouts. Consider using rem as an alternative.<\/li>\n<li><strong>Points and picas<\/strong><br \/> <span style=\"text-decoration: underline;\">Use for:<\/span> print stylesheets. <br \/><span style=\"text-decoration: underline;\">Don\u2019t use for:<\/span> anything else.<\/li>\n<li><strong>rem<\/strong><br \/> <span style=\"text-decoration: underline;\">Used as:<\/span> a more robust and predictable alternative to em and ex, and employed for the same purposes, including @media query breakpoints. <span style=\"text-decoration: underline;\">Don\u2019t use:<\/span> if you wish to support IE8 and earlier. Or, use the unit but include a fallback (by providing an alternate measurement in a more common unit before the rem measurement) or a polyfill.<\/li>\n<li><strong>Viewport units (vh &amp; vw)<\/strong><br \/> <span style=\"text-decoration: underline;\">Use for: responsive typography; \u201cperfect\u201d<\/span> responsive containers. What <span style=\"text-decoration: underline;\">not<\/span> to use the units for is difficult to determine, as vh &amp; vw are very new and have yet to be fully exploited in web design. Do be aware of their lack of support in IE 8, and allow for fallbacks.<\/li>\n<li><strong>Inches (in) and Centimeters (cm)<\/strong><br \/> <span style=\"text-decoration: underline;\">Use with:<\/span> print stylesheets, especially page margins <br \/><span style=\"text-decoration: underline;\">Don\u2019t use for:<\/span> anything else.<\/li>\n<li><strong>Character (ch)<\/strong><br \/> <span style=\"text-decoration: underline;\">Use when:<\/span> sizing and adjusting monospaced fonts. Be aware of browser support limitations.<\/li>\n<li><strong>Grid (gd)<\/strong><br \/> <span style=\"text-decoration: underline;\">Use for:<\/span> experimental layouts; the unit is only supported in IE10+ at this moment. <br \/><span style=\"text-decoration: underline;\">Polyfills<\/span> are beginning to appear, however.<\/li>\n<li><strong>Raw numbers<\/strong><br \/> While almost every CSS property requires that the measurement system be specified in the declaration, a few are best used with plain integer or floating-point values. In particular, line-height and border-image should be used with raw numbers.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Which CSS Measurements To Use When Pixels (px)Use for: hairline borders and general elements when creating fixed-width designs; values for CSS shadow displacement. Avoid using in @media breakpoints, as doing so breaks pages when they are zoomed: use rem or &hellip; <a href=\"https:\/\/hellbach.us\/blog\/tech\/dev\/css-measurements\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[],"class_list":["post-904","post","type-post","status-publish","format-standard","hentry","category-dev"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>CSS Measurements - Hellbach blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/hellbach.us\/blog\/tech\/dev\/css-measurements\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"CSS Measurements - Hellbach blog\" \/>\n<meta property=\"og:description\" content=\"Which CSS Measurements To Use When Pixels (px)Use for: hairline borders and general elements when creating fixed-width designs; values for CSS shadow displacement. Avoid using in @media breakpoints, as doing so breaks pages when they are zoomed: use rem or &hellip; Continue reading &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/hellbach.us\/blog\/tech\/dev\/css-measurements\/\" \/>\n<meta property=\"og:site_name\" content=\"Hellbach blog\" \/>\n<meta property=\"article:published_time\" content=\"2013-11-22T01:34:08+00:00\" \/>\n<meta name=\"author\" content=\"alex\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"alex\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/hellbach.us\/blog\/tech\/dev\/css-measurements\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/hellbach.us\/blog\/tech\/dev\/css-measurements\/\"},\"author\":{\"name\":\"alex\",\"@id\":\"https:\/\/hellbach.us\/blog\/#\/schema\/person\/9bf1a63e253268c42a6e9db64611c507\"},\"headline\":\"CSS Measurements\",\"datePublished\":\"2013-11-22T01:34:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/hellbach.us\/blog\/tech\/dev\/css-measurements\/\"},\"wordCount\":339,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/hellbach.us\/blog\/#\/schema\/person\/9bf1a63e253268c42a6e9db64611c507\"},\"articleSection\":[\"Dev\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/hellbach.us\/blog\/tech\/dev\/css-measurements\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/hellbach.us\/blog\/tech\/dev\/css-measurements\/\",\"url\":\"https:\/\/hellbach.us\/blog\/tech\/dev\/css-measurements\/\",\"name\":\"CSS Measurements - Hellbach blog\",\"isPartOf\":{\"@id\":\"https:\/\/hellbach.us\/blog\/#website\"},\"datePublished\":\"2013-11-22T01:34:08+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/hellbach.us\/blog\/tech\/dev\/css-measurements\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/hellbach.us\/blog\/tech\/dev\/css-measurements\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/hellbach.us\/blog\/tech\/dev\/css-measurements\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/hellbach.us\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CSS Measurements\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/hellbach.us\/blog\/#website\",\"url\":\"https:\/\/hellbach.us\/blog\/\",\"name\":\"Hellbach blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/hellbach.us\/blog\/#\/schema\/person\/9bf1a63e253268c42a6e9db64611c507\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/hellbach.us\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/hellbach.us\/blog\/#\/schema\/person\/9bf1a63e253268c42a6e9db64611c507\",\"name\":\"alex\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/hellbach.us\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9868a7f8fd709cd74cf51d978359a3ce66a47a17cd57185a9e1a4774d288e228?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9868a7f8fd709cd74cf51d978359a3ce66a47a17cd57185a9e1a4774d288e228?s=96&d=mm&r=g\",\"caption\":\"alex\"},\"logo\":{\"@id\":\"https:\/\/hellbach.us\/blog\/#\/schema\/person\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"CSS Measurements - Hellbach blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/hellbach.us\/blog\/tech\/dev\/css-measurements\/","og_locale":"en_US","og_type":"article","og_title":"CSS Measurements - Hellbach blog","og_description":"Which CSS Measurements To Use When Pixels (px)Use for: hairline borders and general elements when creating fixed-width designs; values for CSS shadow displacement. Avoid using in @media breakpoints, as doing so breaks pages when they are zoomed: use rem or &hellip; Continue reading &rarr;","og_url":"https:\/\/hellbach.us\/blog\/tech\/dev\/css-measurements\/","og_site_name":"Hellbach blog","article_published_time":"2013-11-22T01:34:08+00:00","author":"alex","twitter_card":"summary_large_image","twitter_misc":{"Written by":"alex","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/hellbach.us\/blog\/tech\/dev\/css-measurements\/#article","isPartOf":{"@id":"https:\/\/hellbach.us\/blog\/tech\/dev\/css-measurements\/"},"author":{"name":"alex","@id":"https:\/\/hellbach.us\/blog\/#\/schema\/person\/9bf1a63e253268c42a6e9db64611c507"},"headline":"CSS Measurements","datePublished":"2013-11-22T01:34:08+00:00","mainEntityOfPage":{"@id":"https:\/\/hellbach.us\/blog\/tech\/dev\/css-measurements\/"},"wordCount":339,"commentCount":0,"publisher":{"@id":"https:\/\/hellbach.us\/blog\/#\/schema\/person\/9bf1a63e253268c42a6e9db64611c507"},"articleSection":["Dev"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/hellbach.us\/blog\/tech\/dev\/css-measurements\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/hellbach.us\/blog\/tech\/dev\/css-measurements\/","url":"https:\/\/hellbach.us\/blog\/tech\/dev\/css-measurements\/","name":"CSS Measurements - Hellbach blog","isPartOf":{"@id":"https:\/\/hellbach.us\/blog\/#website"},"datePublished":"2013-11-22T01:34:08+00:00","breadcrumb":{"@id":"https:\/\/hellbach.us\/blog\/tech\/dev\/css-measurements\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/hellbach.us\/blog\/tech\/dev\/css-measurements\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/hellbach.us\/blog\/tech\/dev\/css-measurements\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/hellbach.us\/blog\/"},{"@type":"ListItem","position":2,"name":"CSS Measurements"}]},{"@type":"WebSite","@id":"https:\/\/hellbach.us\/blog\/#website","url":"https:\/\/hellbach.us\/blog\/","name":"Hellbach blog","description":"","publisher":{"@id":"https:\/\/hellbach.us\/blog\/#\/schema\/person\/9bf1a63e253268c42a6e9db64611c507"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/hellbach.us\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/hellbach.us\/blog\/#\/schema\/person\/9bf1a63e253268c42a6e9db64611c507","name":"alex","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/hellbach.us\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/9868a7f8fd709cd74cf51d978359a3ce66a47a17cd57185a9e1a4774d288e228?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9868a7f8fd709cd74cf51d978359a3ce66a47a17cd57185a9e1a4774d288e228?s=96&d=mm&r=g","caption":"alex"},"logo":{"@id":"https:\/\/hellbach.us\/blog\/#\/schema\/person\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/hellbach.us\/blog\/wp-json\/wp\/v2\/posts\/904","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hellbach.us\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hellbach.us\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hellbach.us\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hellbach.us\/blog\/wp-json\/wp\/v2\/comments?post=904"}],"version-history":[{"count":0,"href":"https:\/\/hellbach.us\/blog\/wp-json\/wp\/v2\/posts\/904\/revisions"}],"wp:attachment":[{"href":"https:\/\/hellbach.us\/blog\/wp-json\/wp\/v2\/media?parent=904"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hellbach.us\/blog\/wp-json\/wp\/v2\/categories?post=904"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hellbach.us\/blog\/wp-json\/wp\/v2\/tags?post=904"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}