<?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>delusionworld blog &#187; css</title>
	<atom:link href="http://www.delusionworld.com/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.delusionworld.com</link>
	<description>my MooTools, TYPO3 and FLOW3 experiences</description>
	<lastBuildDate>Fri, 24 Jun 2011 21:22:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>cross browser shadows and fonts with css only</title>
		<link>http://www.delusionworld.com/webdev/cross-browser-shadows-and-fonts-with-css-only/</link>
		<comments>http://www.delusionworld.com/webdev/cross-browser-shadows-and-fonts-with-css-only/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 11:57:18 +0000</pubDate>
		<dc:creator>daKmoR</dc:creator>
				<category><![CDATA[WebDev]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[fonts]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[shadow]]></category>

		<guid isPermaLink="false">http://www.delusionworld.com/?p=144</guid>
		<description><![CDATA[cross browser css only shadow If you are like me you probably have have seen a million ways of implementing shadows but none seems really serious. I mean there are quite fancy ways of archiving it. You can use a lot of pictures and wrap the content in a lot of divs. You can use [...]]]></description>
			<content:encoded><![CDATA[<h2>cross browser css only shadow</h2>
<p>If you are like me you probably have have seen a million ways of implementing shadows but none seems really serious. I mean there are quite fancy ways of archiving it. You can use a lot of pictures and wrap the content in a lot of divs. You can use javascript to generate millions of spans/divs to display a smooth shadow with html elements and css colors. You can use canvas (all browser except IE) and VML (IE) for this. And I guess there are even more crazy ways of archiving this.</p>
<p>AS you probably have guessed all these methods are fare from being perfect and pretty complicated to use compared to a css only solution. I&#8217;m really surprised that I haven&#8217;t seen this solution anywhere else in all my researches.</p>
<p>So how does it work. It&#8217;s simple as hell &#8211; it&#8217;s just css!!</p>
<pre class="brush: css; title: ;">
/* the following shadow works in IE5.5-8, FF2-3, Safari3, Chrome */
.shadow {
	box-shadow: 3px 5px 6px #888;
	-moz-box-shadow: 3px 5px 6px #888;
	-webkit-box-shadow: 3px 5px 6px #888;
	filter:progid:DXImageTransform.Microsoft.Shadow(color=#888888, direction=135, strength=7);
}
</pre>
<p>Using that you get a nice shadow in all browser you currently need (means IE, FF, Safari, Chrome). The IE shadow probably looks a little different however it still way better than no shadow or any fancy above solution (in my opinion).<br />
Make sure to check out the <a href="http://www.delusionworld.com/files/cross-browser-shadows-and-fonts-with-css-only/cssOnlyShadow.html"><strong>DEMO</strong></a>.</p>
<p>Here is comparison between the css only shadows in IE and the rest:<br />
<a href="http://www.delusionworld.com/wp-content/uploads/2009/10/cssOnlyShadowComparision.jpg"><img src="http://www.delusionworld.com/wp-content/uploads/2009/10/cssOnlyShadowComparision.jpg" alt="cssOnlyShadowComparision" title="cssOnlyShadowComparision" width="574" height="484" class="alignleft size-full wp-image-150" /></a></p>
<h2>cross browser css only fonts</h2>
<p>Yet again a quite hard to believe mystery. I always thought that using custom fonts on my webpage is next to impossible. And looking at some quite complex technical solutions like:</p>
<ul>
<li><a href="http://cufon.shoqolate.com/generate/">cufon</a> [generates canvas/VML]</li>
<li><a href="http://facelift.mawhorter.net/">facelift</a> [generates images]</li>
<li><a href="http://novemberborn.net/sifr">sifr</a> [generates flash]</li>
</ul>
<p>I was pretty sure there was no easy solution to this problem. Guess what I just found a &#8220;css only&#8221; solution. </p>
<p>All you need is a *.eot (IE) and a *.ttf (rest) file of your desired font. You can get a bunch of fonts in these formats at <a href="http://www.fontsquirrel.com/">http://www.fontsquirrel.com/</a>. All fonts you can find there are 100% free for commercial use. If you want to use a non free front where you can&#8217;t get those 2 required formats you can still use on of the above methods.<br />
After you have those two files you simple need to add this css</p>
<pre class="brush: css; title: ;">
/* get fonts from: http://www.fontsquirrel.com/ */

@font-face {
	font-family: 'Bloody Normal';
	/* IE */
	src: url('fonts/BLOODY.eot');
	/* for other Browser you can define multiple formats but usually truetype alone is enough */
	src: local('Bloody Normal'), local('Bloody'),
		url('fonts/BLOODY.woff') format('woff'),
		url('fonts/BLOODY.svg#Bloody') format('svg'),
		url('fonts/BLOODY.TTF') format('truetype');
}

@font-face {
	font-family: 'Droid Sans Regular';
	src: url('fonts/DroidSans.eot');
	src: local('Droid Sans Regular'), url('fonts/DroidSans.ttf') format('truetype');
}

h1 { font-family: 'Bloody Normal'; }
</pre>
<p>Now you can use the font in your css as with the above H1 or you can use it inline with</p>
<pre class="brush: xml; title: ;">
&lt;p style=&quot;font-family: 'Droid Sans Regular';&quot;&gt;
</pre>
<p>This method works again in all tested browsers (Firefox, Internet Explorer, Safari, Chrome).</p>
<p>Just check out the <a href="http://www.delusionworld.com/files/cross-browser-shadows-and-fonts-with-css-only/cssOnlyFont.html"><strong>DEMO</strong></a>.</p>
<h2>Conclusion</h2>
<p>The here provides solutions for shadows and fonts are extremely easy to use and don&#8217;t need any complex technical &#8220;workaround&#8221;. It&#8217;s just pure CSS (with specific CSS for each browser group) and still works in all current browsers you need (Firefox, IE, Safari, Chrome). I&#8217;m still really surprised to never have heard from this before. Life would have been so much easier if I knew this a year ago. Funny thing is that these solutions work in browser far older than a year. So this solutions could have been used a long time ago but I have never seen it before.</p>
<p>What do you think about these solutions? why aren&#8217;t they being used? do people simple don&#8217;t know them or is there any problem I didn&#8217;t stumbled upon?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.delusionworld.com/webdev/cross-browser-shadows-and-fonts-with-css-only/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
	</channel>
</rss>

