<?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>nekkidblogger &#187; box shadow</title>
	<atom:link href="http://nekkidblogger.com/category/box-shadow/feed/" rel="self" type="application/rss+xml" />
	<link>http://nekkidblogger.com</link>
	<description>SEO, CSS, Web Design and stuff</description>
	<lastBuildDate>Tue, 08 Nov 2011 01:49:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>CSS3 &#8211; Floated images with captions and shadows</title>
		<link>http://nekkidblogger.com/2010/css3-floated-images-with-captions-and-shadows/</link>
		<comments>http://nekkidblogger.com/2010/css3-floated-images-with-captions-and-shadows/#comments</comments>
		<pubDate>Fri, 17 Sep 2010 23:37:51 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[box shadow]]></category>
		<category><![CDATA[box shadow CSS3]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[image styling CSS]]></category>
		<category><![CDATA[Web design]]></category>
		<category><![CDATA[Web site layout]]></category>
		<category><![CDATA[CSS-example]]></category>
		<category><![CDATA[CSS3 image styling]]></category>
		<category><![CDATA[floated images]]></category>
		<category><![CDATA[image with box shadows]]></category>
		<category><![CDATA[image with captions]]></category>

		<guid isPermaLink="false">http://www.nekkidblogger.com/?p=334</guid>
		<description><![CDATA[1. Stockholm, Sweden I am floating all the pictures to the right, just for fun. You can easily change that. All the pictures have the caption neatly underneath, set in a smaller font and in italics. The first is an image without borders. To see the CSS and markup, view the source code in the [...]]]></description>
			<content:encoded><![CDATA[<p></p><div class="imgcapture"><img src="http://www.scandinavianbooks.com/pics/stockholm_sweden.jpg" width="250" height="177" alt="Stockholm, Sweden"/>
<p>1. Stockholm, Sweden</p>
</div>
<p>I am floating all the pictures to the right, just for fun. You can easily change that. All the pictures have the caption neatly underneath, set in a smaller font and in italics.</p>
<p>The first is an image without borders. To see the CSS and markup, view the <a href="http://www.nekkidblogger.com/image-shadow-caption-css3.html" target="_blank">source code in the demo</a>. Here&#8217;s the basic CSS-code for the floated image with caption:</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre>
<pre><span class="css">div.imgcapture {
  <span class="css-property">float<span class="css-selector">:</span><span class="css-value"> right</span></span>; <span class="css-property">clear<span class="css-selector">:</span><span class="css-value">right</span></span>;
  <span class="css-property">width<span class="css-selector">:</span><span class="css-value"> 257px</span></span>;
  <span class="css-property">margin<span class="css-selector">:</span><span class="css-value"> 5px 0 5px 15px</span></span>;
}
div.imgcapture p {
  <span class="css-property">padding<span class="css-selector">:</span><span class="css-value">0</span></span>; <span class="css-property">margin<span class="css-selector">:</span><span class="css-value"> 3px 0 0 0</span></span>;
  <span class="css-property">text-align<span class="css-selector">:</span><span class="css-value"> center</span></span>;
  <span class="css-property">font-style<span class="css-selector">:</span><span class="css-value"> italic</span></span>;
  <span class="css-property">font-size<span class="css-selector">:</span><span class="css-value"> smaller</span></span>;
  <span class="css-property">text-indent<span class="css-selector">:</span><span class="css-value"> 0</span></span>;
}</span></pre>
</div>
<div class="imgcapture"><img class="fixed" src="http://www.scandinavianbooks.com/pics/stockholm_sweden.jpg" width="250" height="177" alt="Stockholm, Sweden"/>
<p>2. Stockholm, Sweden</p>
</div>
<p>Then, picture two has a thin black border (you can alter the thickness and color easily). In my opinion, this makes the picture stand out a little, and is prettier. But this, of course, is a matter of taste. Here&#8217;s the CSS for that:</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
</pre>
<pre><span class="css">img.fixed {
  <span class="css-property">border<span class="css-selector">:</span><span class="css-value">1px solid black</span></span>;
  <span class="css-property">width<span class="css-selector">:</span><span class="css-value"> 250px</span></span>; }</span></pre>
</div>
<div class="imgcapture"><img class="fixed2" src="http://www.scandinavianbooks.com/pics/stockholm_sweden.jpg" width="250" height="177" alt="Stockholm, Sweden"/>
<p>3. Stockholm, Sweden</p>
</div>
<p>In my opinion a little shadow makes it stand out even more. So in the third example, the same picture has been given a discrete little <em>box shadow effect</em>. This effect is part of the CSS3 specification and supported by most browsers (but not IE 8 and earlier). It has the same border color and thickness. If you don&#8217;t see the shadow, you&#8217;re using the wrong browser.</p>
<p>Here&#8217;s the code:</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
</pre>
<pre><span class="css">img.fixed2 {
  <span class="css-property">border<span class="css-selector">:</span><span class="css-value">1px solid black</span></span>;
  <span class="css-property">width<span class="css-selector">:</span><span class="css-value"> 250px</span></span>;
  <span class="css-property">box-shadow<span class="css-selector">:</span><span class="css-value"> 3px 3px 3px #818181</span></span>;
  <span class="css-property">-webkit-box-shadow<span class="css-selector">:</span><span class="css-value"> 3px 3px 3px #818181</span></span>;
  <span class="css-property">-moz-box-shadow<span class="css-selector">:</span><span class="css-value"> 3px 3px 3px #818181</span></span>; }</span></pre>
</div>
<p>The &#8220;box-shadow&#8221; property is defined by 3 lengths and a color as attributes. The first length is the horizontal offset of the shadow, (positive means the shadow is on the right, a negative offset will put the shadow on the left of the box). The second is<br />
 the vertical offset; a negative value means the box-shadow will be on top of the box and a positive means the shadow will be below the box. Finally, the third number is the blur radius. If this is set to 0 the shadow will be sharp; the higher the number, the more blurred it will be.</p>
<div class="imgcapture"><img class="fixed3" src="http://www.scandinavianbooks.com/pics/stockholm_sweden.jpg" width="250" height="177" alt="Stockholm, Sweden"/></p>
<p>4. Stockholm, Sweden</p>
</div>
<p>In the fourth (and final) example I use slightly thicker shadow (4px) with twice as much blur (6px).
</p>
<p>And that&#8217;s it! Go ahead and use the code if you like it. The full code, including markup, can be found <a href="http://www.nekkidblogger.com/image-shadow-caption-css3.html" target="_blank">in the demo</a>. Link to me if you feel like it &#8211; it&#8217;s appreciated!</p>
<p>And, seriously &#8211; if you can&#8217;t see the shadows, it&#8217;s time to get rid of IE and get a browser that shows you the net in all it&#8217;s glory! Here&#8217;s the download sites for <a href="http://www.opera.com/download/" target="_blank">Opera</a>, <a href="http://www.google.com/chrome"  target="_blank">Chrome</a>, <a href="http://www.mozilla.com/en-US/firefox/personal.html" target="_blank">Firefox</a> (a tad buggy for the moment) and <a href="http://www.apple.com/safari/download/" target="_blank">Safari</a> (unfortunately wants to grab you email address).</p>
<p>&copy;2012 <a href="http://nekkidblogger.com">nekkidblogger</a>. All Rights Reserved.</p>.]]></content:encoded>
			<wfw:commentRss>http://nekkidblogger.com/2010/css3-floated-images-with-captions-and-shadows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Radical Web Design Principle: No More Internet Explorer Support</title>
		<link>http://nekkidblogger.com/2010/a-radical-web-design-principle-no-more-internet-explorer-support/</link>
		<comments>http://nekkidblogger.com/2010/a-radical-web-design-principle-no-more-internet-explorer-support/#comments</comments>
		<pubDate>Fri, 01 Jan 2010 18:57:00 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[box shadow]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[Web design]]></category>
		<category><![CDATA[IE and CSS]]></category>
		<category><![CDATA[No More Internet Explorer Support]]></category>
		<category><![CDATA[Radical Web Design Principle]]></category>

		<guid isPermaLink="false">http://www.nekkidblogger.com/?p=198</guid>
		<description><![CDATA[In the past, I have spent hours and hours searching through my reference books and on the Internet to make my sites look as good in the various versions of Internet Explorer as in  CSS compliant browsers. And I have implemented IE version specific style sheets, IE hacks and rewrites of CSS to make layouts, [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>In the past, I have spent hours and hours searching through my reference books and on the Internet to make my sites look as good in the various versions of Internet Explorer as in  CSS compliant browsers. And I have implemented IE version specific style sheets, IE hacks and rewrites of CSS to make layouts, div&#8217;s and other elements look as beautiful in Internet Explorer as in other browsers.</p>
<p>I have implemented the silly Microsoft &#8220;expression&#8221;-statements for IE-versions not supporting the standard CSS max-width syntax, I have applied Microsoft &#8220;filters&#8221; of all kinds because IE doesn&#8217;t support &#8220;box-shadow&#8221;. I have inserted extra inner div&#8217;s to boxes to make them look the same and have the same size in IE as elsewhere, and I have used unnecessary &#8220;clearfixes&#8221; (picture by courtesy of <a href="RobotJohnny.com" target="_blank">RobotJonny.com</a>).</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-201" style="margin-top: 5px; margin-bottom: 5px;" title="ie6-party" src="http://www.nekkidblogger.com/wp-content/uploads/2010/01/ie6-party.jpg" alt="ie6-party" width="500" height="350" /></p>
<p>The picture, of course, is much too kind to IE7 (and perhaps even to Opera). It breaks things and messes up too. Even IE8 does that! According to rumors, IE9 will fix all of those things, but I will reserve the right to believe that when I see it. I seem to recall having heard similar things all the way up from IE5! And there are still plenty of bugs left &#8230;</p>
<p>No more. I have had enough. I am sick of seeing how bad beautiful typography looks in IE, how well-designed pages get messed up, how nice, discrete shadow effects mess up the fonts within the boxes they apply to in IE. But from now on, for the sites I operate myself, I am not going to bother any more. If Microsoft want to substitute my good looking fonts with thick, ugly looking letters, let borders collapse, and generally render my pages ugly, then let it be so.</p>
<p>From now on, I will consider all those things Microsoft problems that people using Internet Explorer should complain to Microsoft about or start using another browser. I will not help Microsoft by trying to make their inferior browser look good. There is no reason for me to spend lots of hours doing that. For design projects I do for customers I will do it if I have to, but only reluctantly and as little as possible. </p>
<p>That&#8217;s my new, radical design principle for 2010 and forwards. It is a very radical decision, as most people for some or other reason still use IE. But it feels very liberating. And it will be a huge time saver. From now on I will have fun and use all the new, wonderful properties of CSS3 and HTML5 as they get implemented in the good browsers. And let Microsoft worry about how IE supports the new standards.</p>
<p>To users with the wrong browsers I will only say this &#8211; go and get Firefox, Safari or Chrome if you want to see how sites really look! And now that new, <a href="http://www.vg.no/teknologi/artikkel.php?artid=578874" target="_blank">very serious safety issues</a> have been found with Internet Explorer as well, it definitely should be time to change!</p>
<p>&copy;2012 <a href="http://nekkidblogger.com">nekkidblogger</a>. All Rights Reserved.</p>.]]></content:encoded>
			<wfw:commentRss>http://nekkidblogger.com/2010/a-radical-web-design-principle-no-more-internet-explorer-support/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS3 Box Shadows, Browsers, and Internet Explorer (IE-8)</title>
		<link>http://nekkidblogger.com/2009/box-shadows-css3-internet-explorer-ie-8/</link>
		<comments>http://nekkidblogger.com/2009/box-shadows-css3-internet-explorer-ie-8/#comments</comments>
		<pubDate>Fri, 18 Dec 2009 20:28:48 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[box shadow]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[text box]]></category>
		<category><![CDATA[bordered text boxes]]></category>
		<category><![CDATA[Box shadows]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[cross browser comparision]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[IE-8]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[pure CSS]]></category>
		<category><![CDATA[Safari]]></category>
		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://www.nekkidblogger.com/?p=150</guid>
		<description><![CDATA[CSS3 supports a new &#8220;box-shadow&#8221; property that can be applied to shadow page elements such as images, SPANs and DIVs. This is great, since it makes it easier to produce good looking frames for images and to nicely off-set boxes in a number of different and stylish ways. This new feature is currently supported in [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>CSS3 supports a new <a href="http://www.w3.org/TR/css3-background/" target="_blank">&#8220;<code>box-shadow</code>&#8221;  property</a> that can be applied to shadow page elements such as images, SPANs and DIVs. This is great, since it makes it easier to produce good looking frames for images and to nicely off-set boxes in a number of different and <a title="See an example" href="http://www.james-blogs.com/2009/04/19/the-shadow-effect-in-css3/" target="_blank">stylish ways</a>.</p>
<p>This new feature is currently supported in a number of browsers, for instance FF3.5, Safari 3.1+, Gecko and  Google Chrome. Opera (including version 10.10) and Internet Explorer (including IE-8) does not support it (there are rumors indicating the IE-9 will). However, for IE there are some other methods available (that works from IE 5.5 and up).</p>
<p>So how does this work? The basic syntax is:</p>
<div class="codebox"><code>box-shadow: horizontal vertical blur color;</code></div>
<p>So, for example
<div class="fvch-code">
<pre class="fvch-line-numbers">1
</pre>
<pre><span class="css"><span class="css-property">box-shadow<span class="css-selector">:</span><span class="css-value"> 2px 2px 2px #CCC</span></span>;</span></pre>
</div>
<p> is a 2px horizontally (right) and vertically (down) offset shadow with a 2px blur. The color is grey (#CCC).</p>
<p>Then, to complicate matters, Safari requires the prefix
<div class="fvch-code">
<pre class="fvch-line-numbers">1
</pre>
<pre><span class="css">-webkit</span></pre>
</div>
<p> and FireFox the prefix
<div class="fvch-code">
<pre class="fvch-line-numbers">1
</pre>
<pre><span class="css">-moz</span></pre>
</div>
<p>. Fortunately the syntax for these are the same.</p>
<p>If you want to achieve the same results in IE, it gets even more complicated. But tools do exist. A number of sites on the net shows that shadow and blur effects can be produced in Internet Explorer too.  And, indeed, several writers/sites show that it is possible to achieve similar shadow effects with IE&#8217;s proprietary tools as with CSS3. I found four different possible methods for producing box shadows in IE, all using Microsoft-provided &#8220;filter&#8221;-techniques &#8211; in reality, variants of not-so-good proprietary Javascripts.</p>
<p>These tools are the <a href="http://msdn.microsoft.com/en-us/library/ms533086%28VS.85%29.aspx" target="_blank">Shadow filter</a> (usage
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
</pre>
<pre><span class="css">filter:
progid:DXImageTransform.Microsoft.Shadow(<span class="css-property">color=#0000FF,direction=45</span></span></pre>
</div>
<p>; the <a href="http://msdn.microsoft.com/en-us/library/ms532985%28VS.85%29.aspx" target="_blank">DropShadow</a> filter
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
</pre>
<pre><span class="css">filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=5, OffY=5,
Color=<span class="css-string">'gray'</span>, Positive=<span class="css-string">'true'</span></span></pre>
</div>
<p>; the <a href="http://msdn.microsoft.com/en-us/library/ms532995%28VS.85%29.aspx" target="_blank">Glow</a> filter:
<div class="fvch-code">
<pre class="fvch-line-numbers">1
</pre>
<pre><span class="css">filter:progid:DXImageTransform.Microsoft.Glow(Color=blue,Strength=5)</span></pre>
</div>
<p>. A fourth possible tool is the <a href="http://msdn.microsoft.com/en-us/library/ms532979%28VS.85%29.aspx" target="_blank">Blur filter</a> &#8211; I have tested it, and found it of little use for the purposes here. For these filters to work, the object must have layout, meaning they must have &#8220;height&#8221; or &#8220;width&#8221; set, or be absolutely positioned (or have zoom set &#8211; zoom=1).</p>
<p>The examples available online usually apply shadow effects to images or <a href="http://www.thebrightlines.com/2009/12/03/using-ies-filter-in-a-cross-browser-way/" target="_blank">filled boxes</a> (usually filled with dark colors), see for instance this example at the <a href="http://www.dynamicdrive.com/style/csslibrary/item/css3_box_shadows_box_shadow_property/" target="_blank">DynamicDrive CSS-library</a>. However, for my own web designs, I wanted nice shadow effects on some simple bordered text boxes with white background.</p>
<p>To test the various possibilities I have set up four DIVs. The first is the text box as is for reference. Then I apply the following shading:</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
</pre>
<pre><span class="css">.shadow1 {
<span class="css-property">box-shadow<span class="css-selector">:</span><span class="css-value"> 2px 2px  #CCC</span></span>;
<span class="css-property">-webkit-box-shadow<span class="css-selector">:</span><span class="css-value"> 2px 2px #CCC</span></span>;
<span class="css-property">-moz-box-shadow<span class="css-selector">:</span><span class="css-value"> 2px 2px  #CCC</span></span>;
filter: progid:DXImageTransform.Microsoft.dropShadow(<span class="css-property">color=#CCCCCC,
                 offX=3, offY=3, positive=true)</span>; }</span></pre>
</div>
<p><strong>shadow1</strong> has only shadow, no blur. The IE code could have been given in a separate conditional IE style sheet (as some writers recommend), but that turns out not to be necessary (but see <a href="http://www.nekkidblogger.com/box-shadow2.html" target="_blank">here for an example</a>).</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre>
<pre><span class="css">.shadow2 {
<span class="css-property">box-shadow<span class="css-selector">:</span><span class="css-value"> 3px 3px #CCC</span></span>;
<span class="css-property">-webkit-box-shadow<span class="css-selector">:</span><span class="css-value"> 3px 3px 3px #CCC</span></span>;
<span class="css-property">-moz-box-shadow<span class="css-selector">:</span><span class="css-value"> 3px 3px 3px #CCC</span></span>;
filter: progid:DXImageTransform.Microsoft.Glow
      (<span class="css-property">color=#CCCCCC,strength=3)
progid<span class="css-selector">:</span><span class="css-value">DXImageTransform.Microsoft.Shadow
     (color=#CCCCCC,direction=135,
strength=6)</span></span>; }</span></pre>
</div>
<p><strong>shadow2</strong> has moderate shadow and blur with the same color. I also test the Glow and Shadow filters.</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
</pre>
<pre><span class="css">.shadow3 {
<span class="css-property">box-shadow<span class="css-selector">:</span><span class="css-value"> 7px 7px 8px #818181</span></span>;
<span class="css-property">-webkit-box-shadow<span class="css-selector">:</span><span class="css-value"> 7px 7px 8px #818181</span></span>;
<span class="css-property">-moz-box-shadow<span class="css-selector">:</span><span class="css-value"> 7px 7px 8px #818181</span></span>;
filter:
progid:DXImageTransform.Microsoft.DropShadow
      (<span class="css-property">color=#969696, offx=2, offy=2)
progid<span class="css-selector">:</span><span class="css-value">DXImageTransform.Microsoft.DropShadow
     (color=#C2C2C2, offx=2, offy=2)
progid:DXImageTransform.Microsoft.DropShadow
    (color=#EFEFEF, offx=2, offy=2)</span></span>; }</span></pre>
</div>
<p>And in the final DIV, <strong>shadow3</strong>, the shadow color is different, and both shadow and blur substantially larger. For IE, the Drop Shadow filter is applied iteratively (this method is from <a href="http://ole-laursen.blogspot.com/2009/08/using-css3-box-shadow-with-ie.html" target="_blank">Ole Laursen</a>).</p>
<p>The results for Safari, Firefox and Chrome are very nice. Opera just shows the original text box &#8211; it doesn&#8217;t support box shadow yet. The results with IE are not very good. See for yourself (here is the page that you can check yourself in different browsers &#8211; <a href="http://www.nekkidblogger.com/box-shadow.html" target="_blank">demo</a>):</p>
<div style="text-align:center; padding-top: 20px;">
<div style="float:left">
<div><span class="tabletop">Boxes in Firefox:</span><br />
<img src="/pics/firefox-boxes.png" alt="Firefox boxes" /></div>
</div>
<div style="float:left">
<div><span class="tabletop">Boxes in IE8:</span><br />
<img src="/pics/IE8-boxes.png" alt="IE8 boxes" /></div>
</div>
</div>
<div style="clear: both;">The various filters used to create shadow effects in IE unfortunately also place shadows inside the boxes and affect the text in the boxes. If the boxes had a background color as dark as or darker than the shade, the methods used in boxes 2 and 4 on the right side (the .shadow1 and .shadow3 DIVs) could possibly have been used. On a light or white background the various filter methods are not very useful. My conclusion is that box shadows on boxes with text inside can not meaningfully be applied for IE for the moment.</div>
<p>&copy;2012 <a href="http://nekkidblogger.com">nekkidblogger</a>. All Rights Reserved.</p>.]]></content:encoded>
			<wfw:commentRss>http://nekkidblogger.com/2009/box-shadows-css3-internet-explorer-ie-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

