<?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>Likesalmon Design &#187; CSS</title>
	<atom:link href="http://www.likesalmondesign.com/category/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.likesalmondesign.com</link>
	<description>Open Source Web Design and Development from Scratch</description>
	<lastBuildDate>Tue, 15 Jun 2010 03:51:47 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>FTOB: Set height and width for anchors with display:block</title>
		<link>http://www.likesalmondesign.com/ftob-set-height-and-width-for-anchors-with-displayblock/</link>
		<comments>http://www.likesalmondesign.com/ftob-set-height-and-width-for-anchors-with-displayblock/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 22:14:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[From the old blog]]></category>
		<category><![CDATA[Tests]]></category>

		<guid isPermaLink="false">http://www.likesalmondesign.com/?p=62</guid>
		<description><![CDATA[Originally posted on 10/25/08 at http://likesalmon.wordpress.com
Turns out the width and height properties only work on anchor tags when used in conjunction with display:block.  WTF?
So this does not work:
a { width: 100px; height: 100px; }
But this does:
a { width: 100px; height: 100px; display:block; }
Again, have I seriously never run into this before?  Do I [...]]]></description>
			<content:encoded><![CDATA[<p>Originally posted on 10/25/08 at http://likesalmon.wordpress.com</p>
<p>Turns out the width and height properties only work on anchor tags when used in conjunction with <code>display:block</code>.  WTF?</p>
<p>So this does not work:<br />
<code>a { width: 100px; height: 100px; }</code></p>
<p>But this does:<br />
<code>a { width: 100px; height: 100px; display:block; }</code></p>
<p>Again, have I seriously never run into this before?  Do I always just give up and work around this problem?  Denial ain&#8217;t just a river in Egypt.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.likesalmondesign.com/ftob-set-height-and-width-for-anchors-with-displayblock/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FTOB: CSS width property does exactly what you would expect it to</title>
		<link>http://www.likesalmondesign.com/ftob-css-width-property-does-exactly-what-you-would-expect-it-to/</link>
		<comments>http://www.likesalmondesign.com/ftob-css-width-property-does-exactly-what-you-would-expect-it-to/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 22:13:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[From the old blog]]></category>
		<category><![CDATA[Tests]]></category>

		<guid isPermaLink="false">http://www.likesalmondesign.com/?p=59</guid>
		<description><![CDATA[Originally posted on 10/19/08 at http://likesalmon.wordpress.com
The other day I was laying out a wordpress driven site in css and realized that I didn&#8217;t actually understand how the &#8220;width&#8221; property works.  This was extremely embarrassing to admit to myself, because it means I&#8217;ve been flubbing and cheating my way through the layout of every website [...]]]></description>
			<content:encoded><![CDATA[<p>Originally posted on 10/19/08 at http://likesalmon.wordpress.com</p>
<p>The other day I was laying out a wordpress driven site in css and realized that I didn&#8217;t actually understand how the &#8220;width&#8221; property works.  This was extremely embarrassing to admit to myself, because it means I&#8217;ve been flubbing and cheating my way through the layout of every website I&#8217;ve developed so far.  Its one the things that fell through the cracks because of limited time or lack of will.  So I did a little testing and it turns out the width property works in the most obvious way possible, with one exception.  Here are the results of my test:</p>
<p>All of the following boxes are div elements set to <code>width: 200px; height: 200px</code> and <code>background-color: #ccc</code>.  I use lots of <a title="Examples of the CSS padding shorthand property on the W3 schools website" href="http://www.w3schools.com/css/pr_padding.asp">shorthand</a>, so you&#8217;ll want to review that or this won&#8217;t make much sense.  I performed this test in Firefox 3 so I trust that this behavior is the standard.</p>
<p><em>The following code was removed because it was breaking my layout &#8212; ed.</em></p>
<div class="box" style="margin: 20px 0pt; background-color: #cccccc; width: 200px; height: 200px;">This is the basic box.  No other styling has been added.  If you add more text to the box than the box can hold, it will flow outside the box, but the box will remain the same size.  To cut the text off at the edges of the box use &#8220;overflow: hidden&#8221;.</div>
<div id="one" class="box" style="border: 10px solid black; margin: 20px 0pt; background-color: #cccccc; width: 200px; height: 200px;">The <em>border</em> property of this box is set to <code>border: 10x;</code>. Notice how the inner box is still 200px by 200px.  The border has been added to the outside.  The total dimensions of the div are now 220px by 220px.</div>
<div class="box" style="margin: 40px; background-color: #cccccc; width: 200px; height: 200px;">The <em>margin</em> of this box is set to <code>margin: 40px</code>. The space it now takes up is 280px by 280px. Margins appear to behave exactly like borders, except they are always transparent.</div>
<div class="box" style="margin: 20px 0pt; padding: 10px; background-color: #cccccc; width: 200px; height: 200px;margin-bottom:50px">The <em>padding</em> of this box is set to <code>padding: 10px;</code>.  Notice how this expanded the box 10px on each side, for a total height and width change of 20px. This is the one unexpected behavior I encountered: I figured it would constrain the contents of the box instead of expanding the box itself.</div>
<div style="padding: 10px; background-color: #cccccc; width: 200px; height: 200px;margin-bottom:70px">This box is like the last one, with <code>padding: 10px;</code>.  The difference is that this one is <em>nested inside a div</em> with <code>width: 200px; height: 200px;</code>.  Unless the <code>overflow: hidden;</code> property is set, this makes no difference at all.  The box still expands to 220px by 220px and overflows the container div.</div>
<div id="six" class="box" style="background-color: #cccccc; width: 200px; height: 200px;">This box is <em>contained within a div</em> that is 100px smaller than it is.  This only makes a difference if you use &#8220;overflow: hidden&#8221;, which will cut off the edges of the box where the container div ends.  Keep in mind that the next element on the page will butt up against the parent div and will be overlapped by the over-sized box contained therein.  I had to adjust the margin of the <code>&lt;p&gt;</code> element that follows this div so they don&#8217;t overlap.</div>
<p style="margin-top:200px">In conclusion, if you&#8217;re designing a site that is 800px wide with an 8px border, you would subtract the width of the border from the width of the container element like so: <code>#container { width: 792px; border: 8px solid #ccc; }</code>.  The #container element stays at 800px and everyone is happy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.likesalmondesign.com/ftob-css-width-property-does-exactly-what-you-would-expect-it-to/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Too good</title>
		<link>http://www.likesalmondesign.com/too-good/</link>
		<comments>http://www.likesalmondesign.com/too-good/#comments</comments>
		<pubDate>Sat, 15 Nov 2008 02:50:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Musings]]></category>

		<guid isPermaLink="false">http://likesalmondesign.com/?p=22</guid>
		<description><![CDATA[This was posted two days ago on Subtraction.  Just about everything on Subtraction is worth checking out, but I found this particularly apt right now:
Give up and use tables
]]></description>
			<content:encoded><![CDATA[<p>This was posted two days ago on <a href="http://subtraction.com/" title="Khoi Vhin's blog">Subtraction</a>.  Just about everything on Subtraction is worth checking out, but I found this particularly apt right now:</p>
<p><a href="http://giveupandusetables.com/" title="ready now?">Give up and use tables</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.likesalmondesign.com/too-good/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
