<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0"><channel><title>Joshua Hibbert</title> <link>http://joshnh.com</link> <description>Designer</description> <lastBuildDate>Tue, 17 Apr 2012 06:41:44 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/joshnh" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="joshnh" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><title>Pure CSS Icons</title><link>http://joshnh.com/2012/02/pure-css-icons/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=pure-css-icons</link> <comments>http://joshnh.com/2012/02/pure-css-icons/#comments</comments> <pubDate>Thu, 23 Feb 2012 08:03:10 +0000</pubDate> <dc:creator>Josh</dc:creator> <category><![CDATA[CSS]]></category><guid isPermaLink="false">http://joshnh.com/?p=590</guid> <description><![CDATA[View the icons As you may already know, I’m a big fan of CSS. I have done my fair share of CSS experiments, and I have learnt an incredible amount by doing so. One of the most important things I have learnt is this: it’s not okay to use non-semantic markup for styling. Style is...  <a
href="http://joshnh.com/2012/02/pure-css-icons/" title="Read Pure CSS Icons">Read more &#187;</a>]]></description> <content:encoded><![CDATA[<p><img
src="http://joshnh.com/wp-content/uploads/2012/02/Pure-CSS-Icons1.png" alt="Pure CSS Icons"><span
id="more-590"></span></p><p><a
href="http://jsfiddle.net/joshnh/mfLCp/show">View the icons</a></p><p>As you may already know, I’m a big fan of CSS. I have done my fair share of CSS experiments, and I have learnt an incredible amount by doing so. One of the most important things I have learnt is this: it’s not okay to use non-semantic markup for styling. Style is not content, and they are kept separate for a reason. I have seen many experiments in which entire images are made only using HTML and CSS, and I have to ask why? While it is often challenging to complete such experiments, aren’t they teaching others that it is okay to use markup for styling purposes?</p><p>With my latest experiment, <a
href="http://jsfiddle.net/joshnh/mfLCp/show">pure CSS icons</a>, I had two strict guidelines in place:</p><ol><li>No extra markup just for styling</li><li>No need for a solid background colour for the icons to work</li></ol><p>This made it incredibly difficult to produce high calibre icons, especially as I was working with a single anchor element for each icon. However, it was quite the accomplishment when I was able to do so. The most difficult aspects were creating the triangular shapes (due to my use of borders), and producing certain icons without using a solid background colour.</p><p><img
src="http://joshnh.com/wp-content/uploads/2012/02/Pure-CSS-Icons-image-2.png" alt="Pure CSS Icons"></p><p>This experiment, as always, was a lesson. Firstly, pseudo-elements are incredibly powerful, and secondly, if you are using non-semantic markup, then you are probably doing it wrong. My advice to you would be that next time you are undertaking a challenging CSS experiment, introduce some limiting guidelines, you might be surprised with the result.</p><h2>Note</h2><p>These icons are just an experiment; they degrade terribly in older browsers. Feel free to poke around the source code, play with, replicate, and learn from them, but I wouldn’t recommend using them on a website. If you want to fork the code on GitHub, you can do so <a
href="https://github.com/joshnh/Pure-CSS-Icons">here</a>.</p> <img
src="http://joshnh.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=590" width="1" height="1" style="display: none;" />]]></content:encoded> <wfw:commentRss>http://joshnh.com/2012/02/pure-css-icons/feed/</wfw:commentRss> <slash:comments>7</slash:comments> </item> <item><title>Why You Should Use Inline-Block when Positioning Elements</title><link>http://joshnh.com/2012/02/why-you-should-use-inline-block-when-positioning-elements/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=why-you-should-use-inline-block-when-positioning-elements</link> <comments>http://joshnh.com/2012/02/why-you-should-use-inline-block-when-positioning-elements/#comments</comments> <pubDate>Tue, 07 Feb 2012 07:18:31 +0000</pubDate> <dc:creator>Josh</dc:creator> <category><![CDATA[CSS]]></category><guid isPermaLink="false">http://joshnh.com/?p=487</guid> <description><![CDATA[I was recently introduced to the idea of using display: inline-block; instead of floats when positioning elements (thanks Justin). At first it was a bit of a shock to the system; I had always used floats, why should I change? But with time, the idea of no longer using floats for layout started to sound...  <a
href="http://joshnh.com/2012/02/why-you-should-use-inline-block-when-positioning-elements/" title="Read Why You Should Use Inline-Block when Positioning Elements">Read more &#187;</a>]]></description> <content:encoded><![CDATA[<p><img
src="http://joshnh.com/wp-content/uploads/2012/02/Why-You-Should-Use-Inline-Block-when-Positioning-Elements1.png" alt="Why You Should Use Inline-Block when Positioning Elements"><span
id="more-487"></span></p><p>I was recently introduced to the idea of using <code>display: inline-block;</code> instead of floats when positioning elements (thanks <a
href="http://twitter.com/cerebralideas/">Justin</a>). At first it was a bit of a shock to the system; I had always used floats, why should I change? But with time, the idea of no longer using floats for layout started to sound pretty good. For instance, it meant I could forget about using a clearfix hack.</p><p>After doing some research—and using <code>inline-block</code> in a few projects—I have become a convert. And I’m hoping I can convince you to consider using it too.</p><p>Before I get too far into it, I need to be honest with you: <code>inline-block</code> isn’t a magic fix, but as long as you are aware of its quirks, you can work around them. Also, to clarify: I am not asking you to stop using floats altogether. Floats still have their uses, but it would pay to be more mindful when using them. No more using them willy-nilly!</p><h2>The float property</h2><p>Floats were originally used for wrapping text, and as such, they can play up when used to align elements. The most well-known issue is that non floated elements don’t recognise floated children. This is due to floated elements being removed from the normal flow of the document.</p><p>Another issue (in regards to layout) is that you can’t centrally float an element; you are limited to left or right floats only. And an even lesser known issue is that elements in the flow of the document will collapse their margins with the elements above and below whereas floated elements will not.</p><h2>Display: inline-block;</h2><p>Setting an element’s display to <code>inline-block</code> tells browsers to place that element inline, but to treat it as though it were a block level element. This means that we can use <code>inline-block</code> instead of floats to have a series of elements side by side.</p><p>An important thing to take note of when using <code>inline-block</code> is that it takes white space into account. What that means is that any white space in your markup will be rendered in the document. Now most of the time this won’t be an issue, but if you need to eliminate it, doing something like this works:</p><p><pre>&lt;ul&gt;
    &lt;li&gt;&lt;/li&gt;&lt;!--
 --&gt;&lt;li&gt;&lt;/li&gt;&lt;!--
 --&gt;&lt;li&gt;&lt;/li&gt;
&lt;/ul&gt;</pre></p><p>An alternate solution is to set the <code>font-size</code> of the parent element to zero, and then set the required <code>font-size</code> on the children.</p><p>Another thing that you will need to be aware of is the way that <code>inline-block</code> elements are <a
href="http://www.w3.org/wiki/CSS/Properties/vertical-align">vertically aligned</a>. I generally use <code>vertical-align: top;</code>, but you have a fair bit of flexibility if required. If you don’t want to declare it more than once then you could use this:</p><p><pre>* {
    vertical-align: top;
}</pre></p><h2>Aligning elements that are inline-block</h2><p>Alright, on to the important stuff. Aligning elements using <code>inline-block</code> is incredibly simple; all you have to do is use <code>text-align</code> on the parent element. This gives you the ability to align elements centrally, to the left, or to the right. Not only that, but you don’t need to define a width to center an element. You can also align elements to the right without the need to reverse their order in the markup.</p><p>Since being introduced to <code>inline-block</code>, I have been questioning how I was able to use floats for so long. I have already encountered situations where <code>inline-block</code> allowed me to position an element in a way that I could not using floats. Not only that, but I no longer have to concern myself with weird browser bugs and clearfix hacks. Sure <code>inline-block</code> renders white space, but that is to be expected; browsers render <code>inline-block</code> elements as though they were characters in a sentence. I would much rather work with behaviour I expect than behaviour I don’t.</p><h2>Browser support</h2><p>I’m sure you’re not surprised to hear me say that IE6 and 7 have a few issues with <code>inline-block</code>. That being said, if you do need to support them, you can do so by declaring <code>zoom: 1; *display: inline;</code> (The asterisk targets IE6 and 7). Just make sure that the inline value is listed after <code>display: inline-block</code>.</p><h2>Addendum</h2><p>There have been a couple of points brought to my attention that are worth mentioning. Firstly, <a
href="http://twitter.com/christiannaths">Christian</a> informed me that IE6 and 7 will correctly render elements that are natively inline as <code>inline-block</code>. And secondly, <a
href="http://twitter.com/cerebralideas/">Justin</a> has made the great suggestion of using an IE conditional style sheet instead of using the <code>*display</code> CSS hack.</p> <img
src="http://joshnh.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=487" width="1" height="1" style="display: none;" />]]></content:encoded> <wfw:commentRss>http://joshnh.com/2012/02/why-you-should-use-inline-block-when-positioning-elements/feed/</wfw:commentRss> <slash:comments>12</slash:comments> </item> <item><title>A Collection of CSS Snippets for Sublime Text 2</title><link>http://joshnh.com/2012/02/a-collection-of-css-snippets-for-sublime-text-2/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=a-collection-of-css-snippets-for-sublime-text-2</link> <comments>http://joshnh.com/2012/02/a-collection-of-css-snippets-for-sublime-text-2/#comments</comments> <pubDate>Fri, 03 Feb 2012 10:06:41 +0000</pubDate> <dc:creator>Josh</dc:creator> <category><![CDATA[CSS]]></category><guid isPermaLink="false">http://joshnh.com/?p=474</guid> <description><![CDATA[Download I’m a huge fan of Sublime Text 2. Hopefully you are too, and if you haven’t heard of it, then I highly recommend checking it out. It is currently in public beta, and awesome features are being added regularly. I have spent some time putting together a set of CSS snippets for Sublime Text,...  <a
href="http://joshnh.com/2012/02/a-collection-of-css-snippets-for-sublime-text-2/" title="Read A Collection of CSS Snippets for Sublime Text 2">Read more &#187;</a>]]></description> <content:encoded><![CDATA[<p><img
src="http://joshnh.com/wp-content/uploads/2012/02/A-Collection-of-CSS-Snippets-for-Sublime-Text-21.png" alt="A Collection of CSS Snippets for Sublime Text 2"><span
id="more-474"></span></p><p><a
href="http://cl.ly/3O043Z3W3r050v2h2y1s">Download</a></p><p>I’m a huge fan of <a
href="http://www.sublimetext.com/2">Sublime Text 2</a>. Hopefully you are too, and if you haven’t heard of it, then I highly recommend checking it out. It is currently in public beta, and awesome features are being added regularly.</p><p>I have spent some time putting together a set of CSS snippets for Sublime Text, and thought I might share them. I have gone through and made them as simple as possible to use. The majority of the snippets are triggered by typing the first three letters of a property, and then hitting tab. Some snippets are a little more advanced, with tab locations saved into them, but I’ll let you play with them for yourself rather than go into any more detail.</p><p>The snippets can be downloaded <a
href="http://cl.ly/3O043Z3W3r050v2h2y1s">here</a>. Copy the folder into Sublime Text packages folder. On a Mac this can be found in <code>Library &gt; Application Support &gt; Sublime Text 2 &gt; Packages</code>. For Windows, it can be found in <code>C: &gt; Users &gt; {username} &gt; AppData &gt; Roaming &gt; Sublime Text 2 &gt; Packages.</code></p><p><a
href="http://screenr.com/6cws">Here is a video</a> showing the power of these snippets, and <a
href="http://cl.ly/0c1D3i2W2o2n3s1e0x2x">here</a> is an overview of what is included. Also, <a
href="https://github.com/joshnh/CSS-Snippets">here</a> is the GitHub repository.</p> <img
src="http://joshnh.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=474" width="1" height="1" style="display: none;" />]]></content:encoded> <wfw:commentRss>http://joshnh.com/2012/02/a-collection-of-css-snippets-for-sublime-text-2/feed/</wfw:commentRss> <slash:comments>10</slash:comments> </item> <item><title>How to Make a Halftone Effect in Illustrator</title><link>http://joshnh.com/2012/01/how-to-make-a-halftone-effect-in-illustrator/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=how-to-make-a-halftone-effect-in-illustrator</link> <comments>http://joshnh.com/2012/01/how-to-make-a-halftone-effect-in-illustrator/#comments</comments> <pubDate>Sun, 29 Jan 2012 03:32:48 +0000</pubDate> <dc:creator>Josh</dc:creator> <category><![CDATA[Illustrator]]></category><guid isPermaLink="false">http://joshnh.com/?p=443</guid> <description><![CDATA[I am a big fan of halftone patterns. I love that you can use a solid colour to give the impression of shading, or even a gradient. Most of my design work is done in Illustrator, and I have spent many hours working out the best way to create halftone patterns. To save you the...  <a
href="http://joshnh.com/2012/01/how-to-make-a-halftone-effect-in-illustrator/" title="Read How to Make a Halftone Effect in Illustrator">Read more &#187;</a>]]></description> <content:encoded><![CDATA[<p><img
src="http://joshnh.com/wp-content/uploads/2012/01/How-I-Make-a-Halftone-Effect-in-Illustrator1.png" alt="How I Make a Halftone Effect in Illustrator"><span
id="more-443"></span></p><p>I am a big fan of halftone patterns. I love that you can use a solid colour to give the impression of shading, or even a gradient.</p><p>Most of my design work is done in Illustrator, and I have spent many hours working out the best way to create halftone patterns. To save you the time, I will walk you through the technique that gives me the best results.</p><p>For this quick tutorial, I will replicate the halftone pattern shown on this sword:</p><p><img
src="http://joshnh.com/wp-content/uploads/2012/01/How-I-Make-a-Halftone-Effect-in-Illustrator-image-2.png" alt="What we will be creating"></p><p>Once you have your basic shape, remove the border, and then fill it with a white to black gradient. You will have to play around with the angle to get it just right. Keep in mind that the circles will decrease in size from black to white.</p><p><img
src="http://joshnh.com/wp-content/uploads/2012/01/How-I-Make-a-Halftone-Effect-in-Illustrator-image-3.png" alt="Getting the gradient right"></p><p>Now it’s time to apply the ‘Color Halftone’ effect. This can be found in the ‘Effect’ menu, under ‘Pixelate’. Make sure that all the channels are set to 0 degrees, and then play around with the maximum radius until you get a halftone pattern that isn’t too small or large. Something like this:</p><p><img
src="http://joshnh.com/wp-content/uploads/2012/01/How-I-Make-a-Halftone-Effect-in-Illustrator-image-4.png" alt="Setting the size of the halftone effect"></p><p>The next step is to expand the result; we want to get rid of the white, and turn it into a vector. Select ‘Expand Appearance’ from the ‘Object’ menu. Then, from the context menu, hit the drop down arrow next to ‘Live Trace’ and select ‘Tracing Options’. You want to change ‘Path Fitting’, ‘Minimum Area’, and ‘Corner Angle’ all to 1. Also, make sure that ‘Ignore White’ is checked. I have this saved as a preset for ease of use:</p><p><img
src="http://joshnh.com/wp-content/uploads/2012/01/How-I-Make-a-Halftone-Effect-in-Illustrator-image-5.png" alt="Tracing options"></p><p>Finally, hit the ‘Expand’ button on the context menu. You are left with just the halftone vector, which you can then do with as you like. I generally change the color and opacity to suit the current design, but I’m sure you can be more creative than that!</p> <img
src="http://joshnh.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=443" width="1" height="1" style="display: none;" />]]></content:encoded> <wfw:commentRss>http://joshnh.com/2012/01/how-to-make-a-halftone-effect-in-illustrator/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Getting Inner Border Radius Just Right</title><link>http://joshnh.com/2012/01/getting-inner-border-radius-just-right/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=getting-inner-border-radius-just-right</link> <comments>http://joshnh.com/2012/01/getting-inner-border-radius-just-right/#comments</comments> <pubDate>Fri, 27 Jan 2012 04:45:06 +0000</pubDate> <dc:creator>Josh</dc:creator> <category><![CDATA[CSS]]></category><guid isPermaLink="false">http://joshnh.com/?p=416</guid> <description><![CDATA[Firstly, if you aren’t sure what I am talking about, I would recommend having a read of this article by Chris Coyier. Alright, now to the formula that I use to make sure that I get my nested border radii just right: x = z — y, where x is the inner border radius, z...  <a
href="http://joshnh.com/2012/01/getting-inner-border-radius-just-right/" title="Read Getting Inner Border Radius Just Right">Read more &#187;</a>]]></description> <content:encoded><![CDATA[<p><img
src="http://joshnh.com/wp-content/uploads/2012/01/Getting-Inner-Border-Radius-Just-Right1.png" alt="Getting Inner Border Radius Just Right"><span
id="more-416"></span></p><p>Firstly, if you aren’t sure what I am talking about, I would recommend having a read of <a
href="http://css-tricks.com/public-service-announcement-careful-with-your-nested-border-radii/">this article</a> by Chris Coyier.</p><p>Alright, now to the formula that I use to make sure that I get my nested border radii just right: </code>x = z — y</code>, where </code>x</code> is the inner border radius, </code>z</code> is the outer border radius, and </code>y</code> is the space between the two elements (as shown above). Keep in mind that for this formula to work, both pseudo circles formed by the border radii need to have the same centre point.</p><p>Now, unlike most mathematical formulas, this one isn’t always right. You may encounter the odd situation where the result doesn’t look quite right, so keep in mind that this is only a guide; you may need to eyeball it to get it perfect.</p><p>Here are a few examples of the formula in action (as you can see, the top right has been adjusted slightly):</p><p><img
src="http://joshnh.com/wp-content/uploads/2012/01/Getting-Inner-Border-Radius-Just-Right-image-2.png" alt="Getting Inner Border Radius Just Right - examples"></p><h2>A tool for the job</h2><p>I have put together <a
href="http://joshnh.com/tools/get-your-nested-border-radii-right.html">this little tool</a> to help you guys out. If you have any improvements, you can fork the code <a
href="https://github.com/joshnh/Get-Your-Nested-Border-Radii-Right">here</a>.</p> <img
src="http://joshnh.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=416" width="1" height="1" style="display: none;" />]]></content:encoded> <wfw:commentRss>http://joshnh.com/2012/01/getting-inner-border-radius-just-right/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Add Borders to Your Triangles Using Pseudo-Elements</title><link>http://joshnh.com/2012/01/add-borders-to-your-triangles-using-pseudo-elements/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=add-borders-to-your-triangles-using-pseudo-elements</link> <comments>http://joshnh.com/2012/01/add-borders-to-your-triangles-using-pseudo-elements/#comments</comments> <pubDate>Sun, 08 Jan 2012 08:02:32 +0000</pubDate> <dc:creator>Josh</dc:creator> <category><![CDATA[CSS]]></category><guid isPermaLink="false">http://joshnh.com/?p=360</guid> <description><![CDATA[A while back I explained how to make a speech bubble using CSS. But what about if instead of giving the speech bubble a drop shadow, we wanted to give it a border? Normally this wouldn’t be too difficult, but due to the shape of a speech bubble—a rectangle with a triangle underneath it—it becomes...  <a
href="http://joshnh.com/2012/01/add-borders-to-your-triangles-using-pseudo-elements/" title="Read Add Borders to Your Triangles Using Pseudo-Elements">Read more &#187;</a>]]></description> <content:encoded><![CDATA[<p><img
src="http://joshnh.com/wp-content/uploads/2012/01/Add-Borders-to-Your-Triangles-Using-Pseudo-elements1.png" alt="Add Borders to Your Triangles Using Pseudo-elements"><span
id="more-360"></span></p><p>A while back I explained <a
href="http://joshnh.com/2011/10/how-to-make-a-speech-bubble-with-a-drop-shadow/">how to make a speech bubble</a> using CSS. But what about if instead of giving the speech bubble a drop shadow, we wanted to give it a border?</p><p>Normally this wouldn’t be too difficult, but due to the shape of a speech bubble—a rectangle with a triangle underneath it—it becomes more difficult. We can easily give the rectangle a border, but considering the <a
href="http://www.howtocreate.co.uk/tutorials/css/slopes">technique</a> used to create the triangle, also giving that a border isn’t possible.</p><p>Luckily, we have a spare pseudo-element, and by duplicating our triangle, increasing its size, and sitting it behind our original, we can give the appearance of a seamless border: <a
href="http://jsfiddle.net/joshnh/26Lww/">http://jsfiddle.net/joshnh/26Lww/</a></p> <img
src="http://joshnh.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=360" width="1" height="1" style="display: none;" />]]></content:encoded> <wfw:commentRss>http://joshnh.com/2012/01/add-borders-to-your-triangles-using-pseudo-elements/feed/</wfw:commentRss> <slash:comments>6</slash:comments> </item> <item><title>Instagram and Friends</title><link>http://joshnh.com/2012/01/instagram-and-friends/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=instagram-and-friends</link> <comments>http://joshnh.com/2012/01/instagram-and-friends/#comments</comments> <pubDate>Sat, 07 Jan 2012 03:08:47 +0000</pubDate> <dc:creator>Josh</dc:creator> <category><![CDATA[Photography]]></category><guid isPermaLink="false">http://joshnh.com/?p=264</guid> <description><![CDATA[A few months ago I installed Instagram on my iPhone and it has quickly become one of my most used apps. If you haven’t already checked it out, and you own an iPhone, then I would highly recommend doing so. Instagram has refuelled my passion for photography, not only allowing me to take stunning photos...  <a
href="http://joshnh.com/2012/01/instagram-and-friends/" title="Read Instagram and Friends">Read more &#187;</a>]]></description> <content:encoded><![CDATA[<p><img
src="http://joshnh.com/wp-content/uploads/2012/01/Instagram-and-Friends1.png" alt="Instagram and Friends"><span
id="more-264"></span></p><p>A few months ago I installed <a
href="http://instagr.am/">Instagram</a> on my iPhone and it has quickly become one of my most used apps. If you haven’t already checked it out, and you own an iPhone, then I would highly recommend doing so.</p><p>Instagram has refuelled my passion for photography, not only allowing me to take stunning photos with my phone, but also allowing me to share them easily with my friends. Now instead of talking about Instagram itself, I would like to share with you the <a
href="http://cl.ly/2M3e352a0325471E3U1p">apps I use</a> to compliment it:</p><ul><li><a
href="#camera+">Camera+</a></li><li><a
href="#colorsplash">ColorSplash</a></li><li><a
href="#diptic">Diptic</a></li><li><a
href="#dynamic-light">Dynamic Light</a></li><li><a
href="#halftone">Halftone</a></li><li><a
href="#photo-filter">Photo Fixer</a></li><li><a
href="#ps-express">Photoshop Express</a></li><li><a
href="#slowshutter">Slow Shutter Cam</a></li><li><a
href="#tiny-planets">Tiny Planets</a></li></ul><h2 id="camera+">Camera+</h2><p>The first, and most important, is the camera app itself. I don’t use the native Apple camera app, instead opting for <a
href="http://campl.us/">Camera+</a>. This app is incredibly powerful, giving you much more control than the inbuilt camera app.</p><p>Not only does Camera+ have inbuilt filters, it also allows you to crop, rotate, add borders, and add captions to your photos before exporting them out to your gallery. But my favourite feature is the ease in which I can manually set the exposure.</p><h2 id="colorsplash">ColorSplash</h2><p>Ever wanted to highlight one particular item in a photo? Well then <a
href="http://www.pocketpixels.com/ColorSplash.html">ColorSplash</a> is what you are looking for. This is a very handy app that makes it easy to ‘finger paint’ the color back into a greyscale photo.</p><p>Although it is not my most used photography app, it is one that can add a little piece of magic to a photo, more so than any other app I have found.</p><h2 id="diptic">Diptic</h2><p>I quite like combining multiple photos into a framed image, and the best app I have found to do that is <a
href="http://www.dipticapp.com/">Diptic</a>. You can choose one of 23 default templates and then customize each layout to really make it your own. You can also edit imported images with basic transforms and effects before finalizing the border and exporting the result.</p><h2 id="dynamic-light">Dynamic Light</h2><p><a
href="http://www.mediachance.com/IOS/dynamiclight.html">Dynamic Light</a> is an incredibly powerful app designed to give your photos a <a
href="http://en.wikipedia.org/wiki/High_dynamic_range_imaging">HDR</a> effect. With an easy to use interface, it allows users to control the level of the ‘dynamic light’ effect while also providing a set of ready to use filters. This is a great app for bringing some life back into a dull photo. Keep an eye out for the ‘comic’ effect, it is a personal favourite of mine.</p><h2 id="halftone">Halftone</h2><p>Speaking of a comic effect, this is exactly what <a
href="http://www.juicybitssoftware.com/halftone/">Halftone</a> is designed to do.</p><p>Halftone is unlike any of the other apps that I have mentioned so far, as it is meant entirely for fun. It allows you to tell more of a story than a typical photo can, allowing you to insert captions, speech bubbles, and comic book inspired symbols. While this app isn’t a necessity, I highly recommend it.</p><h2 id="photo-filter">Photo Fixer</h2><p><a
href="http://scilian.com/index.html">Adam Uccello</a> has created a few photography based iPhone apps, the best of which is <a
href="http://scilian.com/photofixer.html">Photo Fixer</a>. Put simply, Photo Fixer allows you to remove unwanted objects from your photos, and the result is very surprising. You are able to ‘paint’ over the object you want removed with your finger, and then algorithms are used to remove the unwanted item. And if you aren’t quite happy with the result, then just hit the ‘erase’ button again, the outcome is slightly different each time.</p><h2 id="ps-express">Photoshop Express</h2><p><a
href="http://www.photoshop.com/products/mobile/express/ios">Photoshop Express</a> is a must have app for iPhone photography enthusiasts. It allows you to make fine adjustments such as straightening a photo or tweaking contrast and exposure. It also comes with some great effects and borders that are ready to use. Photoshop Express is a one-stop-shop for all your editing needs.</p><h2 id="slowshutter">Slow Shutter Cam</h2><p>The name of this app is pretty self explanatory. <a
href="http://www.cogitap.com/slowshutter/instructions.htm">Slow Shutter Cam</a> allows you to take photos with various slow shutter speed effects. You are able to choose between automatic, manual, and light trail (light painting) modes and can also set up a self timer to ensure that the camera will be as stable as possible when taking the photo.</p><h2 id="tiny-planets">Tiny Planets</h2><p>Last but not least is <a
href="http://www.infoding.com/tiny-planet-photos/">Tiny Planets</a>. It is the latest addition to my photography app collection, and has quickly become my favourite.</p><p>Tiny Planets takes an image that you already have on your iPhone and applies what is known as a polar coordinates filter effect to it. This turns your regular image into a globe, or a ‘tiny planet’. It is an incredibly unique effect, and a lot of fun to play around with.</p> <img
src="http://joshnh.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=264" width="1" height="1" style="display: none;" />]]></content:encoded> <wfw:commentRss>http://joshnh.com/2012/01/instagram-and-friends/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>How to Make a Pure CSS Alert Bar</title><link>http://joshnh.com/2011/11/how-to-make-an-alert-bar/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=how-to-make-an-alert-bar</link> <comments>http://joshnh.com/2011/11/how-to-make-an-alert-bar/#comments</comments> <pubDate>Mon, 07 Nov 2011 03:22:07 +0000</pubDate> <dc:creator>Josh</dc:creator> <category><![CDATA[CSS]]></category><guid isPermaLink="false">http://joshnh.com/?p=208</guid> <description><![CDATA[What we will be making: Demo I have slowly noticed more and more sites using pop from the top style notifications. They can be very effective if used correctly. Today I am going to run through the creation of such an alert bar using only CSS; no images and no JavaScript. To make things even...  <a
href="http://joshnh.com/2011/11/how-to-make-an-alert-bar/" title="Read How to Make a Pure CSS Alert Bar">Read more &#187;</a>]]></description> <content:encoded><![CDATA[<p><img
src="http://joshnh.com/wp-content/uploads/2011/11/How-to-Make-a-Pure-CSS-Alert-Bar1.png" alt="How to Make a Pure CSS Alert Bar"><span
id="more-208"></span></p><h2>What we will be making:</h2><p><a
href="http://jsfiddle.net/joshnh/FxfHc/">Demo</a></p><p>I have slowly noticed more and more sites using <em>pop from the top</em> style notifications. They can be very effective if used correctly. Today I am going to run through the creation of such an alert bar using only CSS; no images and no JavaScript. To make things even more interesting, the bar will persist until clicked.</p><p>I won’t be using browser prefixes in this tutorial, make sure that you do. If you need help determining which prefixes to use for what properties then check out this handy site: <a
href="http://caniuse.com/">When can I use…</a></p><p>Before you read on <a
href="http://jsfiddle.net" target="_blank">click here</a> to load jsFiddle in a new tab.</p><h2>The Plan:</h2><ol><li><a
href="#step1">Markup</a></li><li><a
href="#step2">Form</a></li><li><a
href="#step3">Animation</a></li><li><a
href="#step4">Behaviour</a></li><li><a
href="#step5">Instruction</a></li><li><a
href="#step6">Design</a></li></ol><p>Want to see the finished code? <a
href="#final-product">Click here.</a></p><h2 id="step1">Step 1: Markup</h2><p>The markup is pretty straightforward: an anchor wrapped in a <code>div</code>. We will be doing a neat little trick with the anchor and <code>div</code> later on.</p><p><pre>&lt;div id=&quot;alert&quot;&gt;
    &lt;a class=&quot;alert&quot; href=&quot;#alert&quot;&gt;This is a slide down alert!&lt;/a&gt;
&lt;/div&gt;</pre></p><h2 id="step2">Step 2: Form</h2><p>Now let’s give the alert some basic form. To do that we need to consider what it is we want:</p><ul><li>100% width</li><li>Centered text</li><li>Attached to the top of the viewport</li><li>Above all other content</li><li>Bright color</li></ul><p>The following CSS produces an alert that matches our requirements nicely:</p><p><pre>.alert {
    background-color: #c4453c;
    color: #f6f6f6;
    display: block;
    font: bold 16px/40px sans-serif;
    height: 40px;
    position: absolute;
    text-align: center;
    text-decoration: none;
    top: -45px;
    width: 100%;
}</pre></p><p>Those with a keen eye may have noticed that I used <code>top: -45px;</code> instead of <code>top: 0;</code>. This is in preparation for the next step…</p><h2 id="step3">Step 3: Animation</h2><p>By default, the alert is hidden off the top of the screen, we are going to use an animation to slide it down. That way, browsers that don’t support animations (and probably some of the other advanced techniques we will be using) won’t see the alert at all. Here is a simple entrance animation for our notification:</p><p><pre>@keyframes alert {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { top: 0; }
}</pre></p><p>Now all we need to do is run the animation on the anchor.</p><p><pre>.alert {
    animation: alert 1s ease forwards;
}</pre></p><h2 id="step4">Step 4: Behaviour</h2><p>Now we have our alert showing, but wouldn’t it be great if there was a way to get rid of it when we had finished reading it? That’s where our wrapper <code>div</code> comes in. We are going to use the <code>:target</code> pseudo-class to style the wrapper when it becomes the target (the URL’s hash is the value of its <code>ID</code>). If you are unsure what I am talking about look back at the markup, see that the ‘href‘ matches the <code>ID</code> of the wrapper <code>div</code>?</p><p>Here is the relevant CSS:</p><p><pre>#alert:target {
    display: none;
}</pre></p><h2 id="step5">Step 5: Instruction</h2><p>Great, now we can close the alert. There is a slight problem though; how will users know that clicking closes the alert? Well let’s add a tooltip to inform them!</p><p>We can use pseudo-elements to avoid extra markup. We will use both the <code>:before</code> and <code>:after</code> pseudo-elements, one for the body of the tooltip, and one for the arrow.</p><p><pre>#alert {
    position: relative;
}
#alert:hover:after {
    background: hsla(0,0%,0%,.8);
    border-radius: 3px;
    color: #f6f6f6;
    content: &#039;Click to dismiss&#039;;
    font: bold 12px/30px sans-serif;
    height: 30px;
    left: 50%;
    margin-left: -60px;
    position: absolute;
    text-align: center;
    top: 50px;
    width: 120px;
}
#alert:hover:before {
    border-bottom: 10px solid hsla(0,0%,0%,.8);
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    content: &#039;&#039;;
    height: 0;
    left: 50%;
    margin-left: -10px;
    position: absolute;
    top: 40px;
    width: 0;
}</pre></p><p>Notice that I have used pseudo-elements with the <code>:hover</code> pseudo-class. This is fine to do as long as you order it as I have (pseudo-class before pseudo-element).</p><h2 id="step6">Step 6: Design</h2><p>We now have ourselves a beautifully working alert. It looks a bit plain though. How about using a linear gradient to give an effect similar to warning tape?</p><p><pre>.alert {
    background-image: linear-gradient(135deg, transparent,
                      transparent 25%, hsla(0,0%,0%,.1) 25%,
                      hsla(0,0%,0%,.1) 50%, transparent 50%,
                      transparent 75%, hsla(0,0%,0%,.1) 75%,
                      hsla(0,0%,0%,.1));
    background-size: 20px 20px;
}</pre></p><p>Finally, we can add a subtle border to the bottom to help separate the alert from the content below it. To do this I am going to use a simple <code>box-shadow</code>:</p><p><pre>.alert {
    box-shadow: 0 5px 0 hsla(0,0%,0%,.1);
}</pre></p><p>And that is it! Pretty simple wasn’t it?</p><h2 id="final-product">Final Product:</h2><p><pre>&lt;!-- HTML: --&gt;

&lt;div id=&quot;alert&quot;&gt;
    &lt;a class=&quot;alert&quot; href=&quot;#alert&quot;&gt;This is a slide down alert!&lt;/a&gt;
&lt;/div&gt;</pre><br
/><pre>/* CSS: */

#alert {
    position: relative;
}
#alert:hover:after {
    background: hsla(0,0%,0%,.8);
    border-radius: 3px;
    color: #f6f6f6;
    content: &#039;Click to dismiss&#039;;
    font: bold 12px/30px sans-serif;
    height: 30px;
    left: 50%;
    margin-left: -60px;
    position: absolute;
    text-align: center;
    top: 50px;
    width: 120px;
}
#alert:hover:before {
    border-bottom: 10px solid hsla(0,0%,0%,.8);
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    content: &#039;&#039;;
    height: 0;
    left: 50%;
    margin-left: -10px;
    position: absolute;
    top: 40px;
    width: 0;
}
#alert:target {
    display: none;
}
.alert {
    animation: alert 1s ease forwards;
    background-color: #c4453c;
    background-image: linear-gradient(135deg, transparent,
                      transparent 25%, hsla(0,0%,0%,.1) 25%,
                      hsla(0,0%,0%,.1) 50%, transparent 50%,
                      transparent 75%, hsla(0,0%,0%,.1) 75%,
                      hsla(0,0%,0%,.1));
    background-size: 20px 20px;
    box-shadow: 0 5px 0 hsla(0,0%,0%,.1);
    color: #f6f6f6;
    display: block;
    font: bold 16px/40px sans-serif;
    height: 40px;
    position: absolute;
    text-align: center;
    text-decoration: none;
    top: -45px;
    width: 100%;
}

@keyframes alert {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { top: 0; }
}</pre></p><p>I have attempted to keep this tutorial as short as possible so if you would like me to go into any more detail just let me know.</p><p><em>This arti­cle was orig­i­nally writ­ten for <a
href="http://forrst.com/posts/How_to_Make_a_Pure_CSS_Alert_Bar-TI6">Forrst</a>.</em></p> <img
src="http://joshnh.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=208" width="1" height="1" style="display: none;" />]]></content:encoded> <wfw:commentRss>http://joshnh.com/2011/11/how-to-make-an-alert-bar/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>CSS Animation Tips and Tricks</title><link>http://joshnh.com/2011/10/animation-tips-and-tricks/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=animation-tips-and-tricks</link> <comments>http://joshnh.com/2011/10/animation-tips-and-tricks/#comments</comments> <pubDate>Sat, 29 Oct 2011 03:14:48 +0000</pubDate> <dc:creator>Josh</dc:creator> <category><![CDATA[CSS]]></category><guid isPermaLink="false">http://joshnh.com/?p=193</guid> <description><![CDATA[CSS animations are becoming quite popular thanks to things like Animate.css and Animatable. I have been using them quite a bit recently and decided to compile a list of tips for those that haven’t spent that much time with them. Here are the things I will be discussing: Using multiple animations. Running sequential animations. Using...  <a
href="http://joshnh.com/2011/10/animation-tips-and-tricks/" title="Read CSS Animation Tips and Tricks">Read more &#187;</a>]]></description> <content:encoded><![CDATA[<p><img
src="http://joshnh.com/wp-content/uploads/2011/10/CSS-Animation-Tips-and-Tricks1.png" alt="CSS Animation Tips and Tricks"><span
id="more-193"></span></p><p>CSS animations are becoming quite popular thanks to things like <a
href="http://daneden.me/animate/">Animate.css</a> and <a
href="http://animatable.com/">Animatable</a>. I have been using them quite a bit recently and decided to compile a list of tips for those that haven’t spent that much time with them. Here are the things I will be discussing:</p><ol><li><a
href="#tip1">Using multiple animations.</a></li><li><a
href="#tip2">Running sequential animations.</a></li><li><a
href="#tip3">Using animation-fill-mode on delayed animations.</a></li><li><a
href="#tip4">Stopping your animations from flickering.</a></li><li><a
href="#tip5">Controlling the play state of your animations.</a></li></ol><p>For those that aren’t familiar with the <code>animation</code> syntax please check out Chris Coyier’s neat <a
href="http://css-tricks.com/snippets/css/webkit-keyframe-animation-syntax/">write up</a>.</p><p>Keep in mind that for now all browser prefixes will need to be used (<code>webkit</code>, <code>moz</code>, <code>ms</code> and <code>o</code>).</p><h2 id="tip1">Use multiple animations</h2><p>This one is pretty straightforward: you may list several animations and have them all run together. You would do so like this:</p><p><pre>animation: fadeIn 1s ease-in,
           rotate 2s linear 2 alternate;</pre></p><p>Details on the animation shorthand property can be found <a
href="http://dev.w3.org/csswg/css3-animations/#animation">here</a>.</p><h2 id="tip2">Run sequential animations</h2><p>But what if you didn’t want both of the above animations to start at the same time? What if you wanted the first animation to complete before the second began? This is achievable by setting a delay on the second animation equal to the duration of the first animation:</p><p><pre>animation: fadeIn 1s ease-in,
           rotate 2s linear 1s 2 alternate;</pre></p><h2 id="tip3">Use animation-fill-mode on delayed animations</h2><p>This one is a little trickier to explain but let’s say that you had the following:</p><p><pre>div {
    animation: fadeIn 1s ease-in,
               rotate 2s linear 1s 2 alternate;
}
@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}
@keyframes rotate {
    0% { -webkit-transform: rotate(45deg); }
    100% { -webkit-transform: rotate(0deg); }
}</pre></p><p>That code won’t work as well as you might think (<a
href="http://jsfiddle.net/joshnh/HDgcJ/">see here</a>): the first animation will run, and then, as the second animation starts, the <code>div</code> will instantly rotate 45 degrees. You can combat this by using the <code>animation-fill-mode</code> property.</p><p><pre>div {
   animation: fadeIn 1s ease-in,
              rotate 2s linear 1s 2 alternate both;
}</pre></p><p>Basically, defining a fill-mode will display the animation’s first/last keyframe before/after the animation runs. More information can be found <a
href="http://css-infos.net/property/-webkit-animation-fill-mode">here</a>.</p><h2 id="tip4">Stop your animations from flickering</h2><p>This is a nifty little trick I found while troubleshooting a problem. <a
href="http://css3animator.com/2010/12/fight-the-flicker-making-your-css3-animation-bomb-proof/">Here</a> is the write up.</p><h2 id="tip5">Control the play state of your animations</h2><p>I haven’t actually found a use for this last tip yet but I’m hoping I will shortly. Put simply, the <code>animation-play-state</code> defines whether an animation is running or paused. As far as I am aware, you cannot include this property in the <code>animation</code> shorthand. <a
href="http://jsfiddle.net/joshnh/DXre5/">Here</a> is an example of how it works.</p><p><em>This arti­cle was orig­i­nally writ­ten for <a
href="http://forrst.com/posts/CSS_Animation_Tips_Tricks-P2X">Forrst</a>.</em></p> <img
src="http://joshnh.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=193" width="1" height="1" style="display: none;" />]]></content:encoded> <wfw:commentRss>http://joshnh.com/2011/10/animation-tips-and-tricks/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>How to Make a CSS Speech Bubble With a Drop Shadow</title><link>http://joshnh.com/2011/10/how-to-make-a-speech-bubble-with-a-drop-shadow/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=how-to-make-a-speech-bubble-with-a-drop-shadow</link> <comments>http://joshnh.com/2011/10/how-to-make-a-speech-bubble-with-a-drop-shadow/#comments</comments> <pubDate>Tue, 18 Oct 2011 01:44:11 +0000</pubDate> <dc:creator>Josh</dc:creator> <category><![CDATA[CSS]]></category><guid isPermaLink="false">http://joshnh.com/?p=178</guid> <description><![CDATA[What we will be making: Demo CSS speech bubbles aren’t new, but they are often flat and ugly. Below I will share some techniques to improve upon the design and add a seamless drop shadow. It is possible that you are familiar with many or all of the techniques used, if that is the case...  <a
href="http://joshnh.com/2011/10/how-to-make-a-speech-bubble-with-a-drop-shadow/" title="Read How to Make a CSS Speech Bubble With a Drop Shadow">Read more &#187;</a>]]></description> <content:encoded><![CDATA[<p><a
href="http://joshnh.com/2011/10/how-to-make-a-speech-bubble-with-a-drop-shadow/"><img
src="http://joshnh.com/wp-content/uploads/2011/10/How-to-Make-a-CSS-Speech-Bubble-With-a-Drop-Shadow1.png" alt="How to Make a CSS Speech Bubble With a Drop Shadow" title="" width="684" height="311" class="alignnone size-full wp-image-713" /></a><span
id="more-178"></span></p><h2>What we will be making:</h2><p><a
href="http://jsfiddle.net/joshnh/ptbbS/">Demo</a></p><p>CSS speech bubbles aren’t new, but they are often flat and ugly. Below I will share some techniques to improve upon the design and add a seamless drop shadow. It is possible that you are familiar with many or all of the techniques used, if that is the case I would love for you to share an example of when you have had to use some <em>outside of the box</em> CSS. Before you read on <a
href="http://jsfiddle.net">click here</a> to load jsFiddle in a new tab.</p><h2>The Plan:</h2><ol><li><a
href="#step1">Write the markup</a></li><li><a
href="#step2">Basic styling</a></li><li><a
href="#step3">Improve the design of the bubble</a></li><li><a
href="#step4">Add an arrow</a></li><li><a
href="#step5">Give it a shadow</a></li></ol><p>Want to see the finished code? <a
href="#final-product">Click here.</a></p><h2 id="step1">Step 1: Write the Markup</h2><p>The markup for this is very simple. We are going to wrap our text in a <code>span</code> with a class of <code>bubble</code>.</p><p><pre>&lt;span class=&quot;bubble&quot;&gt;Speech bubble with a shadow&lt;/span&gt;</pre></p><h2 id="step2">Step 2: Basic styling</h2><p>Now let’s get the basic styling out of the way. This will include choosing a background color for the bubble, giving it some font styling and also some padding. I like to order the properties alphabetically.</p><p><pre>.bubble {
    background-color: #fff0a0;
    color: #333;
    display: inline-block;
    font: 16px/25px sans-serif;
    padding: 15px 25px;
}</pre></p><p>I have also set the display to <code>inline-block</code> so that the bubble doesn’t break if the window is too narrow.</p><h2 id="step3">Step 3: Improve the design of the bubble</h2><p>Now that our bubble has some basic form we need to give it a design to make it stand out. Let’s give it a slight gradient, we can do that with the following code:</p><p><pre>background-image: -webkit-linear-gradient(top, hsla(0,0%,100%,.5), hsla(0,0%,100%,0));
background-image:    -moz-linear-gradient(top, hsla(0,0%,100%,.5), hsla(0,0%,100%,0));
background-image:     -ms-linear-gradient(top, hsla(0,0%,100%,.5), hsla(0,0%,100%,0));
background-image:      -o-linear-gradient(top, hsla(0,0%,100%,.5), hsla(0,0%,100%,0));
background-image:         linear-gradient(top, hsla(0,0%,100%,.5), hsla(0,0%,100%,0));</pre></p><p>If you look carefully at the code above you will notice that only white is being used, with the transparency fading out from <code>0.5</code> to <code>0</code>. This enables us to keep our code easy to edit; if you want to change the color of the bubble you only have to alter a single value. Now that our button has some depth lets add a <code>1px</code> highlight to the top. We can do this using an inset <code>box-shadow</code>.</p><p><pre>box-shadow: inset 0 1px 1px hsla(0,0%,100%,.5);</pre></p><p>Let’s also give the text a slight shadow, by using white we can give the illusion of letterpress.</p><p><pre>text-shadow: 0 1px 1px hsla(0,0%,100%,.5);</pre></p><p>Lastly, how about giving the bubble some rounded corners, it is a bubble after all!</p><p><pre>border-radius: 5px;</pre></p><h2 id="step4">Step 4: Add an arrow</h2><p>We are going to use a pseudo-element to add our arrow to the bottom right of our bubble. Internet Explorer 7 doesn’t support pseudo-elements but luckily it degrades gracefully. Before we start styling our arrow we are going to add the following line to our bubble class:</p><p><pre>position: relative;</pre></p><p>This allows us to use absolute positioning to position the arrow relative to the bubble. We will use the <code>:after</code> pseudo-element for our arrow. If you aren’t familiar with pseudo-elements and would like to learn some more I would recommend <a
href="http://coding.smashingmagazine.com/2011/07/13/learning-to-use-the-before-and-after-pseudo-elements-in-css/">reading this article</a>. We are also going to produce a triangle using borders, more information on that can be found <a
href="http://www.howtocreate.co.uk/tutorials/css/slopes">here</a>. Finally, we will use absolute positioning to place the arrow appropriately.</p><p><pre>.bubble:after {
    border-bottom: 25px solid transparent;
    border-right: 25px solid #fff0a0;
    bottom: -25px;
    content: &#039;&#039;;
    position:
    absolute;
    right: 25px;
}</pre></p><h2 id="step5">Step 5: Give it a shadow</h2><p>Giving the bubble a drop shadow is quite easy, we simply add it to the <code>box-shadow</code> property that is already declared:</p><p><pre>box-shadow: inset 0 1px 1px hsla(0,0%,100%,.5),
            3px 3px 0 hsla(0,0%,0%,.1);</pre></p><p>Giving the arrow the same shadow is not as easy though. Luckily we have a second pseudo-element to work with, let’s use that. Most of the rules we will be declaring for the arrow’s shadow will match that of the arrow itself so rather than rewriting the rules let’s group the selectors.</p><p><pre>.bubble:after,
.bubble:before {
    border-bottom: 25px solid transparent;
    border-right: 25px solid #fff0a0;
    bottom: -25px;
    content: &#039;&#039;;
    position: absolute;
    right: 25px;
}</pre></p><p>Now we simply rewrite the rules that will be different. We will need to change the color to match that of the shadow, and also adjust the positioning. This is the last bit of styling we need:</p><p><pre>.bubble:before {
    border-right: 25px solid hsla(0,0%,0%,.1);
    bottom: -28px;
    right: 22px;
}</pre></p><h2 id="final-product">Final Product:</h2><p><pre>&lt;!-- HTML: --&gt;

&lt;span class=&quot;bubble&quot;&gt;Speech bubble with a shadow&lt;/span&gt;</pre><br
/><pre>/* CSS: */

.bubble {
    background-color: #fff0a0;
    background-image: -webkit-linear-gradient(top, hsla(0,0%,100%,.5), hsla(0,0%,100%,0));
    background-image:    -moz-linear-gradient(top, hsla(0,0%,100%,.5), hsla(0,0%,100%,0));
    background-image:     -ms-linear-gradient(top, hsla(0,0%,100%,.5), hsla(0,0%,100%,0));
    background-image:      -o-linear-gradient(top, hsla(0,0%,100%,.5), hsla(0,0%,100%,0));
    background-image:         linear-gradient(top, hsla(0,0%,100%,.5), hsla(0,0%,100%,0));
    border-radius: 5px;
    box-shadow: inset 0 1px 1px hsla(0,0%,100%,.5),
                3px 3px 0 hsla(0,0%,0%,.1);
    color: #333;
    display: inline-block;
    font: 16px/25px sans-serif;
    padding: 15px 25px;
    position: relative;
    text-shadow: 0 1px 1px hsla(0,0%,100%,.5);
}
.bubble:after,
.bubble:before {
    border-bottom: 25px solid transparent;
    border-right: 25px solid #fff0a0;
    bottom: -25px;
    content: &#039;&#039;;
    position: absolute;
    right: 25px;
}
.bubble:before {
    border-right: 25px solid hsla(0,0%,0%,.1);
    bottom: -28px;
    right: 22px;
}</pre></p><p>Now it’s time to experiment with what you have learnt!</p><p><em>This arti­cle was orig­i­nally writ­ten for <a
href="http://forrst.com/posts/How_to_Make_a_Pure_CSS_Speech_Bubble_With_a_Drop-PU1">Forrst</a>.</em></p> <img
src="http://joshnh.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=178" width="1" height="1" style="display: none;" />]]></content:encoded> <wfw:commentRss>http://joshnh.com/2011/10/how-to-make-a-speech-bubble-with-a-drop-shadow/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
Page Caching using disk: enhanced

Served from: joshnh.com @ 2012-05-28 14:37:32 -->

