<?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>Smart red fox &#187; cssSmart red fox</title>
	<atom:link href="http://www.smartredfox.com/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.smartredfox.com</link>
	<description>Smarter than your average bear</description>
	<lastBuildDate>Thu, 02 Feb 2012 21:18:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<meta name="generator" content="Obscure 2.0" />
		<item>
		<title>Css portholes</title>
		<link>http://www.smartredfox.com/2011/01/css-portholes/</link>
		<comments>http://www.smartredfox.com/2011/01/css-portholes/#comments</comments>
		<pubDate>Tue, 11 Jan 2011 19:30:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[porthole]]></category>
		<category><![CDATA[rounded]]></category>
		<category><![CDATA[shadows]]></category>

		<guid isPermaLink="false">http://www.smartredfox.com/?p=420</guid>
		<description><![CDATA[This tutorial builds on a previous post for creating a rounded inset image from a square picture, this tutorial adds a complex border to make the image look like a stylish porthole. The parts of the (w)hole The final image is made up of: The original image which has a drop-shadow and border applied via css. A 5px wide border that is grey on 3 sides and white at the top. A dark grey 1px border to define the outer &#8230; <a href="http://www.smartredfox.com/2011/01/css-portholes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p class="download">This tutorial builds on <a href="http://www.smartredfox.com/2011/01/rounded-shadowed-and-shiny-pictures-with-css3/">a previous post</a> for creating a rounded inset image from a square picture, this tutorial adds a complex border to make the image look like a stylish porthole.</p>
<div>
<div id="attachment_341" class="wp-caption alignleft" style="width: 110px"><img class="size-full wp-image-341 colorbox-420" title="squareimage" src="http://www.smartredfox.com/wp-content/uploads/2011/01/squareimage.png" alt="Square image with no rounding or shadowing." width="100" height="100" /><p class="wp-caption-text">Before first post</p></div>
<div id="attachment_361" class="wp-caption alignleft" style="width: 110px"><img class="alignnone size-full wp-image-361 colorbox-420" title="roundedshadowedmaskedglow" src="http://www.smartredfox.com/wp-content/uploads/2011/01/roundedshadowedmaskedglow.png" alt="" width="100" height="100" /><p class="wp-caption-text">After first post</p></div>
<div id="attachment_422" class="wp-caption alignleft" style="width: 110px"><img class="size-full wp-image-422 colorbox-420" title="shadowglowborder" src="http://www.smartredfox.com/wp-content/uploads/2011/01/shadowglowborder.png" alt="" width="100" height="100" /><p class="wp-caption-text">Final image</p></div>
</div>
<h2>The parts of the (w)hole</h2>
<div id="attachment_440" class="wp-caption alignleft" style="width: 288px"><img class="size-full wp-image-440 colorbox-420" title="portholes" src="http://www.smartredfox.com/wp-content/uploads/2011/01/portholes.png" alt="" width="278" height="340" /><p class="wp-caption-text">A side-on view of the porthole</p></div>
<p>The final image is made up of:</p>
<p>The original image which has a drop-shadow and border applied via css.</p>
<p>A 5px wide border that is grey on 3 sides and white at the top.</p>
<p>A dark grey 1px border to define the outer edge.</p>
<h2>Adding content with pseudo-elements</h2>
<p>It&#8217;s not possible to add more than one border to the div that displays the image, but we can add more items to get the additional borders we need. Doing this manually would be a pain, and would create extra html elements which we don&#8217;t need. Fortunately, we can generate everything that we need in css with the :before and :after pseudo elements. This technique is lifted wholesale from <a href="http://nicolasgallagher.com/multiple-backgrounds-and-borders-with-css2/">Nicolas Gallagher&#8217;s website</a>, so look there for more detail on the technique.</p>
<h2>Changes to the original code</h2>
<p>The image itself is moved from the image div and put onto the pseudo :after element we create so that it appears on top of the others. All of the sizes are also changed to match the additional size needed for the borders we are adding.</p>
<p>The new css for the portholes is below:</p>
<p><strong>Css</strong><br />
<code><br />
.image<br />
{<br />
/*Rounded edges*/<br />
-moz-border-radius: 33px; /* FF1+ */<br />
-webkit-border-radius: 33px; /* Saf3-4 */<br />
border-radius: 33px; /* Opera 10.5, IE 9, Saf5, Chrome */ </code></p>
<p>background-repeat:no-repeat;<br />
border:1px solid #CCCCCC;<br />
display:block;<br />
height:66px;<br />
overflow:hidden;<br />
position:relative;<br />
margin:10px;<br />
width:66px;<br />
z-index:1;<br />
}</p>
<p>.image:before<br />
{<br />
content:&#8221;";</p>
<p>/*Rounded edges*/<br />
-moz-border-radius: 33px; /* FF1+ */<br />
-webkit-border-radius: 33px; /* Saf3-4 */<br />
border-radius: 33px; /* Opera 10.5, IE 9, Saf5, Chrome */</p>
<p>position:absolute;<br />
z-index:-1;<br />
top:0px;<br />
left:0px;<br />
right:0px;<br />
bottom:0px;<br />
border:5px solid #ccc;<br />
border-color:#fefefe #f0f0f0 #eaeaea #f0f0f0;<br />
}</p>
<p>.image:after<br />
{<br />
content:&#8221;";<br />
background:#fff url(../images/finance.jpg) no-repeat 0 0;</p>
<p>/*Shadows*/<br />
-moz-box-shadow:inset 0px 2px 8px #333; /* FF3.5+ */<br />
-webkit-box-shadow:inset 0px 2px 8px #000; /* Saf3.0+*/<br />
box-shadow:inset 0px 2px 8px #333; /* Opera 10.5, IE 9 */</p>
<p>/*Glow effect*/<br />
-webkit-mask-box-image:url(../images/circle60pxglow.png);</p>
<p>/*Rounded edges*/<br />
-moz-border-radius: 33px; /* FF1+ */<br />
-webkit-border-radius: 33px; /* Saf3-4 */<br />
border-radius: 33px; /* Opera 10.5, IE 9, Saf5, Chrome */</p>
<p>position:absolute;<br />
z-index:-1;<br />
top:5px;<br />
left:5px;<br />
right:5px;<br />
bottom:5px;<br />
border:1px solid #999;<br />
}</p>
<h2>Internet Explorer</h2>
<p>IE6 and IE7 don&#8217;t recognise the Pseudo elements at all which in this case means that our image won&#8217;t show at all. To work around this we can use a hack to move the background image back to the image div.</p>
<p><strong>Css</strong><br />
Add the following to the .image{} declaration:</p>
<p><code>	/*IE6/7 hacks*/<br />
	*background:#fff url(../images/finance.jpg) no-repeat 0 0;<br />
	*width:60px;<br />
	*height:60px;<br />
</code></p>
<p>Obviously if you&#8217;re using something like Modernizr or conditional comments then you need to drop the hacks and add the appropriate css elsewhere.</p>
<p>If you find this tutorial useful, or have a better way of doing something please let me know in the comments.</p>
<h2>References</h2>
<p>This design would not have been possible without this excellent article by Nicholas Gallagher:<br />
<a href="http://nicolasgallagher.com/multiple-backgrounds-and-borders-with-css2/">http://nicolasgallagher.com/multiple-backgrounds-and-borders-with-css2/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.smartredfox.com/2011/01/css-portholes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>First impressions of YAML</title>
		<link>http://www.smartredfox.com/2008/10/first-steps-with-yaml/</link>
		<comments>http://www.smartredfox.com/2008/10/first-steps-with-yaml/#comments</comments>
		<pubDate>Tue, 21 Oct 2008 14:53:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[Notes]]></category>
		<category><![CDATA[YAML]]></category>

		<guid isPermaLink="false">http://www.smartredfox.com/?p=45</guid>
		<description><![CDATA[Okay, I&#8217;ll be honest I&#8217;m a bit of a magpie when it comes to web development, and in particular css frameworks. One week I&#8217;ll be telling everyone that&#8217;ll listen (which isn&#8217;t many people) about how great YUI is, and the next week I&#8217;ll be waxing lyrical about the excellent Blueprint framework. So with that little disclaimer out of the way, here&#8217;s my take on the rather excellent YAML CSS framework, and my first foray into using it to layout a &#8230; <a href="http://www.smartredfox.com/2008/10/first-steps-with-yaml/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.smartredfox.com/wp-content/uploads/2008/10/yaml.png"><img class="alignright size-full wp-image-65 colorbox-45" style="border: 1px solid #ccc;" title="yaml" src="http://www.smartredfox.com/wp-content/uploads/2008/10/yaml.png" alt="YAML logo" width="225" height="169" /></a>Okay, I&#8217;ll be honest I&#8217;m a bit of a magpie when it comes to web development, and in particular css frameworks. One week I&#8217;ll be telling everyone that&#8217;ll listen (which isn&#8217;t many people) about how great YUI is, and the next week I&#8217;ll be waxing lyrical about the excellent Blueprint framework.</p>
<p>So with that little disclaimer out of the way, here&#8217;s my take on the rather excellent YAML CSS framework, and my first foray into using it to layout a site.</p>
<p>First things first; YAML seems to be very well thought out. It claims to be cross browser compliant in almost every browser that&#8217;s still in use by more than one man and his dog, and it fixes most of the major problems web developers run into with the older browsers.</p>
<p>Unlike YUI and some of the other Frameworks you&#8217;ll need to download the css files etc. and host them yourself. These can all be downloaded from <a title="Go to the download page." href="http://www.yaml.de/en/download.html" target="_blank">here.</a></p>
<p>YAML lets you get off to a flying start without any real work creating css reset files etc. After slicing and dicing a design I&#8217;ve been working on for a week I managed to get a site up and running cross-browser on the first attempt. This seems to happen very rarely for me. I&#8217;ll admit there were a few tweaks here and there to make it perfect, but overall it just worked.</p>
<p>It&#8217;s got a few default styles that are well thought out and I&#8217;m already finding myself duplicating them in other projects I work on that don&#8217;t use YAML. I&#8217;ll cover details of some of these styles and a bit more on how to use the framework in later posts.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-3921669375576540";
google_ad_slot = "1444433905";
google_ad_width = 200;
google_ad_height = 200;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smartredfox.com/2008/10/first-steps-with-yaml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Min-height in IE6</title>
		<link>http://www.smartredfox.com/2008/05/min-height-in-ie6/</link>
		<comments>http://www.smartredfox.com/2008/05/min-height-in-ie6/#comments</comments>
		<pubDate>Tue, 20 May 2008 11:05:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[IE6]]></category>
		<category><![CDATA[bug]]></category>

		<guid isPermaLink="false">http://www.smartredfox.com/?p=7</guid>
		<description><![CDATA[We all know the problem: You need to set a minimum height on an object but IE6 ignores it and ruins your layout. Well worry no more, there is a simple fix: selector { min-height:500px; height:auto !important; height:500px; } This takes advantage of two IE6 bugs: IE6 ignores the !important and sets the height using the last line. IE6 treats height like it should treat min-height and lets child objects cause the parent to expand. I found this helpful solution &#8230; <a href="http://www.smartredfox.com/2008/05/min-height-in-ie6/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>We all know the problem: You need to set a minimum height on an object but IE6 ignores it and ruins your layout. Well worry no more, there is a simple fix:</p>
<p><code>selector {<br />
min-height:500px;<br />
height:auto !important;<br />
height:500px;<br />
}</code></p>
<p>This takes advantage of two IE6 bugs:</p>
<ol>
<li>IE6 ignores the !important and sets the height using the last line.</li>
<li>IE6 treats height like it should treat min-height and lets child objects cause the parent to expand.</li>
</ol>
<p>I found this <a title="./with Imagination" href="http://www.dustindiaz.com/min-height-fast-hack/" target="_blank">helpful solution here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smartredfox.com/2008/05/min-height-in-ie6/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Keeping your footer at the bottom of the page</title>
		<link>http://www.smartredfox.com/2008/04/keeping-your-footer-at-the-bottom-of-the-page/</link>
		<comments>http://www.smartredfox.com/2008/04/keeping-your-footer-at-the-bottom-of-the-page/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 13:12:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[footer]]></category>

		<guid isPermaLink="false">http://www.smartredfox.com/?p=6</guid>
		<description><![CDATA[Created a site design but keep getting white space showing below your loving crafted footer? Me too, a bit of research later and I&#8217;ve found a fix that works well, integrates with the yui framework, and seems to work well cross-browser. The basic principle is pretty simple. Make the body 100% tall no matter what. Give it a negative bottom margin the size of your footer. Move you footer up into the space left by the bottom margin There&#8217;s a &#8230; <a href="http://www.smartredfox.com/2008/04/keeping-your-footer-at-the-bottom-of-the-page/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Created a site design but keep getting white space showing below your loving crafted footer? Me too, a bit of research later and I&#8217;ve found a fix that works well, integrates with the yui framework, and seems to work well cross-browser.</p>
<p>The basic principle is pretty simple.</p>
<ul>
<li>Make the body 100% tall no matter what.</li>
<li>Give it a negative bottom margin the size of your footer.</li>
<li>Move you footer up into the space left by the bottom margin</li>
</ul>
<p>There&#8217;s a few other steps to make it work cross-browser (ie6+) but that&#8217;s basically it.</p>
<p>I found the solution <a href="http://fortysevenmedia.com/blog/archives/making_your_footer_stay_put_with_css/">here</a>.</p>
<p><a href="http://fortysevenmedia.com/blog/archives/making_your_footer_stay_put_with_css/"><br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.smartredfox.com/2008/04/keeping-your-footer-at-the-bottom-of-the-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Image button not aligning vertically with input box</title>
		<link>http://www.smartredfox.com/2008/04/image-submit-button-not-aligning-with-input-box/</link>
		<comments>http://www.smartredfox.com/2008/04/image-submit-button-not-aligning-with-input-box/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 13:07:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://www.smartredfox.com/?p=5</guid>
		<description><![CDATA[This is an odd problem. You have a perfectly normal search box with a go button next to it &#8211; a classic layout some might say. The problem is that the go button seems to sit about half-way up the side of the search box. Now, having tried to fix css/html problems cross-browser before, I was fully expecting to spend a few hours looking for solutions trying them in FF, IE etc. and then mixing and matching my perfect solution&#8230; &#8230; <a href="http://www.smartredfox.com/2008/04/image-submit-button-not-aligning-with-input-box/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="mceTemp"><img class="size-full wp-image-159 alignleft colorbox-5" style="border: 1px solid #cccccc; margin: 10px;" title="Mis-aligned button in IE7" src="http://www.smartredfox.com/wp-content/uploads/2008/04/misalignedbutton.png" alt="Mis-aligned button in IE7" width="144" height="56" /></div>
<p>This is an odd problem. You have a perfectly normal search box with a go button next to it &#8211; a classic layout some might say. The problem is that the go button seems to sit about half-way up the side of the search box.  Now, having tried to fix css/html problems cross-browser before, I was fully expecting to spend a few hours looking for solutions trying them in FF, IE etc. and then mixing and matching my perfect solution&#8230; In this case I was stopped short&#8230; Very short in fact. The fix is simple as adding a position:absolute to the button. Problem solved.  See <a href="http://blog.taragana.com/index.php/archive/how-to-perfectly-align-image-button-with-html-input-textbox/">here</a> for where I found the fix.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smartredfox.com/2008/04/image-submit-button-not-aligning-with-input-box/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Centering absolutely positioned elements</title>
		<link>http://www.smartredfox.com/2008/03/centering-absolutely-positioned-elements/</link>
		<comments>http://www.smartredfox.com/2008/03/centering-absolutely-positioned-elements/#comments</comments>
		<pubDate>Fri, 14 Mar 2008 19:46:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[centering]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://www.smartredfox.com/?p=3</guid>
		<description><![CDATA[Having problems setting auto margins on an absolutely positioned element? Me too&#8230; until I found that I was missing one simple bit of css. When centering an absolutely positioned element horizontally you have to specify the left and right properties as zero for this to work! I found the solution here but I thought I&#8217;d note it down for all those people that may not have come across this themselves. Somehow it seems to have passed me by&#8230; Auto-margins can &#8230; <a href="http://www.smartredfox.com/2008/03/centering-absolutely-positioned-elements/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Having problems setting auto margins on an absolutely positioned element? Me too&#8230; until I found that I was missing one simple bit of css.</p>
<p>When centering an absolutely positioned element horizontally you have to specify the left and right properties as zero for this to work!</p>
<p>I found the <a href="http://css-discuss.incutio.com/?page=CenteringBlockElement" title="Incutio.com">solution here</a> but I thought I&#8217;d note it down for all those people that may not have come across this themselves. Somehow it seems to have passed me by&#8230;</p>
<blockquote><p> Auto-margins can center an absolutely positioned element inside its containing block.</p>
<p>For this to work, you have to</p>
<ul>
<li> specify the offset properties (of opposite sides) with same values, i.e. by setting  <tt> left:0; right:0;</tt> for horizontal centering and <tt> top:0; bottom:0;</tt> for vertical centering,</li>
<li> set dimensions along the axis you want to center along,</li>
<li> enable auto-margins along the axis you want to center along.</li>
</ul>
<p>Internet Explorer note: IE6 can not relate absolutely positioned elements to opposite sides of containing block, so only one of the offset properties is used. This brings the element out of balance and renders auto-margins useless.</p></blockquote>
<p>I hope someone finds this useful&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smartredfox.com/2008/03/centering-absolutely-positioned-elements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

