<?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>Winn &#187; CSS</title>
	<atom:link href="http://winn.ws/archives/tag/css/feed" rel="self" type="application/rss+xml" />
	<link>http://winn.ws</link>
	<description>Standards-based design &#38; development</description>
	<lastBuildDate>Wed, 01 Feb 2012 05:30:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Font face in CSS</title>
		<link>http://winn.ws/archives/931</link>
		<comments>http://winn.ws/archives/931#comments</comments>
		<pubDate>Fri, 17 Jun 2011 13:08:42 +0000</pubDate>
		<dc:creator>Greg Winn</dc:creator>
				<category><![CDATA[Design & Layout]]></category>
		<category><![CDATA[web standards]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://winn.ws/?p=931</guid>
		<description><![CDATA[Use @font-face in your CSS Computers have been capable of displaying multiple fonts for several decades now, so it might seem odd that fonts are only just now becoming standardised on the web. However, disagreement on file formats along with complex font licensing issues have turned this into quite a difficult challenge to overcome. Fortunately, [...]]]></description>
			<content:encoded><![CDATA[<h3>Use @font-face in your CSS</h3>
<p>Computers have been capable of displaying multiple fonts for several decades now, so it might seem odd that fonts are only just now becoming standardised on the web. However, disagreement on file formats along with complex font licensing issues have turned this into quite a difficult challenge to overcome. Fortunately, CSS 3 has put the spotlight back on web fonts, and the web is rapidly moving into a multi-font future.
<p>
<span id="more-931"></span></p>
<p>Applying various fonts to blocks of text is nothing new. However, the ability to include new font faces is indeed new, where as before, we were limited to the browser defaults. To include a new font, download the font file that you’d like to include, and then use the @font-face rule to specify a name for the font along with a file path. After that, you can use the font as you normally would.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #a1a100;">@font-face {</span>
   <span style="color: #808080; font-style: italic;">/* Select a name for your font */</span>
  <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> special-<span style="color: #000000; font-weight: bold;">font</span><span style="color: #00AA00;">;</span>
&nbsp;
  <span style="color: #808080; font-style: italic;">/* Point to the font file */</span>
  src<span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'myfont.otf'</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* Now use it! */</span>
body <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> special-<span style="color: #000000; font-weight: bold;">font</span><span style="color: #00AA00;">,</span> Arial<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<h3>Browser Compatibility</h3>
<p>This seems simple enough, and indeed, the @font-face rule works in every browser going all the way back to early versions of Internet Explorer. Including fonts isn’t quite that straightforward due to a few lingering file format compatibility issues, but fortunately, several font services have greatly simplified the process and abstracted away these problems. My favourite font service is Google Web Fonts, and I highly recommend you check it out. You can pick any fully licensed font for free, and then all you have to do is include a CSS file from Google’s fast content delivery network. Once the external CSS file has been included, the new font is available to use in other CSS documents.</p>
]]></content:encoded>
			<wfw:commentRss>http://winn.ws/archives/931/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jumping page content</title>
		<link>http://winn.ws/archives/360</link>
		<comments>http://winn.ws/archives/360#comments</comments>
		<pubDate>Fri, 14 May 2010 02:36:25 +0000</pubDate>
		<dc:creator>Greg Winn</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[web standards]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.winn.ws/?p=360</guid>
		<description><![CDATA[You are likely aware of the page-centering technique of adding auto left and right margins to an outer div: 1 2 3 #some_div &#123; margin: 0 auto; &#125; One of the issues of this is that when used on websites with multiple pages, the layout can appear to “jump” a little bit when going back [...]]]></description>
			<content:encoded><![CDATA[<p>You are likely aware of the page-centering technique of adding auto left and right margins to an outer div:</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: #cc00cc;">#some_div</span>   <span style="color: #00AA00;">&#123;</span>
     <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>One of the issues of this is that when used on websites with multiple pages, the layout can appear to “jump” a little bit when going back and forth between pages that require scroll bars and pages that do not. This is because the ~16px width of the scroll bar in the browser window causes the content area to become that much narrower and the wrap div re-centers itself in the narrower content area causing the jump.</p>
<p>One way to eliminate this jump is to force scroll bars onto every page regardless if they need them or not. This may annoy some purists out there, but I think it’s a decent solution.</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;">html    <span style="color: #00AA00;">&#123;</span>
     overflow-y<span style="color: #00AA00;">:</span><span style="color: #993333;">scroll</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>I just used this in a recent project and it checks out with all browsers including IE6.</p>
]]></content:encoded>
			<wfw:commentRss>http://winn.ws/archives/360/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Browser detection using jQuery</title>
		<link>http://winn.ws/archives/199</link>
		<comments>http://winn.ws/archives/199#comments</comments>
		<pubDate>Tue, 10 Feb 2009 17:31:05 +0000</pubDate>
		<dc:creator>Greg Winn</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.winn.ws/?p=199</guid>
		<description><![CDATA[Browser sniffing is messy. There are a million ways to do it but none of them are particularly clean and most involve conditional statements such as &#8220;&#8221; for IE and various other CSS selector hacks for other browsers. It get around this common issue i am now using jQuery to add a class to my [...]]]></description>
			<content:encoded><![CDATA[<p>Browser sniffing is messy. There are a million ways to do it but none of them are particularly clean and most involve conditional statements such as &#8220;<!--[if condition]> HTML <![endif]-->&#8221; for IE and various other CSS selector hacks for other browsers.</p>
<p>It get around this common issue i am now using jQuery to add a class to my body tag.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$.<span style="color: #660066;">browser</span>.<span style="color: #660066;">msie</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'body'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'browserIE'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #006600; font-style: italic;">// Add the version number</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'body'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'browserIE'</span> <span style="color: #339933;">+</span> $.<span style="color: #660066;">browser</span>.<span style="color: #660066;">version</span>.<span style="color: #660066;">substring</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>If the user is using IE it will add a class to teh body tag like so:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;browserIE browserIE#&quot;</span>&gt;</span></pre></td></tr></table></div>

<blockquote><p>The &#8220;#&#8221; stands for the version of IE the user is running.</p></blockquote>
<p>You can now access elements on your page that neeed to be corrected for IE by calling:</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: #6666ff;">.browserIE6</span> <span style="color: #cc00cc;">#myDiv</span> <span style="color: #00AA00;">&#123;</span>
     <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>This will work much better then current hacks. Hope that helps someone!!</p>
]]></content:encoded>
			<wfw:commentRss>http://winn.ws/archives/199/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS 3 talk &#8211; Rounded corners</title>
		<link>http://winn.ws/archives/178</link>
		<comments>http://winn.ws/archives/178#comments</comments>
		<pubDate>Tue, 11 Nov 2008 04:50:13 +0000</pubDate>
		<dc:creator>Greg Winn</dc:creator>
				<category><![CDATA[Design & Layout]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[web standards]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.winn.ws/?p=178</guid>
		<description><![CDATA[So the last few years have brought amazing things, with the standards movement and getting companies to pay attention to the importance of following standards. In that time, I have seen over five big changes in PHP, three great changes in rails and only one in CSS. Why are we not seeing css3? Why does [...]]]></description>
			<content:encoded><![CDATA[<p>So the last few years have brought amazing things, with the standards movement and getting companies to pay attention to the importance of following standards. In that time, I have seen over five big changes in PHP, three great changes in rails and only one in CSS. Why are we not seeing css3? Why does IE 8 beta still barley work with CSS 2.1? Crazy!</p>
<p>Well, time for a CSS 3 trick! I will cover rounded corners! This is only supported by Firefox and Safari. Below you should see a box with rounded corners!</p>
<div style="-moz-border-radius: 5px;background-color: #333; -webkit-border-radius: 5px;border: 1px solid #fff; padding:0 6px;">
<p>This box has rounded corners!</p>
</div>
<blockquote><p>Here is the code:</p></blockquote>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div style=&quot;-moz-border-radius: 5px;
background-color: #333;
-webkit-border-radius: 5px;
border: 1px solid #fff;&quot;&gt;
&nbsp;
This box has rounded corners!&lt;/div&gt;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://winn.ws/archives/178/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web User Controls</title>
		<link>http://winn.ws/archives/173</link>
		<comments>http://winn.ws/archives/173#comments</comments>
		<pubDate>Fri, 24 Oct 2008 03:08:15 +0000</pubDate>
		<dc:creator>Greg Winn</dc:creator>
				<category><![CDATA[.NET 3.5 VB]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[VB]]></category>

		<guid isPermaLink="false">http://www.winn.ws/archives/173</guid>
		<description><![CDATA[Using the user controls may be one of the best moves you will make when developing an application in .NET. The user control will allow you to separate your reusable logic and keep it in one place. For many developers this is a great thing! Many of us have to re-create items over and over, [...]]]></description>
			<content:encoded><![CDATA[<p>Using the user controls may be one of the best moves you will make when developing an application in .NET. The user control will allow you to separate your reusable logic and keep it in one place. For many developers this is a great thing! Many of us have to re-create items over and over, after some time your code can look like crap and then you feel like crap because you have to deal with it.</p>
<p>Let’s say we have a site where I needed a “Quick Search” on every other page, but each page had a different look and feel or a different CSS document. All I would need to do is create a web user control “.ascx” file and lay down the basics of my quick search. Assign the div’s ID’s or classes, then include your control in each page that needs it. To style, just use your style sheet assigned to that page an add your styles.</p>
<p>Web controls make life a little easier when developing in .NET, so be sure to take advantage of this great tool and stop duplicating your work!</p>
]]></content:encoded>
			<wfw:commentRss>http://winn.ws/archives/173/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Database Caching 1/33 queries in 0.039 seconds using disk: basic
Object Caching 412/486 objects using disk: basic
Content Delivery Network via Amazon Web Services: CloudFront: d45jz936mo8n8.cloudfront.net

Served from: winn.ws @ 2012-02-07 19:26:58 -->
