{"id":792,"date":"2008-12-11T12:54:21","date_gmt":"2008-12-11T11:54:21","guid":{"rendered":"http:\/\/www.maratz.com\/blog\/?p=792"},"modified":"2009-04-14T07:15:35","modified_gmt":"2009-04-14T06:15:35","slug":"episode-three-mark-it-up","status":"publish","type":"post","link":"http:\/\/www.maratz.com\/blog\/archives\/2008\/12\/11\/episode-three-mark-it-up\/","title":{"rendered":"Episode Three: Mark it up!"},"content":{"rendered":"<div class=\"alignleft-pull pullquote\">\n<p>This is the third part of the series, \u201c<a href=\"http:\/\/www.maratz.com\/blog\/archives\/2008\/11\/23\/environmental-friendly-css-the-series\/\">Environmental friendly CSS<\/a>\u201d<\/p>\n<\/div>\n<p>In the previous episodes we\u2019ve <a href=\"http:\/\/www.maratz.com\/blog\/archives\/2008\/11\/27\/episode-one-prepare-your-content-and-interface-copy\/\">created a creative\/technical brief<\/a> and then <a href=\"http:\/\/www.maratz.com\/blog\/archives\/2008\/12\/04\/episode-two-visually-design-information-elements-and-user-interface\/\">mocked-up design<\/a> in Photoshop. The next step in a process is creating solid XHTML markup. Let&#8217;s open it up with a question:<\/p>\n<h2>How to markup category cloud?<\/h2>\n<p>There are two simple approaches that usually comes to mind at first: a paragraph and an unordered list.<\/p>\n<p>If we use paragraph with links, we wouldn&#8217;t probably miss it in terms of the default presentation across the range of User Agents. The thing is \u2014 if one is marking-up a \u2018cloud\u2019, it&#8217;s natural that all the links are inline, one after another.<\/p>\n<blockquote><p>\u2014 Let me think about it! Yea, I will just set <code>text-alignment: center<\/code> to that paragraph and I&#8217;m done. Great!<\/p><\/blockquote>\n<p><!--more--><\/p>\n<div><code><\/p>\n<pre>&#60;div id=\"category-cloud\"&#62;\r\n\t&#60;h4&#62;Most popular joke types and categories&#60;\/h4&#62;\r\n\t&#60;p&#62;\r\n\t\t&#60;a href=\"#\"&#62;Political jokes&#60;\/a&#62;\r\n\t\t&#60;a href=\"#\"&#62;Professional humor&#60;\/a&#62;\r\n\t\t&#60;a href=\"#\"&#62;Mathematical jokes&#60;\/a&#62;\r\n\t\t&#60;a href=\"#\"&#62;Ethnic jokes&#60;\/a&#62;\r\n\t\t&#60;a href=\"#\"&#62;British tell jokes&#60;\/a&#62;\r\n\t\t&#60;a href=\"#\"&#62;Self-deprecating humor&#60;\/a&#62;\r\n\t\t&#60;a href=\"#\"&#62;Blonde jokes&#60;\/a&#62;\r\n\t\t&#60;a href=\"#\"&#62;Redneck jokes&#60;\/a&#62;\r\n\t&#60;\/p&#62;\r\n&#60;\/div&#62;<\/pre>\n<p><\/code><\/div>\n<p><strong>Not great!<\/strong> The above code is wrong. The \u2018cloud\u2019 is a visual cue, not the structural element. The category cloud is \u2014 in its essence \u2014 a list of categories, so the more suitable XHTML element would be unordered list.<\/p>\n<h2>It&#8217;s not a cloud, it&#8217;s a list<\/h2>\n<p>Cloud as typography or XHTML element doesn&#8217;t exist. Tag or category <strong>cloud is a visual representation  of the list<\/strong> of categories. So let&#8217;s try semantically correct markup \u2014 an unordered list.<\/p>\n<div><code><\/p>\n<pre>&#60;div id=\"categories\"&#62;\r\n\t&#60;h4&#62;Most popular joke types and categories&#60;\/h4&#62;\r\n\t&#60;ul&#62;\r\n\t\t&#60;li&#62;&#60;a href=\"#\"&#62;Political jokes&#60;\/a&#62;&#60;\/li&#62;\r\n\t\t&#60;li&#62;&#60;a href=\"#\"&#62;Professional humor&#60;\/a&#62;&#60;\/li&#62;\r\n\t\t&#60;li&#62;&#60;a href=\"#\"&#62;Mathematical jokes&#60;\/a&#62;&#60;\/li&#62;\r\n\t\t&#60;li&#62;&#60;a href=\"#\"&#62;Ethnic jokes&#60;\/a&#62;&#60;\/li&#62;\r\n\t\t&#60;li&#62;&#60;a href=\"#\"&#62;British tell jokes&#60;\/a&#62;&#60;\/li&#62;\r\n\t\t&#60;li&#62;&#60;a href=\"#\"&#62;Self-deprecating humor&#60;\/a&#62;&#60;\/li&#62;\r\n\t\t&#60;li&#62;&#60;a href=\"#\"&#62;Blonde jokes&#60;\/a&#62;&#60;\/li&#62;\r\n\t\t&#60;li&#62;&#60;a href=\"#\"&#62;Redneck jokes&#60;\/a&#62;&#60;\/li&#62;\r\n\t&#60;\/ul&#62;\r\n&#60;\/div&#62;<\/pre>\n<p><\/code><\/div>\n<p>Some novice CSS developers in the past argued that they were having troubles with list-items in tag clouds. In the last article (coming up next week) we will explain it throughout. But, it&#8217;s very important to <strong>learn how to shift from visual\/CSS mindset to semantic\/contextual XHTML mindset<\/strong>.<\/p>\n<h2>A little practice will get you there<\/h2>\n<p>When deciding on the XHTML structure for any given element, <strong>try to ignore the design at first<\/strong>. You will easily modify markup later if you find no other way to accomplish layout only with CSS.<\/p>\n<p>Instead, dive-in under the surface and check the bare-naked content and context to decide what markup should do the job.<\/p>\n<p>If creating XHTML snippets is a second nature to you, please share how do <em>you<\/em> <strong>fight your thoughts about how it&#8217;s going to look<\/strong> when choosing appropriate markup?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is the third part of the series, \u201cEnvironmental friendly CSS\u201d In the previous episodes we\u2019ve created a creative\/technical brief and then mocked-up design in Photoshop. The next step in a process is creating solid XHTML markup. Let&#8217;s open it up with a question: How to markup category cloud? There are two simple approaches that [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,18],"tags":[],"_links":{"self":[{"href":"http:\/\/www.maratz.com\/blog\/wp-json\/wp\/v2\/posts\/792"}],"collection":[{"href":"http:\/\/www.maratz.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.maratz.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.maratz.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.maratz.com\/blog\/wp-json\/wp\/v2\/comments?post=792"}],"version-history":[{"count":0,"href":"http:\/\/www.maratz.com\/blog\/wp-json\/wp\/v2\/posts\/792\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.maratz.com\/blog\/wp-json\/wp\/v2\/media?parent=792"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.maratz.com\/blog\/wp-json\/wp\/v2\/categories?post=792"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.maratz.com\/blog\/wp-json\/wp\/v2\/tags?post=792"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}