<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>zakkap - css, methodology, toolkit</title>
	<atom:link href="http://zakkap.com/feed" rel="self" type="application/rss+xml" />
	<link>http://zakkap.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sat, 22 Aug 2009 19:51:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Justified Text</title>
		<link>http://zakkap.com/css/justify-text-with-css</link>
		<comments>http://zakkap.com/css/justify-text-with-css#comments</comments>
		<pubDate>Sat, 22 Aug 2009 02:53:01 +0000</pubDate>
		<dc:creator>zakkap</dc:creator>
				<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://zakkap.com/?p=40</guid>
		<description><![CDATA[
element &#123; text-align:justify; &#125;

If you&#8217;ve never heard of justified text, I&#8217;m sure you&#8217;ve seen it. In fact &#8211; you&#8217;re looking at it right now! If you view my stylesheet, or in particular where I reference the body element, you&#8217;ll notice that I&#8217;ve applied the attribute text-align:justify;. This alters my typographical alignment or more simply known [...]]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">element <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span><span style="color: #993333;">justify</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>If you&#8217;ve never heard of justified text, I&#8217;m sure you&#8217;ve seen it. In fact &#8211; you&#8217;re looking at it right now! If you view my stylesheet, or in particular where I reference the <code class="attr">body</code> element, you&#8217;ll notice that I&#8217;ve applied the attribute <code class="attr">text-align:justify;</code>. This alters my typographical alignment or more simply known as the typesetting. Take a look at the differences:</p>
<p><small class="eg">justified text</small>Aenean erat ipsum, volutpat a lacinia a, accumsan quis justo. Suspendisse condimentum mattis elit, a egestas sapien tristique vitae. Integer tincidunt euismod felis at vestibulum. Nam sit amet tempor arcu. Vivamus enim mi, bibendum ut consequat vitae, tempor sit amet purus. Nullam ligula elit, consequat non viverra quis, varius interdum dolor. Nam et tellus quis libero vulputate tincidunt eget a orci. Donec congue ipsum in arcu blandit quis molestie tortor pulvinar. Pellentesque ultricies tincidunt velit, egestas aliquet erat aliquam quis. Nulla sem est, ornare nec vestibulum vitae, pharetra eget leo. Maecenas accumsan luctus massa eget aliquet.</p>
<p style="text-align:left;"><small class="eg">non-justified text (ragged right side)</small>Aenean erat ipsum, volutpat a lacinia a, accumsan quis justo. Suspendisse condimentum mattis elit, a egestas sapien tristique vitae. Integer tincidunt euismod felis at vestibulum. Nam sit amet tempor arcu. Vivamus enim mi, bibendum ut consequat vitae, tempor sit amet purus. Nullam ligula elit, consequat non viverra quis, varius interdum dolor. Nam et tellus quis libero vulputate tincidunt eget a orci. Donec congue ipsum in arcu blandit quis molestie tortor pulvinar. Pellentesque ultricies tincidunt velit, egestas aliquet erat aliquam quis. Nulla sem est, ornare nec vestibulum vitae, pharetra eget leo. Maecenas accumsan luctus massa eget aliquet.</p>
<p>Justified text primarily increases/decreases the spacing between words to line up words at the end of every line. This is a technique widely used in books and magazines. Justified text may also slightly alter the kerning (letter-spacing) and/or glyphs (element of writing).</p>
<p>Although justified text makes for a more elegant appearance, some people may not prefer it. In fact, people with dyslexia tend to find justified text harder to read. Though, dyslexia only effects an estimated 3%-4% of the population. This means you just may be justified in using it <img src='http://zakkap.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p class="ref">Reference: <a href="http://en.wikipedia.org/wiki/Justification_%28typesetting%29">Wikipedia &#8211; Justification</a></p>
]]></content:encoded>
			<wfw:commentRss>http://zakkap.com/css/justify-text-with-css/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Write Smarter CSS!</title>
		<link>http://zakkap.com/css/write-smarter-css</link>
		<comments>http://zakkap.com/css/write-smarter-css#comments</comments>
		<pubDate>Fri, 14 Aug 2009 19:44:05 +0000</pubDate>
		<dc:creator>zakkap</dc:creator>
				<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://localhost/zakkap/?p=9</guid>
		<description><![CDATA[I&#8217;d like to share with you a simple way to write CSS in a smarter/more efficient way.  I’m just beginning to design my website and currently at the point where I’m floating my sidebar next to my content.  If you&#8217;re unfamiliar with this technique, then read my article on the perfect two column [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;d like to share with you a simple way to write CSS in a smarter/more efficient way.  I’m just beginning to design my website and currently at the point where I’m floating my sidebar next to my content.  If you&#8217;re unfamiliar with this technique, then read my article on the perfect two column layout &#8211; otherwise, you&#8217;ll know that both the sidebar and content will need to be floated left. For this specific example, the content will be 70% in width leaving the sidebar to fulfill the remaining 30%. To make the example effective and realistic, the sidebar and content will also have a solid 2 pixel top border. First I&#8217;ll show you a bad example then an okay example&#8230; and last I&#8217;ll show you what I think would be the most logical way.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* bad example */</span>
<span style="color: #cc00cc;">#content</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">border-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">2px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;"><span style="color: #cc66cc;">70</span>%</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#sidebar</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;"><span style="color: #cc66cc;">30</span>%</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">border-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">2px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>The above example is not very good. I&#8217;ll explain why; in most programming languages <b>elimination of repetition is usually ideal</b> (don&#8217;t repeat yourself). As you can see I&#8217;ve defined <code class="attr">float:left;</code> and <code class="attr">border-top:2px solid #000;</code> for both the <code>#sidebar</code> and <code>#content</code> &#8211; which means I&#8217;m repeating each attribute twice. To avoid the repetition, I need only to place one instance of the attribute into what&#8217;s called a <i>concatenated</i> or combined style. One benefit of this technique will allow making changes to the <code>#content</code> and <code>#sidebar</code> easier. If later I decided I want to change to a one pixel border I would only have to edit the attribute in one place. Another benefit would be that I&#8217;ve reduced several lines of code therefore decreasing the time a browser takes in loading my stylesheet. You may have also noticed that I&#8217;ve placed the whole style onto one line. If I only have a few different attributes to put into a particular style &#8211; I tend to keep it all on one line. This can also benefit you by increasing your code&#8217;s readability as well as the overall management of your stylesheet in general.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* we're getting there */</span>
<span style="color: #cc00cc;">#content</span><span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#sidebar</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">border-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">2px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#content</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;"><span style="color: #cc66cc;">70</span>%</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#sidebar</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;"><span style="color: #cc66cc;">30</span>%</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>But that&#8217;s not enough for me! Remember what I said about repeating yourself? Since I&#8217;m already calling the <code>#content</code> (line 2) once there&#8217;s no reason to call it again &#8211; it&#8217;s unnecessary and extraneous. I can simply throw all of the attributes that I&#8217;ve placed in the second <code>#content</code> (line 3) in the above example into the first time I called it along with the <code>#sidebar</code> (line 2). Ah, yes that means that our <code>#sidebar</code> would gain a width of 70% since it&#8217;s concatenated alongside the <code>#content</code> therefore breaking my layout! We need a total combined width of 100% and can achieve this with use of <i>overriding</i> to nullify the <code>#content</code> specific attributes I&#8217;ve thrown into the concatenated style to reduce repetition. Take a look at the next example to understand the concept.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* smart example */</span>
<span style="color: #cc00cc;">#content</span> <span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#sidebar</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">border-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">2px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span>float<span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;"><span style="color: #cc66cc;">70</span>%</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#sidebar</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;"><span style="color: #cc66cc;">30</span>%</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>In the above example, the second time I called the <code>#sidebar</code> (line 3) CSS knows to ignore the first time (line 2) and <i>that</i> is overriding in action. I&#8217;ve successfully reduced my first example from a total line count of 10 (149 characters) to a minor line count of 2 (96 characters). Finally &#8211; it&#8217;s alphabetized. And that&#8217;s probably a little too much.</p>
<p><b>Important:</b> In the above example, the styles <code>#content, #sidebar</code> and the second <code>#sidebar</code> are both at the same <i>specificity</i>. If for example our code looked like the next example however the attribute that I wanted the <code>#sidebar</code> to override (the width) would not work. This is because the first time I called <code>#sidebar</code> now has a higher specificity with the addition of <code>body</code> in front of it. If you&#8217;re getting dizzy &#8211; read more about specificity.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#content</span> <span style="color: #00AA00;">,</span> body <span style="color: #cc00cc;">#sidebar</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">border-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">2px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span>float<span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;"><span style="color: #cc66cc;">70</span>%</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#sidebar</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;"><span style="color: #cc66cc;">30</span>%</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>It is important to realize that you can go too far. Use concepts like concatenation and overriding in combination to create more logical and faster parsing code. But sometimes it&#8217;s not the smartest choice and can cause more of a hassle than help. Just find a balance and you&#8217;ll be set.</p>
]]></content:encoded>
			<wfw:commentRss>http://zakkap.com/css/write-smarter-css/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
