<?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> Seattle Web Designer  &#187; CSS</title>
	<atom:link href="http://www.richterwebdesign.com/blog/category/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.richterwebdesign.com/blog</link>
	<description>&#34;Any sufficiently advanced technology is indistinguishable from magic&#34;  ~Arthur C. Clarke</description>
	<lastBuildDate>Fri, 09 Dec 2011 04:40:56 +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>Simple Browser Detection and Redirect with Conditional Comments</title>
		<link>http://www.richterwebdesign.com/blog/2010/11/simple-browser-detection-and-redirect-with-conditional-comments/</link>
		<comments>http://www.richterwebdesign.com/blog/2010/11/simple-browser-detection-and-redirect-with-conditional-comments/#comments</comments>
		<pubDate>Mon, 15 Nov 2010 03:22:15 +0000</pubDate>
		<dc:creator>gregg</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[Browser]]></category>
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://www.richterwebdesign.com/blog/?p=156</guid>
		<description><![CDATA[There are numerous ways to detect a users browser and then do with them as you wish (redirect, alternate style sheets, etc). Most of this involves JavaScript or server side scripting of some flavor. All of which is fine and &#8230; <a href="http://www.richterwebdesign.com/blog/2010/11/simple-browser-detection-and-redirect-with-conditional-comments/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There are numerous ways to detect a users browser and then do with them as you wish (redirect, alternate style sheets, etc).  Most of this involves JavaScript or server side scripting of some flavor.  All of which is fine and good, but I wanted an even simpler way to detect a users browser, without any client or server side scripting.  So, I created a simple way to do this using conditional comments.  Of course, when I did this, I thought I was a genius for about 2 seconds until I realized that it was so simple, that probably lots of people have done this&#8230; so I did a quick Google search and found exactly that.  However, no two approaches are exactly the same, and here is my truly unique (because it came straight from me brain) approach.</p>
<p>For my current project (in development), Microsoft IE6 and IE7 will not be supported browsers (big shock I know).  So I want my conditional comments to target any IE browser less than version 8 and prevent the user from accessing the site, and offer them alternatives to either, upgrade their browser, or switch to a more modern browser.</p>
<p>Now, before we get started, I must state that <strong>I did not spend a ton of time trying to make this aesthetically pleasing.</strong> If the site visitor is using IE6 or IE7 to access a website, then they should not be expecting a whole lot&#8230; there are no rounded corners, fancy fonts, transparencies, etc.  Just a bare bones message to get the point across.</p>
<p>Step 1 - In the body of the page, right before the closing body tag , I put the following html:<br />
<code style="color: #339966;"><br />
&lt;!--[if lt IE 8]&gt;<br />
&lt;div id="IEredirect"&gt;<br />
&lt;div id="IEredirectText"&gt;<br />
&lt;p&gt;You are attempting to view this website using an outdated browser.  To view this site, please upgrade your version of Internet Explorer or consider using a more modern browser via the links below.&lt;/p&gt;<br />
&lt;br /&gt;<br />
&lt;p id="safari"&gt;<br />
&lt;a href="http://www.apple.com/safari/"&gt;Apple Safari&amp;lt;/a&gt;<br />
&lt;/p&gt;<br />
&lt;p id="chrome"&gt;<br />
&lt;a href="http://www.google.com/chrome/"&gt;Google Chrome&lt;/a&gt;<br />
&lt;/p&gt;<br />
&lt;p id="firefox"&gt;<br />
&lt;a href="http://www.mozilla.com/en-US/"&gt;Mozilla Firefox&amp;lt;/a&gt;<br />
&lt;/p&gt;<br />
&lt;p id="ie8"&gt;<br />
&lt;a href="http://www.google.com/toolbar/ie8/index.html"&gt;Microsoft IE8&lt;/a&gt;<br />
&lt;/p&gt;<br />
&lt;/div&gt;<br />
&lt;/div&gt;<br />
&lt;[endif]--&gt;<br />
</code></p>
<p><span style="color: #000000;">Step 2 &#8211; In my linked CSS stylesheet I apply the following styles to the unique ID&#8217;s:</span><br />
<code style="color: #339966;">/*begin IE redirect*/</code></p>
<p><code style="color: #339966;"> </code></p>
<p><code style="color: #339966;">#IEredirect {<br />
position: absolute;<br />
width: 100%;<br />
height: 100%;<br />
background-color: #000000;<br />
z-index: 1000;<br />
left:0px;<br />
top:0px;<br />
background: url(../images/bgBlack30p.png) repeat fixed center top;<br />
}</code></p>
<p><code style="color: #339966;">#IEredirectText {<br />
position: relative;<br />
width: 500px;<br />
height: 400px;<br />
margin-left: auto;<br />
margin-right: auto;<br />
text-align: left;<br />
background-color: #ffffff;<br />
margin-top: 100px;<br />
border-bottom: solid 2px #000000;<br />
border-top: solid 2px #000000;<br />
border-left: solid 2px #000000;<br />
border-right: solid 2px #000000;<br />
}</p>
<p>#IEredirectText p, ul {<br />
padding-top: 20px;<br />
margin-right: 20px;<br />
margin-left:20px;<br />
}</p>
<p>#IEredirectText a {<br />
margin-left:60px;<br />
font-size: 20px;<br />
}</p>
<p>#IEredirectText a:hover {<br />
color: blue;<br />
}</p>
<p>#IEredirectText #safari {<br />
height: 50px;<br />
background: url(../images/icon_safari_bw.png) no-repeat left 0px;<br />
}</p>
<p>#IEredirectText #safari:hover {<br />
background: url(../images/icon_safari_color.png) no-repeat left 0px;<br />
}</p>
<p>#IEredirectText #chrome {<br />
height: 50px;<br />
background: url(../images/icon_chrome_bw.png) no-repeat left top;<br />
}</p>
<p>#IEredirectText #chrome:hover {<br />
background: url(../images/icon_chrome_color.png) no-repeat left top;<br />
}</p>
<p>#IEredirectText #firefox {<br />
height: 50px;<br />
background: url(../images/icon_firefox_bw.png) no-repeat left top;<br />
}</p>
<p>#IEredirectText #firefox:hover {<br />
background: url(../images/icon_firefox_color.png) no-repeat left top;<br />
}</p>
<p>#IEredirectText #ie8 {<br />
height: 50px;<br />
background: url(../images/icon_ie_bw.png) no-repeat left top;<br />
}</p>
<p></code></p>
<p><code style="color: #339966;">#IEredirectText #ie8:hover {<br />
background: url(../images/icon_ie_color.png) no-repeat left top;<br />
}</code><br />
Step 3 &#8211; I put the following images in the above referenced &#8220;images&#8221; directory:</p>
<p><img title="icon_safari_bw" src="http://www.richterwebdesign.com/blog/wp-content/uploads/2010/11/icon_safari_bw1.png" alt="" width="50" height="50" /><img title="icon_safari_color" src="http://www.richterwebdesign.com/blog/wp-content/uploads/2010/11/icon_safari_color1.png" alt="" width="50" height="50" /></p>
<p><img title="icon_chrome_bw" src="http://www.richterwebdesign.com/blog/wp-content/uploads/2010/11/icon_chrome_bw2.png" alt="" width="50" height="50" /><img title="icon_chrome_color" src="http://www.richterwebdesign.com/blog/wp-content/uploads/2010/11/icon_chrome_color1.png" alt="" width="50" height="50" /></p>
<p><img title="icon_firefox_bw" src="http://www.richterwebdesign.com/blog/wp-content/uploads/2010/11/icon_firefox_bw1.png" alt="" width="50" height="50" /><img title="icon_firefox_color" src="http://www.richterwebdesign.com/blog/wp-content/uploads/2010/11/icon_firefox_color1.png" alt="" width="50" height="50" /></p>
<p><img title="icon_ie_bw" src="http://www.richterwebdesign.com/blog/wp-content/uploads/2010/11/icon_ie_bw2.png" alt="" width="50" height="50" /><img title="icon_ie_color" src="http://www.richterwebdesign.com/blog/wp-content/uploads/2010/11/icon_ie_color2.png" alt="" width="50" height="50" /></p>
<p><img title="bgBlack30p" src="http://www.richterwebdesign.com/blog/wp-content/uploads/2010/11/bgBlack30p1.png" alt="" width="10" height="10" /> (don&#8217;t forget that last little square there)</p>
<p>Now when someone visits the page, they will see the image below with a 30% transparent black overlay background (in IE7) or a white background (ie6).  If they want to upgrade their browser, all they have to do is click one of the icons listed.  On hover, the icon goes from black &amp; white to color.</p>
<p><img class="aligncenter size-medium wp-image-171" title="screenShot" src="http://www.richterwebdesign.com/blog/wp-content/uploads/2010/11/screenShot-300x240.png" alt="" width="300" height="240" /></p>
<p>Gregg &#8211; <a title="Richter Web Design" href="http://richterwebdesign.com" target="_self">http://richterwebdesign.com</a></p>
<p><span style="line-height: normal; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-size: small;"><br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.richterwebdesign.com/blog/2010/11/simple-browser-detection-and-redirect-with-conditional-comments/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Embedding Custom Fonts in to Web Pages</title>
		<link>http://www.richterwebdesign.com/blog/2010/09/embedding-custom-fonts-in-to-web-pages/</link>
		<comments>http://www.richterwebdesign.com/blog/2010/09/embedding-custom-fonts-in-to-web-pages/#comments</comments>
		<pubDate>Tue, 28 Sep 2010 02:08:05 +0000</pubDate>
		<dc:creator>gregg</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Font]]></category>
		<category><![CDATA[@font-face]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[font]]></category>
		<category><![CDATA[typography]]></category>

		<guid isPermaLink="false">http://www.richterwebdesign.com/blog/?p=130</guid>
		<description><![CDATA[If you commonly hear people shouting "WTF?" when accessing your web pages, it's likely that they simply want to know, "Where's The Font?".   As in, why is the entire page in Arial, or Times New Roman, or Helvetica, or Verdana, or Georgia...? I have been &#8230; <a href="http://www.richterwebdesign.com/blog/2010/09/embedding-custom-fonts-in-to-web-pages/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div><code><a href="http://www.richterwebdesign.com/blog/wp-content/uploads/2010/09/typo.png"><img class="aligncenter size-full wp-image-149" title="Typography" src="http://www.richterwebdesign.com/blog/wp-content/uploads/2010/09/typo.png" alt="" width="300" height="60" /></a><br />
If you commonly hear people shouting "WTF?" when accessing your web pages, it's likely that they simply want to know, "Where's The Font?".   As in, why is the entire page in Arial, or Times New Roman, or Helvetica, or Verdana, or Georgia...?</code></div>
<div><code>I have been elbow deep in custom font's for my latest project (in Development) and thought I would put together a short article compiling what I've learned.</code></div>
<p><code><strong>1st - a little preachin'</strong>.  Stop using images as a replacement for text.  If you have important text like a business name, a primary function, a description of a business or event, etc, making that an image instead of using text significantly hampers your SEO (Search Engine Optimization).  Search Engines like Bing, Google, and Yahoo, primarily use the actual text on your page for SEO.  Images are not text.  Only text is text.  Of course there are times when a text image is absolutely necessary (logos, super-rich graphic design of text, etc), but all of your h tags (h1, h2, etc) should be text.  And that means, don't just hide the text with CSS and put a background image in it's place... search engines don't like this and see it as potentially deceptive.</code></p>
<p><code><strong>2nd - go get your font on</strong>.  There are a ton of font websites out there with all sorts of cool fonts available for free or a minimal charge (read the licensing agreement for these fonts).  I like sites like <a href="http://www.dafont.com/" target="_blank">dafont.com</a> and/or searching 'font' in places like <a href="http://www.smashingmagazine.com/tag/typography/">Smashing Magazine</a> archives.</code></p>
<p><code><strong>3rd - the font file types</strong>.  For embedding custom fonts on to your web page, there are 3 file types you need to know and love  (.<a href="http://en.wikipedia.org/wiki/TrueType" target="_blank">ttf</a> .<a href="http://en.wikipedia.org/wiki/OpenType" target="_blank">otf</a> .<a href="http://en.wikipedia.org/wiki/Embedded_OpenType" target="_blank">eot</a>).  In a nutshell, .ttf and .otf are fine and dandy for Firefox, Chrome, Safari, and Opera... but of course, not Internet Explorer.  To embed custom fonts in IE, you need use the .eot file format.  Why?  Because that's what one guy in Redmond decided.</code></p>
<p><code><strong>4th - conversion to the dark side.</strong> 99% of the fonts you are going to find on the internet are going to be in the .ttf format.  So before we get to writing our CSS you must convert your .ttf files to .eot files so your pretty custom fonts will work across all browsers (using both the .ttf and .eot files).  A quick Google search for font converters will lead you to sites like <a href="http://www.kirsle.net/wizards/ttf2eot.cgi" target="_blank">here</a> or <a href="http://www.fontsquirrel.com/fontface/generator" target="_blank">here</a>.</code></p>
<p><code><strong>5th - upload.</strong> For this example, we'll assume you found a cool font called fancyFont.ttf and have successfully converted to a .eot file. From here, create a folder in your ROOT directory titled 'font' and upload your fancyFont.ttf and fancyFont.eot files to this place.</code></p>
<p><code><strong>6th - the CSS.</strong> At the top of your CSS doc we are going to specify the @font-face selector like this:</code></p>
<p><code> </code></p>
<p><code> </code></p>
<p style="padding-left: 30px;"><code><span style="color: #339966;">@font-face{<br />
font-family: 'fancyFont'; <span style="color: #0000ff;">/*This is the name of the font that you will call later*/</span><br />
src: url('/font/fancyFont.eot'); <span style="color: #0000ff;">/*Calling the font for IE. List this one first*/</span><br />
src: local('fancyFont'), url('/font/fancyFont.ttf') format ('truetype'); <span style="color: #0000ff;">/*non IE browsers*/</span><br />
}</span></code></p>
<p><code>The above code basically tells IE, hey go look at this URL for my custom font. After that it tells all the other browsers to look for the font on the local machine first and if not found to go to the URL as well.</p>
<p><strong>7th - call the font</strong>. Now call your font in the CSS doc using your HTML element that your corresponding text is located in. So, if you want all paragraphs on your web page to display your new fancyFont you would write it in the CSS doc like so:</p>
<p style="padding-left: 30px;"><span style="color: #339966;">p { <span style="color: #0000ff;">/* p being the HTML paragraph element */</span><br />
font-family: 'fancyFont'; <span style="color: #0000ff;">/*when calling the font use quotes and don't list the file type ext*/</span><br />
}</span></p>
<p><span style="color: #000000;"><span style="text-decoration: underline;"><strong>Items of note... </strong></span></span></p>
<p><span style="color: #000000;"><strong>Case matters.</strong> Your web page will distinguish between FANCYFONT.TTF and fancyfont.ttf.  Whatever your file is saved as, should be how you write it in your CSS.</span></p>
<p><span style="color: #000000;"><strong>Space matters.</strong> As a matter of best practice.  Eliminate spaces in your file names.  fancy font.ttf will cause you more problems than fancyFont.ttf.</span></p>
<p><span style="color: #000000;"><strong>Weight matters.</strong> Some fonts will look exactly as you intended in one browser and oddly thicker or thinner in another.  A specific example I have is one font that looks exactly as intended in Google Chrome, but quite thick (or heavy) in Firefox.  Adding the string <span style="color: #339966;">'font-weight: lighter;'</span> to my CSS for the corresponding element fixed the problem in Firefox while not changing the weight at all in Chrome.</span></p>
<p><span style="color: #000000;"><strong>Size matters</strong>.  A lot of these custom fonts look dramatically different when only 18px big vs. 60px big.  Flaws in the design and inconsistency between characters become quite evident when the characters get big.</span></p>
<p>Now go get your font on.</p>
<p>Gregg - <a title="Richter Web Design" href="http://richterwebdesign.com" target="_self">http://richterwebdesign.com</a></p>
<p><span style="color: #000000;"> </span></p>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.richterwebdesign.com/blog/2010/09/embedding-custom-fonts-in-to-web-pages/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>CSS Reset</title>
		<link>http://www.richterwebdesign.com/blog/2009/12/css-reset/</link>
		<comments>http://www.richterwebdesign.com/blog/2009/12/css-reset/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 04:01:33 +0000</pubDate>
		<dc:creator>gregg</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.richterwebdesign.com/blog/?p=19</guid>
		<description><![CDATA[**1/19 update, see my notes at bottom of the page. Quick note on how I start all my CSS docs with a quick little reset to make pages render as universal as possible across all browsers. IE, Firefox, Safari, Chrome &#8230; <a href="http://www.richterwebdesign.com/blog/2009/12/css-reset/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><em><span style="color: #0000ff;">**1/19 update, see my notes at bottom of the page. </span></em></p>
<p>Quick note on how I start all my CSS docs with a quick little reset to make pages render as universal as possible across all browsers.</p>
<ol>
<li>IE, Firefox, Safari, Chrome etc. all treat margins and padding just a little different from one another&#8230; which leads to your pages rendering slightly different from browser to browser.  This issue becomes quite apparent if you are using tables (for table data only of course).  To reset all padding and margin set the value to zero on the universal selector as follows:</li>
<p><span style="color: #00ff00;">* {<br />
padding: 0;<br />
margin: 0;<br />
}</span></p>
<li>Bullet&#8217;s for list&#8217;s (unordered in particular) appear different in each browser as well.  A list of bullet items in IE will be bulleted with a solid circle, where another browser may show it as a triangle or perhaps a square.  I like to set the decoration to none, and then add in my own bullet image if I must have one.  To remove decoration from your Unordered Lists, set the following in your CSS:</li>
<p><span style="color: #00ff00;">ul { list-style:none;<br />
}</span></p>
<li>For all my anchor tags (hyperlinks), I again like to set the decoration to none and then specify color, underline, etc. as part of my design.  In particular, I typically do not like the auto-standard for hyperlinks to be underlined or appear in blue, especially if they are in a top-level navigation.  At the top of my CSS, I set my anchor tags as follows:</li>
<p><span style="color: #00ff00;">a {text-decoration: none;<br />
}</span></p>
<p><span style="color: #00ff00;">a:hover {text-decoration: none;<br />
}</span></p>
<p><span style="color: #00ff00;">a:visited {text-decoration: none;<br />
}</span></p>
<p>Then of course if I wanted all anchor tags to appear white on load, but black on hover, I would set the first two as follows:<br />
<span style="color: #00ff00;">a {text-decoration: none;<br />
color:#FFFFFF;<br />
}</span></p>
<p><span style="color: #00ff00;">a:hover {text-decoration: none;<br />
color:#000000;<br />
} </span></ol>
<p>I would love to know more about what other people (you) use as generic CSS resets and if you typically write them in each CSS doc, or if you have a master CSS reset doc that you always point to.</p>
<p>Happy Cascading,</p>
<p>Gregg &#8211; <a title="Richter Web Design" href="http://richterwebdesign.com" target="_self">http://richterwebdesign.com</a></p>
<p><em><span style="color: #0000ff;">1/19 Update&#8230; I posted this article on a couple of LinkedIn discussion boards and had no less that 50-ish comments discussing the merits and drawbacks to CSS resets.  While the opinions on this varied greatly, one of the most consistent comments were in regards to the Eric Meyer CSS Reset.  Eric Meyer is widely regarded as the CSS guru.  I have included a link to his site in my links section, or you can <a title="Eric Meyer" href="http://meyerweb.com/" target="_blank">click here.</a></span></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.richterwebdesign.com/blog/2009/12/css-reset/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

