<?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>Webdesigner Depot &#187; Programming</title> <atom:link href="http://www.webdesignerdepot.com/category/programming/feed/" rel="self" type="application/rss+xml" /><link>http://www.webdesignerdepot.com</link> <description>Web Design Resources and Tutorials</description> <lastBuildDate>Fri, 10 Feb 2012 09:48:34 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=abc</generator> <item><title>Zurb’s newest offering for developers: Foundation</title><link>http://www.webdesignerdepot.com/2012/01/zurbs-newest-offering-for-developers-foundation/</link> <comments>http://www.webdesignerdepot.com/2012/01/zurbs-newest-offering-for-developers-foundation/#comments</comments> <pubDate>Thu, 05 Jan 2012 09:38:56 +0000</pubDate> <dc:creator>Cameron</dc:creator> <category><![CDATA[Programming]]></category> <category><![CDATA[Web Design]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[framework]]></category> <category><![CDATA[prototyping]]></category> <category><![CDATA[wireframing]]></category> <category><![CDATA[zurb]]></category><guid
isPermaLink="false">http://www.webdesignerdepot.com/?p=27818</guid> <description><![CDATA[Zurb has a long history of providing awesome web apps and resources for designers and developers. Their apps include Notable, Axe, Enroll, and Spur, among others. Other resources from Zurb include everything from downloadable sketchsheets and grid paper, CSS buttons, CSS3 tools, visual effects &#38; animation examples, and a lot more. Zurb has recently launched [...]]]></description> <content:encoded><![CDATA[<p><a
href="http://netdna.webdesignerdepot.com/uploads/2011/11/thumb14.jpg"><img
class="alignleft size-full wp-image-27819" title="thumb" src="http://netdna.webdesignerdepot.com/uploads/2011/11/thumb14.jpg" alt="foundation" width="200" height="160" /></a><a
rel="nofollow" href="http://www.zurb.com/" target="_blank">Zurb</a> has a long history of providing awesome web apps and resources for designers and developers. Their apps include Notable, Axe, Enroll, and Spur, among others.</p><p>Other resources from Zurb include everything from downloadable sketchsheets and grid paper, CSS buttons, CSS3 tools, visual effects &amp; animation examples, and a lot more.</p><p>Zurb has recently launched a new tool for designers, called <a
href="http://foundation.zurb.com/">Foundation</a>, a free rapid prototyping framework.</p><p>Zurb&#8217;s Lead Designer, Jonathan, answered some questions for us about the new project.<span
id="more-27818"></span></p><h2>What is Foundation?</h2><p><a
href="http://foundation.zurb.com/">Foundation</a> is a framework for quickly prototyping and building responsive sites and apps. It allows you to rapidly put together pages, including layout and common elements like navigation, pagination, forms and more so you can see how your site works on desktops, tablets and phones. Then you can take that code and customize or adapt it into rock-solid production code.</p><h2>Why was Foundation built?</h2><p>We realized that the tools out there for building responsive sites &#8211; sites that work on any kind of device &#8211; were not only insufficient but really non-existent. There are a number of CSS frameworks that people are using, but everything was designed for fixed layouts. Mobile devices will account for over half of all Internet traffic in the next 2 years, so not designing and building for them is a death sentence for online products or services. We wanted a tool that would let us not only deliver a great experience to every device, but to very quickly test out what a great experience really looked and felt like.</p><h2>Talk about a site you had to use Foundation for? How did it help? What issues did you have to deal with?</h2><p>We&#8217;ve used Foundation for all of our internal sites and projects for the last several months, but if I had to pick one great example it would be a web app we released recently called Spur. Spur is a tool for doing traditional design critiques by letting you capture a web page, or upload an image, and then view it with blur, heightened contrast, rotation and other effects that reveal how the visual design holds up. We designed it from the ground up with Foundation to support desktops, tablets, and iPhones; all from the same front-end codebase.</p><p>If you pull up the app on different devices you&#8217;ll see different tools and subtly modified layouts all made possible with Foundation&#8217;s mobile visibility classes. These let you easily tag elements to be hidden or shown on specific types of devices, such as &#8216;hide-on-phones&#8217; or &#8216;show-on-tablets&#8217;. That and Foundation&#8217;s inherent ability to scale to most any size meant that Spur has a slick, tailored experience for any device type with very little additional effort.</p><p>Working entirely with percentages of course adds some complexity, especially regarding images and the flexibility of certain objects like toolbars but beyond some specific CSS Foundation took care of almost everything.</p><h2>Who should be using Foundation?</h2><p>Anyone who wants their site or app to be relevant in a couple years should be building for multiple devices, and Foundation is a good tool for doing that. Foundation is perfect for new sites that you want to quickly prototype and build, since you can lay out entire sites in just a few minutes using the flexible grid and common elements already included.</p><p>We&#8217;ve found Foundation to be especially helpful for companies or organization who have concerns about the cost (in time and resources) to build for mobile devices &#8211; Foundation helps you do things quickly and all at once.</p><h2>What&#8217;s the future for Foundation?</h2><p>We&#8217;re constantly working on Foundation, adding common elements that people have requested or we&#8217;ve seen a need for. We just recently added a new four-column phone grid so you can do more complex layouts for very small devices, and we&#8217;ll continue to work on device and pattern support. We&#8217;re also considering things like page templates, code packs for specific uses like wireframing, and working with outside developers on plugins for other frameworks like Less, SaSS, Drupal, WordPress, etc.</p><p>Our goal is for Foundation to be more than just an open-source Framework but a complete community and development approach for the front-end. We&#8217;d love to have even more contributors, both in issues, feature requests, and code on <a
href="http://www.github.com/zurb/foundation">Github</a> and we&#8217;re happy to answer questions at  foundation@zurb.com.</p><p><br/><br
/><table
width="100%" style="border-top:1px solid #d7d7d7; border-bottom:1px solid #d7d7d7;" height="20"><tr><td
valign="center"> <a
href="http://www.mightydeals.com/deal/wpbusinessbundle.html?ref=inwidget"><font
face="Arial" size="3" color="#e64f32"><b>Never Ending WordPress Business Bundle &#8211; only $14!</b></font></a></td><td
width="90"> <a
href="http://www.mightydeals.com/?ref=inwidget"><br
/> <img
src="http://mightydeals.com/web/images/widget-logo.png" height="40" width="90" border="0"  /><br
/> </a></td></tr></table><p><br/></p> <a
href="http://www.webdesignerdepot.com/2012/01/zurbs-newest-offering-for-developers-foundation/">Source</a><style type="text/css">
 p img {display:inline-block; margin-right:10px;}
.alignleft {float:left;}
p.showcase {clear:both;}
body#browserfriendly p, body#podcast p, div#emailbody p{margin:0;}
</style>]]></content:encoded> <wfw:commentRss>http://www.webdesignerdepot.com/2012/01/zurbs-newest-offering-for-developers-foundation/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>An awesome HTML5 interactive music video</title><link>http://www.webdesignerdepot.com/2011/12/ready-an-awesome-html5-interactive-music-video/</link> <comments>http://www.webdesignerdepot.com/2011/12/ready-an-awesome-html5-interactive-music-video/#comments</comments> <pubDate>Fri, 09 Dec 2011 09:13:40 +0000</pubDate> <dc:creator>Cameron</dc:creator> <category><![CDATA[HTML 5]]></category> <category><![CDATA[Interviews]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[html5]]></category> <category><![CDATA[interactive video]]></category> <category><![CDATA[JavaScript]]></category> <category><![CDATA[music video]]></category><guid
isPermaLink="false">http://www.webdesignerdepot.com/?p=28020</guid> <description><![CDATA[Designers and developers are pushing the envelope with what&#8217;s possible in interactive design on a continuous basis. And awesome new examples come out all the time. One of the newest examples is an interactive music video for Evelyn, by ABBY. It&#8217;s a fantastic site that gives you the opportunity to mix different instruments and vocal [...]]]></description> <content:encoded><![CDATA[<p><a
href="http://netdna.webdesignerdepot.com/uploads/2011/12/thumb2.jpg"><img
class="alignleft size-full wp-image-28021" title="thumb" src="http://netdna.webdesignerdepot.com/uploads/2011/12/thumb2.jpg" alt="Interactive Music Video" width="200" height="160" /></a>Designers and developers are pushing the envelope with what&#8217;s possible in interactive design on a continuous basis. And awesome new examples come out all the time.</p><p>One of the newest examples is an <a
href="http://evelyn-interactive.searchingforabby.com/">interactive music video</a> for <em>Evelyn</em>, by ABBY.</p><p>It&#8217;s a fantastic site that gives you the opportunity to mix different instruments and vocal styles together, while the song is playing, for a completely custom experience.</p><p>We asked the developers how they created such an awesome interactive video, and got their tips for working on projects of this type.<span
id="more-28020"></span></p><h2>1. Where did the idea for the video come from? What was the creative process?</h2><p>Although we were not directly involved in the creative process we will give you a short summary on how it was created.</p><p>We, Steffen &amp; Dominik, just founded a web development agency in Berlin called <a
href="http://bleech.de">bleech</a> specializing in HTML5 and other modern web technologies. We have our office in a shared space together with a recording studio which is run by the members of the band <a
rel="nofollow" href="http://www.searchingforabby.com/" target="_blank">ABBY</a>. The space is completed by a booking agency and an iOS agency.</p><p>Most of us have known each other since college and we have worked together since then on many different projects in many diverse and creative environments.</p><p>The actual idea for the video was developed by a friend of us who studied design. He needed a topic for his thesis and had the vision of creating an interactive experience which lets the user experiment with the different components of a modern song.</p><p><a
href="http://evelyn-interactive.searchingforabby.com/"><img
class="alignnone size-full wp-image-28022" title="abby" src="http://netdna.webdesignerdepot.com/uploads/2011/12/abby.jpg" alt="" width="615" height="458" /></a></p><p><br
class="spacer_" /></p><h2>2. Can you give a quick overview of the process for actually creating the video, the steps involved, etc.?</h2><p>One of the biggest challenges for the band was to select the adequate instruments which differ in their sound and characteristics but at the same time have a pleasant sound and harmonize with each other. Additionally they had to ensure that the rhythms and harmonics of the newly integrated tracks did not, at any time, go against each other.</p><p>We believe they did a really great job on this.</p><p>The entire idea was developed without dealing with any technical requirements regarding web technology. So they started recording one video for each audio track in a historic sound studio in Berlin. This resulted in a total of 20 individual videos, which then had to be merged to make the idea become reality. For this task they asked a befriended Flash developer to make a website where you can control the different tracks and mix your own version of the song. Unfortunately, he faced some difficulties with the syncing process over a network connection, so that early draft never made it to a final release.</p><p>That&#8217;s when we came in. We felt challenged to prove that it was possible to bring their idea to life with the latest technologies that nobody has yet used in this exact way.</p><p>We started building the foundation in a test-driven JavaScript environment to ensure a consistent communication between the videos, our mediacontrollers, and the global timeline module. The mediacontrollers take care of switching the videos and displaying only the currently selected track. The timeline module serves as a reference time for each mediacontroller and syncs them if necessary.</p><p><br
class="spacer_" /></p><h2>3. What unexpected challenges presented themselves during the project? What advice would you give a developer who wanted to create a project like this?</h2><p>A tough part in the development process was to keep the videos in sync without doing to many computations and to ensure that even on older computers a good, responsive user experience is possible.</p><p>The methods we found out to be most effective were an aggregation of several algorithms which keep the videos in sync and adapt to the machine&#8217;s performance by increasing the threshold and the frequency of how often the syncing is triggered.</p><p>The biggest challenge though was fine tuning in the millisecond area, as for a song with 120 beats per minute, an offset of 50ms of any of the tracks would clearly be noticed by the listener. Finally, we managed to get all of the audio and video tracks in sync by less than 10ms on high performance computers (like a 2011 MacBook Pro / Air).</p><p>If you&#8217;re planning on developing a media-driven HTML5 project, be prepared for sleepless nights optimizing small pieces of code, unforeseen browser bugs, and a million possible ways to implement a single function.</p><p><br
class="spacer_" /></p><h2>4. Where do you see this kind of content going in the next couple of years?</h2><p>We hope that more developers start to experiment with media-related web projects and hope to see new frameworks being created for media rich applications. Up to this point Java (processing) and Flash still have some advantages for certain use cases.</p><p>The most prominent developments in HTML5 at the moment are definitely the audio and video capabilities and we are looking forward to features like the mediacontroller or device element being implemented in new browsers.</p><p>With modern server technologies such as websocket, we are waiting to see the delivery of real-time events to the user instead of only serving static, prerecorded content. Additionally, it would be great to see more large scale interactive content that integrates social experience with existing media channels. The usual stuff that everybody is talking about right now&#8230;</p><p>We are glad to be part of this project and to work with great artists with various expertise. The project has become our little baby and we are really overwhelmed by the positive response.</p><p>BTW, we&#8217;re looking for people to support our growing team.</p><p><br
class="spacer_" /></p><p><em><strong>What other awesome HTML5 projects have you seen recently? Let us know in the comments!</strong></em></p><p><br/><br
/><table
width="100%" style="border-top:1px solid #d7d7d7; border-bottom:1px solid #d7d7d7;" height="20"><tr><td
valign="center"> <a
href="http://www.mightydeals.com/deal/wpbusinessbundle.html?ref=inwidget"><font
face="Arial" size="3" color="#e64f32"><b>Never Ending WordPress Business Bundle &#8211; only $14!</b></font></a></td><td
width="90"> <a
href="http://www.mightydeals.com/?ref=inwidget"><br
/> <img
src="http://mightydeals.com/web/images/widget-logo.png" height="40" width="90" border="0"  /><br
/> </a></td></tr></table><p><br/></p> <a
href="http://www.webdesignerdepot.com/2011/12/ready-an-awesome-html5-interactive-music-video/">Source</a><style type="text/css">
 p img {display:inline-block; margin-right:10px;}
.alignleft {float:left;}
p.showcase {clear:both;}
body#browserfriendly p, body#podcast p, div#emailbody p{margin:0;}
</style>]]></content:encoded> <wfw:commentRss>http://www.webdesignerdepot.com/2011/12/ready-an-awesome-html5-interactive-music-video/feed/</wfw:commentRss> <slash:comments>8</slash:comments> </item> <item><title>40 useful APIs for web designers and developers</title><link>http://www.webdesignerdepot.com/2011/07/40-useful-apis-for-web-designers-and-developers/</link> <comments>http://www.webdesignerdepot.com/2011/07/40-useful-apis-for-web-designers-and-developers/#comments</comments> <pubDate>Fri, 22 Jul 2011 11:01:50 +0000</pubDate> <dc:creator>Walter</dc:creator> <category><![CDATA[Code]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Resources]]></category> <category><![CDATA[apis]]></category> <category><![CDATA[Coding]]></category> <category><![CDATA[developers]]></category> <category><![CDATA[google api]]></category> <category><![CDATA[yahoo api]]></category><guid
isPermaLink="false">http://www.webdesignerdepot.com/?p=24158</guid> <description><![CDATA[An application programming interface (API) is a set of rules and specifications that software programs can follow to communicate or &#8216;interface&#8217; with each other. As developers are well aware, there are hundreds of APIs out there for doing almost anything you could imagine online. Some are better than others, and some are definitely more useful [...]]]></description> <content:encoded><![CDATA[<p><a
href="http://netdna.webdesignerdepot.com/uploads/2011/06/thumb15.jpg"><img
class="alignleft size-full wp-image-24162" title="thumb" src="http://netdna.webdesignerdepot.com/uploads/2011/06/thumb15.jpg" alt="" width="200" height="160" /></a>An application programming interface (API) is a set of rules and specifications that software programs can follow to communicate or &#8216;interface&#8217; with each other.</p><p>As developers are well aware, there are hundreds of APIs out there for doing almost anything you  could imagine online. Some are better than others, and some are  definitely more useful than others.</p><p>Below are forty of the most useful APIs out there. The included APIs  will let you do everything from shortening a URL to displaying a book  preview on your site to interacting with your Twitter account, and  everything in between.</p><p>Please share with us which APIs have you found most useful and feel free to recommend others that we may have missed&#8230;<span
id="more-24158"></span></p><h1>The Google APIs</h1><p><a
href="http://code.google.com/apis/maps/documentation/staticmaps/"><img
class="size-full wp-image-24159 alignright" title="staticmaps" src="http://netdna.webdesignerdepot.com/uploads/2011/06/staticmaps.jpg" alt="" width="290" height="290" /></a></p><p>Google offers dozens of APIs for web designers and developers.</p><p>Some  are specifically related to popular Google products, like Gmail and  Analytics, while others are more specialized and aren&#8217;t part of public  programs.</p><p>All are free to use, of course. You can view all of Google&#8217;s  APIs and code tools on their <a
href="http://code.google.com/more/">site directory</a>.</p><ul><li><a
href="http://code.google.com/apis/feed/">Feed API</a> &#8211; The  Google Feed API lets you download any public feed (including RSS, Media  RSS, and Atom) and then combine them into mashups. It simplifies the  mashup process by using JavaScript rather than more complex server-side  coding.</li><li><a
href="http://code.google.com/apis/maps/documentation/places/">Places API</a> &#8211; Google Places is a large directory of local businesses and  attractions all around the world. The Places API lets you access that  information and display it on your website, as well as display check-ins  by users.</li><li><a
href="http://code.google.com/apis/maps/documentation/geocoding/">Geocoding API</a> &#8211; The Geocoding API lets you convert any address into geographic coordinates, which can then be used to place markers on a map.</li><li><a
href="http://code.google.com/apis/tasks/">Tasks API</a> &#8211; The Tasks API offers endpoints for reading, searching, and updating Google Tasks content and metadata.</li><li><a
href="http://code.google.com/apis/analytics/docs/mgmt/home.html">Analytics Management API</a> &#8211; The Analytics Management API gives improved access to your Analytics  data, and lets you fine-tune your requests to just pull the information  and reports you need for your application.</li><li><a
href="http://code.google.com/apis/blogger/">Blogger Data API</a> &#8211; The Blogger Data API lets your application create and post new blog  posts, edit or delete existing posts, and search for posts based on  specific criteria.</li><li><a
href="http://code.google.com/apis/books/">Books API</a> &#8211; The Google Books API lets you integrate book searches into your application, and embed book previews on your site.</li><li><a
href="http://code.google.com/apis/calendar/overview/">Calendar API</a> &#8211; The Calendar API gives access to many of the standard web interface  tools and operations to your web app. Public calendar events can be  searched and viewed without authentication, while authenticated sessions  can access private calendars, as well as edit, create, or delete those  calendars.</li><li><a
href="http://code.google.com/apis/moderator/">Moderator API</a> &#8211;  Google Moderator is a tool for collecting ideas, questions, and  recommendations from any size audience. The API allows your website or  application to do the same.</li><li><a
href="http://code.google.com/apis/predict/">Prediction API</a> &#8211;  The Prediction API helps you make smarter apps that can analyze  historic data and predict future outcomes. It can be used for things  like recommendation systems, spam detection, upsell opportunity  analysis, and more.</li><li><a
href="http://code.google.com/apis/picasaweb/overview.html">Picasa Web Albums Data API</a> &#8211; The PWA Data API can be used to create albums and upload, retrieve,  or comment on photos, among other features. It&#8217;s been used for  everything from powering digital photo frames to full-featured mobile  clients and more.</li><li><a
href="http://code.google.com/apis/maps/documentation/staticmaps/">Static Maps API</a> &#8211; You don&#8217;t always want an interactive map on your site. Sometimes a  static map is just what you need. The Static Map API lets you embed  static Google Maps onto your site, including custom styled maps.</li><li><a
href="http://code.google.com/apis/maps/documentation/directions/">Directions API</a> &#8211; The Directions API lets your users get directions from one point to  another using a variety of travel modes from within your site or app,  and doesn&#8217;t require a Google Maps API Key.</li><li><a
href="http://code.google.com/apis/youtube/getting_started.html#data_api">YouTube APIs</a> &#8211; YouTube has two APIs available: Player APIs and Data API. The Player  APIs allow you to have an embedded player, or a chromeless player that  you can then customize within HTML or Flash. The Data API lets your app  perform a lot of the operations available on YouTube, including  uploading videos and modifying user playlists.</li><li><a
href="http://code.google.com/apis/webmastertools/">Webmaster Tools API</a> &#8211; The Webmaster Tools API lets your client application use a variety of  Webmaster Tools functions, including viewing sites, adding and removing  sites, verifying site ownership, and submitting and deleting Sitemaps.</li><li><a
href="http://code.google.com/apis/webfonts/">Google Web Fonts API</a> &#8211; The Web Fonts API makes it easy to add free web fonts to your website  or application. Their collection of fonts grows on a continuous basis  and already includes a huge variety.</li><li><a
href="http://www.opensocial.org/">OpenSocial</a> &#8211; OpenSocial  can be used for building social applications, creating social app  platforms, and sharing and accessing social data.</li></ul><p><br
class="spacer_" /></p><h1>The Yahoo! APIs</h1><p>Like Google, Yahoo! offers a number of APIs useful for developers.  All are free to use and can help you integrate a variety of Yahoo!-owned  web services into your app, including Flickr and Delicious.</p><ul><li><a
href="http://developer.yahoo.com/answers/">Answers API</a> &#8211; The  Answers API lets you access the collective knowledge contained within  Yahoo! Answers. You can search Answers based on a variety of criteria  (including specific user, category, and more), set your app to watch for  new questions in the categories you choose, and track new answers from  specific users.</li><li><a
href="http://developer.yahoo.com/social/contacts/">Contacts API</a> &#8211; The Contacts API lets you access relationships in your Yahoo! address  book. It reads a user&#8217;s Contacts information while respecting user  privacy and permission settings.</li><li><a
href="http://developer.yahoo.com/delicious/">Delicious API</a> &#8211; The Delicious API gives read/write access to Delicious bookmarks and tags.</li><li><a
href="http://developer.yahoo.com/fireeagle/">Fire Eagle Developer API</a> &#8211; The Fire Eagle API helps you create location-aware websites and applications.</li><li><a
href="http://developer.yahoo.com/flickr/">Flickr API</a> &#8211; With the Flickr API you can view, search, and manipulate photo tags, display photos from a specific user or group, and more.</li><li><a
href="http://developer.yahoo.com/local/">Local API</a> &#8211; The Local API lets you access location-based information and user-contributed content.</li><li><a
href="http://developer.yahoo.com/maps/">Maps APIs</a> &#8211; Yahoo! offers a number of APIs for their Maps services, including an Ajax API, a REST API, and a No Coding API.</li><li><a
href="http://developer.yahoo.com/meme/">Meme API</a> &#8211; Meme is a  multimedia light-blogging platform. The API lets you create apps that  can read, post, and repost content through Meme.</li><li><a
href="http://developer.yahoo.com/geo/placefinder/">PlaceFinder</a> &#8211; The PlaceFinder API, similar to Google&#8217;s GeoCoding API, and lets you convert a street address into geographic coordinates.</li></ul><p><br
class="spacer_" /></p><h1>More APIs</h1><p><a
href="http://dev.twitter.com/"><img
class="alignnone size-full wp-image-24160" title="twitter" src="http://netdna.webdesignerdepot.com/uploads/2011/06/twitter.jpg" alt="" width="615" height="450" /></a></p><p>Yahoo! and Google aren&#8217;t the only ones offering powerful APIs for  designers and developers. A number of social media sites and others have  their own API(s), including Twitter, Facebook, Yelp, Bit.ly, and many more.</p><ul><li><a
href="http://dev.twitter.com/">Twitter API</a> &#8211; Twitter has a  host of developer tools surrounding their API that let you create apps  that interact with virtually any of Twitter&#8217;s functions.</li><li><a
href="https://www.facebook.com/developers/">Facebook APIs</a> &#8211;  Facebook offers APIs for working with Credits, Ads, Chat, and more,  including a couple of legacy APIs that are no longer actively supported.  Also found here is the Graph API, which is the backbone of the Facebook  Platform, and enables your app to read and write data to Facebook.</li><li><a
href="http://totally.awe.sm/developers">Awe.sm</a> &#8211; Awe.sm offers a number of developer APIs for integrating their social media campaign tracking tools into your app or website.</li><li><a
href="https://developer.foursquare.com/">Foursquare APIv2</a> &#8211;  The Foursquare API not only allows you to create apps that interact with  the Foursquare service, but also to use Foursquare&#8217;s place-related  database as a standalone service.</li><li><a
href="http://developer.ning.com/">Ning API</a> &#8211; Ning offers a set of APIs for developing desktop and mobile apps, custom network features, profile apps, and data importers.</li><li><a
href="http://developers.soundcloud.com/">Soundcloud API</a> &#8211; Soundcloud&#8217;s API includes tools for sharing, streaming, and customizing the Soundcloud player for your website.</li><li><a
href="http://developer.klout.com/page">Klout API</a> &#8211; The Klout  API makes a variety of data available to developers, including Klout  Scores, Network Influence, Amplification Probability, True Reach, and  more.</li><li><a
href="http://www.socialmention.com/api/">Social Mention API</a> &#8211;  The Social Mention API provides a stream of real-time search data from a  number of social media services for integration into other  applications. It&#8217;s free for personal and non-commercial use.</li><li><a
href="http://www.realitydigital.com/opus-api.html">Opus Social Media API</a> &#8211; The Opus Social Media API can serve as a basis for developing a social networking and digital media site or app.</li><li><a
href="http://developers.digg.com/">Digg API</a> &#8211; Digg offers an API that lets you access their newsfeeds for your own sites and applications.</li><li><a
href="http://www.yelp.com/developers/getting_started">Yelp API</a> &#8211; The Yelp API lets you access business listing info, business ratings,  and review excerpts from Yelp in your application or website.</li><li><a
href="http://www.zillow.com/webtools/neighborhood-data/">Zillow Neighborhood Information APIs</a> &#8211; Real estate site Zillow offers APIs that give access to neighborhood  information that can be integrated into other applications. (They also  offer a number of other APIs, including postings, property details, home  valuations, and more.)</li><li><a
href="https://www.tropo.com/home.jsp">Tropo</a> &#8211; The Tropo API  adds Twitter, IM, voice and SMS functionality to a variety of common  programming languages. Development is free, though sending messages  varies in price (with Twitter and IM messages currently free).</li><li><a
href="http://code.google.com/p/bitly-api/wiki/ApiDocumentation">Bit.ly API</a> &#8211; Bit.ly offers an API for integrating URL shortening into your app or site.</li></ul><p><br
class="spacer_" /></p><p><em>Written exclusively for WDD by <a
href="http://cameronchapman.com/">Cameron Chapman</a>.</em></p><p><em><strong>Which APIs do you use? Are there any sites you&#8217;d like to see  an API from that doesn&#8217;t currently offer one? Let us know in the  comments!</strong></em></p><p><br/><br
/><table
width="100%" style="border-top:1px solid #d7d7d7; border-bottom:1px solid #d7d7d7;" height="20"><tr><td
valign="center"> <a
href="http://www.mightydeals.com/deal/wpbusinessbundle.html?ref=inwidget"><font
face="Arial" size="3" color="#e64f32"><b>Never Ending WordPress Business Bundle &#8211; only $14!</b></font></a></td><td
width="90"> <a
href="http://www.mightydeals.com/?ref=inwidget"><br
/> <img
src="http://mightydeals.com/web/images/widget-logo.png" height="40" width="90" border="0"  /><br
/> </a></td></tr></table><p><br/></p> <a
href="http://www.webdesignerdepot.com/2011/07/40-useful-apis-for-web-designers-and-developers/">Source</a><style type="text/css">
 p img {display:inline-block; margin-right:10px;}
.alignleft {float:left;}
p.showcase {clear:both;}
body#browserfriendly p, body#podcast p, div#emailbody p{margin:0;}
</style>]]></content:encoded> <wfw:commentRss>http://www.webdesignerdepot.com/2011/07/40-useful-apis-for-web-designers-and-developers/feed/</wfw:commentRss> <slash:comments>15</slash:comments> </item> <item><title>The secret power of bookmarklets</title><link>http://www.webdesignerdepot.com/2011/05/the-secret-power-of-bookmarklets/</link> <comments>http://www.webdesignerdepot.com/2011/05/the-secret-power-of-bookmarklets/#comments</comments> <pubDate>Tue, 17 May 2011 11:15:40 +0000</pubDate> <dc:creator>Walter</dc:creator> <category><![CDATA[Code]]></category> <category><![CDATA[How to]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[bookmarklets]]></category> <category><![CDATA[how to make a bookmarlet]]></category> <category><![CDATA[JavaScript]]></category> <category><![CDATA[js]]></category> <category><![CDATA[Tips]]></category><guid
isPermaLink="false">http://www.webdesignerdepot.com/?p=23088</guid> <description><![CDATA[Bookmarklets are special links that users can add to their browser’s favorites. These special links include code (i.e. not just a target URL), and they trigger various kinds of useful functionality, allowing you to modify and extend any web page. Once you begin using and building your own, you will no longer see web pages [...]]]></description> <content:encoded><![CDATA[<p><img
class="alignleft" src="http://netdna.webdesignerdepot.com/uploads/bookmarklets/bookmarklets-200-160.png" alt="" width="200" height="160" /><strong>Bookmarklets</strong> are special links that users can add to their browser’s  favorites.</p><p>These special links include code (i.e. not just a target  URL), and they trigger various kinds of useful functionality, allowing  you to modify and extend any web page.</p><p>Once you begin using and building  your own, you will no longer see web pages as static elements that you  have no control over.</p><p>With bookmarklets, you have the power to bend any  web page to your needs.<span
id="more-23088"></span></p><h1>How bookmarklets work</h1><p>Bookmarklets are more than static URLs. They are short bits of  JavaScript, loaded by a link, that operate on the currently open page.  Thus, the code becomes an extension of the current page and can interact  with any element on it.</p><p>The changes to the page are temporary and are not preserved. When the  user refreshes the page or follows a link, the JavaScript is lost.</p><p>Upon  returning to the page, the user must click the shortcut again to enable  the bookmarklet.</p><p><br
class="spacer_" /></p><h1>A sample bookmarklet</h1><p>Perhaps the best way to explain bookmarklets is to demonstrate one in action. <a
href="http://bit.ly/pages/tools">Bit.ly</a> is a powerful URL shortening service that happens to provide a handy <a
href="http://bit.ly/pages/tools">bookmarklet feature</a>. Simply drag the link to your toolbar and start using your fancy new link on any page on the web.</p><p><a
href="http://bit.ly/pages/tools"><img
class="image-border" src="http://netdna.webdesignerdepot.com/uploads/bookmarklets/1-google-bitly.png" border="0" alt="" width="615" height="334" /></a></p><p>When you click the Bit.ly bookmarklet, a panel loads on the current  page. Notice that this is not a new browser window, but rather code that  has been appended to the current page. Such bookmarklets enable  developers to bring functionality from their website to any page on the  web.</p><p><br
class="spacer_" /></p><h1>5 handy bookmarklets to get you started</h1><h2>Bit.ly</h2><p>Few things are as convenient as a tool that allows you to quickly shorten and share URLs. With the <a
href="http://bit.ly/pages/tools">Bit.ly bookmarklet</a>,  instead of copying a full URL path and sharing it, you can click a link  to generate a short version of it. You also gain the ability to track  how often that link is used. Not only that, but the link’s shortness  ensures that the link won’t break in an email, as longer complex URLs  often do.</p><h2>Shortwave</h2><p>Developers often go all out and pack a ton of functionality into a single bookmarklet. Such is the case with <a
href="http://shortwaveapp.com/">Shortwave</a> by Shaun Inman. This powerful shortcut packs a ton of search  functionality into a single place. You can search Google, Amazon,  Netflix and loads of other major sources. The only gotcha is that you  have to memorize commands to work with it. This hurdle aside, once you  get used to it, you’ll quickly become very reliant on it.</p><p><a
href="http://shortwaveapp.com/"><img
class="image-border" src="http://netdna.webdesignerdepot.com/uploads/bookmarklets/2-shockwave.png" border="0" alt="" width="615" height="392" /></a></p><p><br
class="spacer_" /></p><h2>ReCSS</h2><p><a
href="http://david.dojotoolkit.org/recss.html">ReCSS</a> is a  simple script that refreshes the CSS for a page but not the entire page  itself. On the surface, this might seem like an odd thing to want to do.  But consider if you are building an application or process that is  broken by a refresh. For example, if you are styling an error message,  instead of repeatedly performing an action that generates an error,  simply refresh the CSS to test different styles. When the time comes,  you’ll love this one.</p><p><br
class="spacer_" /></p><h2>autoPopulate</h2><p>If you have had to build many long forms, then surely you sympathize  with people who are frustrated with having to fill out forms over and  over again. This is where <a
href="http://www.dom111.co.uk/blog/coding/autopopulate-0-1/249">autoPopulate</a> comes in. The functionality here is rather simple: a bookmarklet that  automagically populates form fields with recurring data. You can also  build a custom version with your own values if needed.</p><p><a
href="http://www.dom111.co.uk/blog/coding/autopopulate-0-1/249"><img
class="image-border" src="http://netdna.webdesignerdepot.com/uploads/bookmarklets/3-autopopluate.png" border="0" alt="" width="615" height="470" /></a></p><p><br
class="spacer_" /></p><h2>Instapaper</h2><p><a
href="http://www.instapaper.com/">Instapaper</a> is an entire  service built around a bookmarklet. The handy tool saves pages that you  would like to read later. It conveniently syncs with your iPhone, iPad  and Kindle, allowing you to easily pick up where you left off reading.</p><p><img
src="http://netdna.webdesignerdepot.com/uploads/bookmarklets/4-instapaper.png" alt="" width="615" height="297" /></p><p><br
class="spacer_" /></p><h1>The ideal structure for bookmarklets</h1><p>There is a way to architect bookmarklets that ensures they are easy  to maintain. The principle is simple: use the bookmarklet as a shell to  load source files onto the page. This means that the meat of the code is  not actually contained in the bookmark. This eliminates the problem of  how to get users to update the bookmark after you’ve changed the code.</p><p>To prepare updates to your bookmark, simply construct the link so  that it loads all resources from your server onto the page. Typically,  this entails adding a JavaScript and CSS file to the page, and then  triggering the primary JavaScript to launch the functionality.</p><p>The following JavaScript appends a specified JavaScript file to the page:</p><pre><code>
 new_script=document.createElement('SCRIPT');
 new_script.type='text/javascript';
 new_script.src='http://www.your-site.com/script.js?';
 document.getElementsByTagName('head')[0].appendChild(new_script);

</code></pre><h1>A template for creating bookmarklets</h1><p>Building on this simple concept, below are two basic outlines for  creating your own bookmarklet. The main choice you will have to make is  whether to disable caching for your JavaScript file.</p><h2>Template 1: caching</h2><p>Template one does not prevent caching. This means your script will be  saved to the user’s computer for some period of time. It will  eventually be reloaded, but you have no way of knowing how soon. Here is  the template:</p><pre><code>javascript:(function(){
 new_script=document.createElement('SCRIPT');
 new_script.type='text/javascript';
 new_script.src='http://www.your-site.com/script.js?';
 document.getElementsByTagName('head')[0].appendChild(new_script);
})();

</code></pre><h2>Template 2: caching disabled</h2><p>This alternative includes a handy parameter to prevent caching of  your script. This is ideal for development because every time you use  the link, it will run the latest version on the server.</p><pre><code>javascript:(function(){
  new_script=document.createElement('SCRIPT');
 new_script.type='text/javascript';
 new_script.src='http://www.your-site.com/script.js?x=' +(Math.random());
  document.getElementsByTagName('head')[0].appendChild(new_script);
})();</code></pre><p>The cache is disabled simply by adding a random query string to the  end of the script tag. This makes the browser load the script each time  it is used.</p><p>Also, note that these functions are in a JavaScript wrapper that identifies them as JavaScript code.</p><p><br
class="spacer_" /></p><h1>How to use the templates</h1><p>Using these two templates, here is how you would put them to work.  First, replace the URL in the code with the full path to the JavaScript  file on your server. Secondly, place the code above in a link tag that  can be added to a page. It is this link that users will drag and drop  into their bookmarks.</p><p>Something like this should do the trick:</p><pre><code>&lt;a href="javascript:(function(){
new_script=document.createElement('SCRIPT');
new_script.type='text/javascript';
new_script.src='http://www.your-site.com/script.js?x=' +(Math.random());
document.getElementsByTagName('head')[0].appendChild(new_script);})();"&gt;Sample bookmarklet &lt;/a&gt;</code>
</pre><p>Note that all of the JavaScript had to be compressed to a single line  of code. This compression can be a pain to manage, so I prefer to use  this handy <a
href="http://ted.mielczarek.org/code/mozilla/bookmarklet.html">bookmarklet generator</a>.</p><p><a
href="http://ted.mielczarek.org/code/mozilla/bookmarklet.html"><img
class="image-border" src="http://netdna.webdesignerdepot.com/uploads/bookmarklets/5-crunchinator.png" border="0" alt="" width="615" height="351" /></a></p><p>Once you have the basic framework in place, you can begin adding any  JavaScript-based functionality to the scripts file for the bookmarklet.  Use the new link in your browser to test as you go!</p><p><br
class="spacer_" /></p><h1>Don’t forget the cache!</h1><p>One of the most frustrating aspects of developing bookmarklets is  browser caching. You can’t force a refresh of the file other than by  directly loading the source JavaScript file and then hitting “Refresh.”  Passing a query string parameter as found in template two above is much  easier.</p><p><br
class="spacer_" /></p><h1>A warning about “View source”</h1><p>Another point that generates a lot of frustration is the source view  of a web page. When running a bookmarklet and hitting the standard “View  source” option, you might be puzzled.</p><p>When a bookmarklet dynamically  adds code to the page, the standard source view will not show the  updated HTML. Instead, you have to use a plug-in like <a
href="http://getfirebug.com/">Firebug</a> or view the generated source using the <a
href="https://addons.mozilla.org/en-us/firefox/addon/web-developer/">Web Developer</a> toolbar.</p><p><br
class="spacer_" /></p><h1>Additional resources for building bookmarklets</h1><ul
class="tight_list"><li>The templates above are based on the tutorial at <a
href="http://betterexplained.com/articles/how-to-make-a-bookmarklet-for-your-web-application/">BetterExplained</a>.</li><li><a
href="http://marklets.com/">Marklets</a> is an awesome directory of bookmarklets.</li><li>Here is an outline for building <a
href="http://benalman.com/projects/run-jquery-code-bookmarklet/">jQuery-based bookmarklets</a>.</li></ul><p><br
class="spacer_" /></p><p><em>Written exclusively for WDD by Patrick McNeil. He is a freelance writer, developer and designer. In particular, he loves  to write about web design, train people in web development and build  websites. Patrick’s passion for web design trends and patterns can be  found in his books on <a
href="http://thewebdesignersideabook.com/">TheWebDesignersIdeaBook.com</a>. Follow Patrick on Twitter <a
href="http://twitter.com/#%21/designmeltdown/">@designmeltdown</a>.</em></p><p><em><strong>Can you think of a way to extend your application with a bookmarklet? How have you creatively used bookmarklets?</strong></em></p><p><br/><br
/><table
width="100%" style="border-top:1px solid #d7d7d7; border-bottom:1px solid #d7d7d7;" height="20"><tr><td
valign="center"> <a
href="http://www.mightydeals.com/deal/wpbusinessbundle.html?ref=inwidget"><font
face="Arial" size="3" color="#e64f32"><b>Never Ending WordPress Business Bundle &#8211; only $14!</b></font></a></td><td
width="90"> <a
href="http://www.mightydeals.com/?ref=inwidget"><br
/> <img
src="http://mightydeals.com/web/images/widget-logo.png" height="40" width="90" border="0"  /><br
/> </a></td></tr></table><p><br/></p> <a
href="http://www.webdesignerdepot.com/2011/05/the-secret-power-of-bookmarklets/">Source</a><style type="text/css">
 p img {display:inline-block; margin-right:10px;}
.alignleft {float:left;}
p.showcase {clear:both;}
body#browserfriendly p, body#podcast p, div#emailbody p{margin:0;}
</style>]]></content:encoded> <wfw:commentRss>http://www.webdesignerdepot.com/2011/05/the-secret-power-of-bookmarklets/feed/</wfw:commentRss> <slash:comments>6</slash:comments> </item> <item><title>Web Culture: Grid-based Layout Designs</title><link>http://www.webdesignerdepot.com/2011/03/web-culture-grid-based-layout-designs/</link> <comments>http://www.webdesignerdepot.com/2011/03/web-culture-grid-based-layout-designs/#comments</comments> <pubDate>Thu, 10 Mar 2011 11:34:46 +0000</pubDate> <dc:creator>Walter</dc:creator> <category><![CDATA[CSS]]></category> <category><![CDATA[Code]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[grid layouts]]></category><guid
isPermaLink="false">http://www.webdesignerdepot.com/?p=21925</guid> <description><![CDATA[The semantic web has brought on a new generation of Internet technology. As designers and developers work together to redefine the rules of the web, the number of open-source projects and third-party APIs continues to grow. The opinions of web scholars differ on the use of grid systems. Many argue that setting grid points limits [...]]]></description> <content:encoded><![CDATA[<p><img
class="alignleft" src="http://netdna.webdesignerdepot.com/uploads/grid_based_layout_designs/grids-sketch-thumb.jpg" alt="Web Culture - Grid Wireframing and Design Prototyping" width="200" height="160" />The semantic web has brought on a new generation of Internet  technology. As designers and developers work together to redefine the  rules of the web, the number of open-source projects and third-party  APIs continues to grow.</p><p>The opinions of web scholars differ on the use of <strong>grid systems</strong>. Many  argue that setting grid points limits the creativity of designers. Others contend that a grid provides a scientific basis for a design to  be perfected.</p><p>Both sides provide interesting arguments. These ideas have  become part of a unique web culture characterized by influential design  rules and open-source projects.</p><p>The grid isn&#8217;t a master key to perfect design. However, math has  proven that certain design specifications provide the best ratios for  page elements and layouts. If you&#8217;ve <a
href="../2009/05/the-960-grid-system-toolbox-and-resources/">heard about any of this before</a>, you may be familiar with the many options that grid-based layouts offer designers.<span
id="more-21925"></span></p><h1>A Comparison to the Classic Web</h1><p>Older generations used design as a control mechanism. Their designs  presented information precisely and in a way that was easy to manage.  This still holds true today, but these stale design principles are being  uprooted.</p><p>In their wake, a new web culture is stirring. A culture of open  standards and protocols, freely shared source code and powerful  platforms run by programmers across the world.</p><p>One reason for this development is the significant increase in the  number of people working on the semantic web. The underlying cause stems  from the human drive to contribute to something more than ourselves.</p><p>Working for a pay day is satisfying, but not something to be passionate  about. Developers who truly care about new standards want to leave their  mark.</p><p><br
class="spacer_" /></p><h1>Where Grids Have Evolved</h1><p>There hasn&#8217;t been a major study comparing pre-standards and  post-standards web design techniques. We are able to track, however, how  grids have become more popular over time.</p><p><a
href="http://www.flickr.com/photos/adactio/2888167827/"><img
src="http://netdna.webdesignerdepot.com/uploads/grid_based_layout_designs/grids-sketch.jpg" alt="" width="615" height="344" /></a></p><p>The grid system is based on current technological trends and  advancements. This includes statistics on the number of people who  access the Internet at a given time, the devices they use to access the  Internet and the screen resolutions and operating systems of their  devices. Grid systems provide a structural balance to website layouts.  They provide consistent measurements and allow for flexibility between  frameworks.</p><p>In the late 1990s, not many household machines ran a resolution  higher than 800&#215;600, and even fewer past 1024&#215;768. In the past 20 years,  intricate and complex OSes have been developed to display much higher  resolutions. 1024&#215;768 is a common setting these days.</p><p>Monitor  resolutions are growing exponentially, and this trend does not appear to  be slowing. Check out the data table from <a
href="http://www.w3schools.com/browsers/browsers_display.asp">Web Statistics and Trends</a>; it details screen-resolution measurements via W3Schools.</p><p><br
class="spacer_" /></p><h1>Visual Grid Designs</h1><p>All web pages are based on grids, whether the designer is conscious  of this or not. Digital work is comprised of pixels and as such will  conform to a set width and height, also producing artistic effects  visually with spacing and distance between points.</p><p><a
href="http://www.flickr.com/photos/mollydilworth/3904038510/"><img
src="http://netdna.webdesignerdepot.com/uploads/grid_based_layout_designs/grid-design-panels.jpg" alt="artist panels - grid-based classical design" width="615" height="307" /></a></p><p>Instead of painting in the dark, so to speak, you are able to use  grids to shine a light on the project. Grids first became popular with  the emergence of Adobe Photoshop as the <em>de facto</em> tool for web  designers. Tutorials around the web present ways to display and  implement grid lines when creating mockups, logos, graphics, icons and  other digital art.</p><p>Over time, developers picked up on this and began to implement  systems in their own work. Designing a grid layout in Photoshop is much  different than creating the same layout in HTML and CSS.</p><p>The work  required for each path is vastly different, yet the grid system itself  is universal. As open standards fall into place, current design culture  is moving toward grid-based structures.</p><p><br
class="spacer_" /></p><h1>Basic HTML and CSS Rules</h1><p>Grids use some of the most common properties of HTML web pages. HTML  grid layouts generate the same overall template each time.</p><p>The structure  starts with a containing wrapper just wide enough to contain all of the  columns. Inside the wrapper division there should be a collection of  subdivisions. The number of subdivisions should be the same as the  number of columns you need.</p><p>For a two-column layout, you may have two  divisions, classed as <code>.left</code> and <code>.right</code>. All of your internal columns should have their CSS float property set to left or right, while the wrapper should contain a <a
href="http://www.webtoolkit.info/css-clearfix.html">clearfix class</a>.</p><p>To get a feel for HTML code, you could check out a dynamic grid layout generator. The popular <a
href="http://www.pagecolumn.com/grid_layout_generator.htm">solution from Page Column</a> offers a great structure and supports multi-column layouts. All HTML  and CSS are generated instantly and pass standards-compliance testing.</p><p><br
class="spacer_" /></p><h1>Breaking Out with Padding</h1><p>Padding and gutters are integral parts of any grid system. Pieces of  content that are formatted next to each other require space between  them, which could cause the layout to expand unnaturally, resulting in  broken pages.</p><p><img
src="http://netdna.webdesignerdepot.com/uploads/grid_based_layout_designs/woothemes-960gs-gutters.jpg" alt="" width="616" height="595" /></p><p>Create definition in padded areas by crafting a layout filled with  dummy content. Place your columns on a page and give them 1-pixel  outlines using various colors. This provides an accurate representation  of what your design will look like, outlining each area&#8217;s portion of  content.</p><p>This technique works with both fixed and fluid layouts, making  the integration to current grid frameworks much easier.</p><p>Gutters also don&#8217;t need to follow a set framework. You may be willing  to sacrifice content area to increase the space between a two-column  split. Open-source frameworks are malleable and allow you to edit styles  directly or even implement your own to overwrite rules and define  properties.</p><p><br
class="spacer_" /></p><h1>Layout Grid CSS Property</h1><p>The <code>layout-grid</code> property is an older CSS specification  adopted by Microsoft. It is written in shorthand to set a multitude of  grid properties. Specifically, they reference <code>layout-grid-mode</code>, <code>layout-grid-type</code>, <code>layout-grid-line</code>, <code>layout-grid-char</code> and <code>layout-grid-char-spacing</code>.</p><p>Each of these can be defined as its own property and can be written without the overarching <code>layout-grid</code>. Here is a short list explaining each:</p><ul><li><code>layout-grid-mode</code><br
/> Controls which type or mode of layout grid is used. Possible values include <code>none</code> for no grid, <code>line</code> for inline grid elements, <code>char</code> for characters and block-line elements, and <code>both</code> for all-around support.</li><li><code>layout-grid-type</code><br
/> Controls which grid is used to render page typography and internal text elements. Value pairs are <code>loose</code>, which is used for Chinese and Korean text, <code>strict</code>, which is used for Japanese characters, and <code>fixed</code>, which uses monospacing to apply equal distance between characters, regardless of language.</li><li><code>layout-grid-line</code><br
/> Controls grid length granularity when <code>layout-grid-mode</code> is set to <code>line</code> or <code>both</code>. This property behaves similar to <code>line-height</code> and can receive numerical values set in cm, px, pt, em or percentages.</li><li><code>layout-grid-char</code><br
/> Controls the size of the character grid for an element&#8217;s text content when <code>layout-grid-mode</code> is set to <code>line</code> or <code>both</code>. The values this property accepts are the same as above and directly affect the page&#8217;s line height. The difference is that <code>layout-grid-line</code> affects the page grid, while <code>layout-grid-char</code> affects the text and character spacing grid.</li><li><code>layout-grid-char-spacing</code><br
/> Controls character spacing when <code>layout-grid-mode</code> is set to <code>char</code> or <code>both</code> and the <code>layout-grid-type</code> property is set to <code>loose</code>. This property behaves like <code>line-height</code> and should be used for block-level text areas.</li></ul><p>The purpose of creating these properties is to adapt grid layouts for  Asian-encoded pages. The characters in Asian languages often require  custom page layouts.</p><p>When viewed in other countries, these characters  could behave strangely and break your grid calculations. These unique  properties enable better visual formatting by utilizing a one- or  two-dimensional grid system.</p><p><br
class="spacer_" /></p><h1>Vertical Page Rhythm</h1><p>Many graphic artists will gloss over the importance of vertical  spacing in grid design. Gridlines support horizontal layout design and  align vertical page elements and typography. Four important properties  manipulate vertical spacing: font size, line height, top and bottom  margins and padding.</p><p>Line height is the biggest factor in vertical spacing. Page text is  scaled by how large individual letters appear and by how much space the  lines in between require. Commonly, line height is defined in pixels or  ems, depending on how flexible the layout is. Ems maintain typographic  consistency across all resolutions and browsers. The best approach is to  apply font styles to all major HTML elements, including headings, block  quotes and paragraphs.</p><p>Vertical rhythm can be retouched once a grid has been set in place,  making scaling for different environments simple. Desktop users will  have a much different experience than laptop and mobile users, who are  dealing with much smaller resolutions.</p><p>You can&#8217;t plan the vertical  alignment with exact precision, but in most cases an educated guess will  produce quality results.</p><p><br
class="spacer_" /></p><h1>The Rule of Thirds</h1><p>Divide a design into three horizontal and vertical spaces. This will  create a grid of nine rectangles nestled in newly formed pockets. It is  much easier to work with designs that are broken down into block areas  with finite points.</p><p>The science behind this trend comes from the &#8220;divine proportion,&#8221;  also known as the &#8220;divine ratio.&#8221; The ratio of 1.618, which is the  divine proportion, is a mathematical constant. When we divide any  fixed-size layout into this value we can calculate the most precise  division for a two-column structure.</p><p>Take as an example a 960-pixel layout. If we divide 960 by 1.618, we  get approximately 593. According to the golden proportion, then, we  should set our primary column length to 593 pixels. This method goes  back to artists centuries ago. Luckily, with the spread of open-source  frameworks, most of the math has already been calculated.</p><p><br
class="spacer_" /></p><h1>Building a Golden Rectangle</h1><p>This theory for creating beautiful grid-based rectangular layouts is  based on the Rule of Thirds. Split rectangles are geometrically sound  compared to the golden ratio. Numerical values for the width and height  of the rectangle are in proportion to the golden rule.</p><p>These types of rectangles are known as &#8220;golden rectangles.&#8221; The  shorter and longer side should hold the values of variables a and b,  respectively.</p><p>These rectangles are useful to build page layouts: they  measure how large block elements should be. They are extremely easy to  calculate, and the tools for many popular grid frameworks are built in.</p><p>These elements are very beneficial to web designers who use  mathematical grids. Imagine the multiple scenarios in which a carefully  structured golden rectangle would enhance a page&#8217;s aesthetics. This  could include page widgets, e-commerce product images and even  content-rich tables.</p><p><br
class="spacer_" /></p><h1>Beginning With 960gs</h1><p>With all of this information available to the public, web designers  have started to define their own standards.</p><p>Of all of the frameworks,  the <a
href="http://960.gs/">960 Grid System</a> (960gs) is probably the  best known. This isn&#8217;t to say that it is the best-no grid system fits  all criteria perfectly-but it is easy to work with. 960gs is adaptable  and works well with almost any website. And it renders well on most  browsers and devices</p><p><a
href="http://960.gs/"><img
class="alignnone size-full wp-image-21928" title="960grid" src="http://netdna.webdesignerdepot.com/uploads/2011/02/960grid.jpg" alt="" width="615" height="450" /></a></p><p>The math includes 12 columns at 60 pixels each, along with a 10-pixel  margin on each side, producing a 20-pixel gutter. Most grid frameworks  are based on 12- to 24-pixel columns. Of course, you aren&#8217;t expected to  incorporate 12 columns into your layout.</p><p>Eventually, you will combine  the columns and gutters into a single grid unit. Publishing content is  much easier when you can draft specific details for images, widgets,  videos and other page elements.</p><p>960gs has garnered so much publicity because it adapts well to the  web. Most screen resolutions can display a 960-pixel website without a  horizontal scroll bar. Increasingly, layouts are fitting into this  ratio, indicating that this is the future of the web. The extra width  doesn&#8217;t take away from the design and expanding or contracting a  template is entirely possible.</p><p><br
class="spacer_" /></p><h1>Understanding a Full 960 Layout</h1><p>Only so many columns can rationally fit into a design. A grid is not  meant to lock you in a limiting mindset. Grids are guides to follow:  they enhance user interactivity and page element placement.</p><p>The largest grid you could create is a 940-pixel content area with  20-pixel gutters. It&#8217;s a goofy use of the grid, but it is good to  understand the possibilities. Two-column layouts are pretty simple and  provide plenty of room for content. Common examples include:</p><ul
class="tight_list"><li><em><strong>780 x 140,</strong></em></li><li><em><strong>700 x 220,</strong></em></li><li><em><strong>620 x 300.</strong></em></li></ul><p>Notice that these all add up to 920. The 40-pixel loss can be  accounted for by gutters on each &#8220;block&#8221; of the layout. These spaces  keep users focused and allow the content to break apart smoothly. With  split content elements, we have gutters on the far side and between the  blocks, each accounting for 10 of the 40 pixels.</p><p>These spaces increase as you add new blocks to the layout. A  three-column design has slightly less room for content than a two-column  design.</p><p><img
class="image-border" src="http://netdna.webdesignerdepot.com/uploads/grid_based_layout_designs/grid.png" alt="" width="616" height="423" /></p><p>If this concept is still confusing, refer to the image above. The  simplest way to work with grids is to design a reference sheet similar  to the graphic above, with all possible breaks for content blocks. With  this information, mix and match styles to determine the type of design  that would best suit your project.</p><p>For example, say we want to design a mock-up using three columns and  the largest possible content area. With the chart above, we can break  down our content area into two parts: one full of content, but split in  half to contain two columns. This would require a 450-pixel content  block and two 210-pixel columns.</p><p>Again, these grids are not meant to stifle creativity. They allow for  flexibility but keep your back-end structure secure. Most designers  won&#8217;t deliberate over the science of all this. The amount of time these  open-source systems save a project is extraordinary, easily worth  skimming through the documentation and implementing your own layout.</p><p><br
class="spacer_" /></p><h1>Fluid Grid Layouts</h1><p>It&#8217;s not common to see grids pinned to fluid layouts. Pixels are the  most precise unit of measurement for a website. To move into a  measurement such as percentages or ems would require careful  consideration. Such layouts are possible with a few changes and  additional CSS selectors.</p><p><a
href="http://www.designinfluences.com/fluid960gs/">Fluid 960 Grid System</a> is well known, although most of the code isn&#8217;t accessible to older  versions of Internet Explorer. Through interactive prototyping and  working on countless screen resolutions, you can scale a 960-pixel  design across many screen resolutions. This open framework is not an  exact copy of 960gs, and it comes with new documentation. If you&#8217;re  interested, check out the <a
href="https://github.com/bauhouse/fluid960gs/tree/">GitHub repository</a> for active forum discussions and archived Q&amp;A sessions.</p><p>Like the rest of the web design community, you&#8217;re probably itching  for something more stable. A few fluid frameworks that generate amazing  layouts.</p><p><br
class="spacer_" /></p><h1>YAML Grid Layouts</h1><p>Yet Another Multicolumn Layout (YAML) is one of the most popular CSS  frameworks. It contains a large code base for manipulating flexible  XHTML and CSS layouts. It&#8217;s consistently updated by active community  developers.</p><p>The framework is extremely versatile, offering numerous <a
href="http://www.yaml.de/en/documentation/practice/application-examples.html">practical examples</a> with code. The smallest fixed-width layout will conform to 740 pixels,  fitting 800&#215;600 screen resolutions. Maximum-width resolutions are set to  80 em, offering scalability between mobile and desktop browsing.</p><p>Set  with standard web fonts, around 75% of layouts will conform to a  960-pixel maximum, although this can be overwritten.</p><p>Many of the bugs found in older browsers have been patched. YAML  supports Google Chrome, Mozilla Firefox, Safari and all versions of  Internet Explorer 5+. See the <a
href="http://www.yaml.de/en/overview.html">framework&#8217;s overview and features</a> for more in-depth information.</p><p><br
class="spacer_" /></p><h1>Yahoo! User Interface Library</h1><p>YUI is a set of JavaScript and CSS libraries put out by Yahoo. Most  of the project code and bug fixes have been written by professional  developers from the YUI community. The most current revision is YUI2,  though <a
href="http://developer.yahoo.com/yui/3/">YUI3 API docs</a> have been released to v3.1.1.</p><p>The <a
href="http://developer.yahoo.com/yui/2/">YUI2 home page</a> has links leading to the most popular projects. Toward the bottom,  listed under &#8220;YUI2 CSS Tools,&#8221; are four influential frameworks: CSS  Reset, Base, Fonts and Grids. This article is concerned with CSS Grids,  though many of these other frameworks have been referred to.</p><p><a
href="http://www.flickr.com/photos/codepo8/3971274459/"><img
src="http://netdna.webdesignerdepot.com/uploads/grid_based_layout_designs/yui-techpulse.jpg" alt="Yahoo! Talk at TechPulse 2009 - YUI2/YUI3" width="615" height="307" /></a></p><p>The download file is only 4 KB and offers over 1000 unique web page  layouts. Built-in settings allow for both fluid- and fixed-layout width  sizes. Columns are self-clearing, so whether you&#8217;re running two- or  four-way splits, the footer content will always remain underneath the  primary content. Typographic properties are tied in together for  flexible user-specific adjustments. Many core features are taken care  of, which makes working in YUI2 so nice.</p><p>The CSS Grids framework offers a small number of mobile-based  layouts. These render properly only on browsers with a relatively new  version of the Webkit engine. This includes smartphones such as Android  devices, the iPhone, BlackBerry and many Windows Mobile devices.</p><p>The  integration is nice, but this new media hasn&#8217;t been tested thoroughly  and may still display improperly on some mobile devices. But at the end  of the day it&#8217;s worth the hassle, because the majority of mobile  visitors who are willing to read the content on your website probably  own a smartphone.</p><p><br
class="spacer_" /></p><h1>The Evolution of Web Culture</h1><p>Web designers have become quite emphatic about open systems and  rules. The early web wasn&#8217;t much of a community at all. There were HTML  and CSS standards, but the mentality behind most layouts was &#8220;whatever  works.&#8221; After significant developments in web technology, the Internet  has become the best medium for publication worldwide.</p><p>Web designers and developers aim to simplify the process of creating  websites without taking away from the quality or experience of a  website. Grids are a harmonious instrument in that they give designs an  order and structure. Chaos and random creation don&#8217;t usually yield  results.</p><p>This is why grid designs are so accessible. The web has been reformed  into an agile development system. Grid-based layouts produce stable  websites: it&#8217;s no surprise the community has adopted frameworks as  common practice.</p><p>Instead of relying on older unreliable methods, the  average web designer today can focus on creating websites that are  pleasing to users, rather than coordinating pixel-perfect creations.</p><p><a
href="http://www.flickr.com/photos/urke/3223200963/"><img
src="http://netdna.webdesignerdepot.com/uploads/grid_based_layout_designs/grid-sketch-paper.jpg" alt="Sketching Web Grids on Paper" width="615" height="338" /></a></p><p>Today, designers are much younger and hold greater passion for design  than ever before. This, coupled with the open web movement, means that a  stream of new web code is constantly being released to the public. <a
href="https://github.com/search?q=grid+css&amp;type=Everything&amp;repo=&amp;start_value=1">GitHub repositories</a> offers networking opportunities with other CSS developers.</p><p><br
class="spacer_" /></p><h1>Custom Grid Framework Development</h1><p>Designers have criticized many open frameworks as being too bloated.  Many are labeled as confusing, with too many classes and rules to work  with. This may be true for some, and I certainly don&#8217;t discredit these  remarks.</p><p>Ultimately, the more flexible a design, the better. Artists look for  tools that make their job easier. Frameworks are not suitable for all  designs. Developing frameworks over smaller web projects will save time  in the long run. However, consider the CSS systems as more of a learning  tool than a production environment.</p><p>Grids can be confusing at first, no doubt about it. Having a  framework to reference and documentation to check against throughout the  process will help newbies integrate quickly and with less stress.</p><p>With  enough practice, developing a custom CSS framework will be simple. The  benefits of this far outweigh the advantages of working with someone  else&#8217;s source. You can structure all layout formats in one location and  define properties such as font size, line height and block elements.  Nobody has ever written perfect CSS code, so stick with whatever works  best for you.</p><p><br
class="spacer_" /></p><h1>Common CSS Grid Frameworks</h1><p>Below are some of the more popular CSS frameworks. Although not all  of these frameworks focus solely on grid design, they do offer useful  libraries to study and implement in web designs. The project source code  is free in each case and usually comes with documentation.</p><h2>1KB Grid</h2><p><a
href="http://www.1kbgrid.com/"><img
class="image-border" title="1" src="http://netdna.webdesignerdepot.com/uploads/2011/02/16.jpg" alt="" width="615" height="450" /></a></p><p><a
href="http://www.1kbgrid.com/">1KB Grid</a> is a great CSS  framework that mainly emphasizes speed. The download files are less than  1 KB in total and hold most of the CSS selectors you need to create a  beautiful website layout. The CSS code is customizable before  downloading, which is a huge benefit to all web designers. You can  choose between how many columns to include and how wide the columns and  gutters should appear. This grid is extremely friendly to newcomers and a  great way to break yourself in.</p><p><br
class="spacer_" /></p><h2>Baseline CSS</h2><p><a
href="http://baselinecss.com/"><img
class="image-border" title="2" src="http://netdna.webdesignerdepot.com/uploads/2011/02/24.jpg" alt="" width="615" height="450" /></a></p><p><a
href="http://baselinecss.com/">Baseline</a> is another standard  CSS template available free for download. Not only does this package  include code for grids, but it also structures page typography and block  elements. All code is compatible with CSS3 and HTML5 elements, giving  developers control over how to structure page flow. Baseline CSS offers  solutions for vertical space manipulation by integrating page typography  into a flexible grid.</p><p><br
class="spacer_" /></p><h2>1140px CSS Grid System</h2><p><a
href="http://cssgrid.net/"><img
class="alignnone size-full wp-image-21936" title="3" src="http://netdna.webdesignerdepot.com/uploads/2011/02/33.jpg" alt="" width="615" height="450" /></a></p><p><a
href="http://cssgrid.net/">CSSGrid.net</a> is home to a newer  fluid framework for grid-based websites. With 1140 pixels and a  12-column split, the structure scales properly on all devices, from the  largest monitor resolutions to handhelds. The framework uses media  queries to check when to display a certain layout and how to spread the  page content. Author <a
href="http://twitter.com/andytlr">Andy Taylor</a> frequently updates the project, and you can download the <a
href="http://download.cssgrid.net/1140_CssGrid_1.6.zip">latest 1.6 release here</a>.</p><p><br
class="spacer_" /></p><h2>YAML</h2><p><a
href="http://blog.yaml.de/"><img
class="image-border" title="4" src="http://netdna.webdesignerdepot.com/uploads/2011/02/43.jpg" alt="" width="615" height="450" /></a></p><p><a
href="http://www.yaml.de/en/">YAML</a> provides the most flexible  framework to develop layouts. The documentation offers a complete  solution for all fixed, elastic and fluid layouts. Core files have been  tested extensively on small and large websites. If you&#8217;re looking for a  stable CSS framework, YAML is a great solution.</p><p><br
class="spacer_" /></p><h2>Blueprint CSS</h2><p><a
href="http://www.blueprintcss.org/"><img
class="alignnone size-full wp-image-21938" title="5" src="http://netdna.webdesignerdepot.com/uploads/2011/02/52.jpg" alt="" width="615" height="450" /></a></p><p><a
href="http://www.blueprintcss.org/">Blueprint</a> contains many of  the benefits of Baseline. The advantage of this framework is its  well-recognized brand name. Many active developers have updated the  project with new classes. Grids comprise a large portion of the  framework, but many models are used to form typography, mobile and print  screens and more!</p><p><br
class="spacer_" /></p><h2>CSS Boilerplate</h2><p><a
href="http://code.google.com/p/css-boilerplate/"><img
class="image-border" title="6" src="http://netdna.webdesignerdepot.com/uploads/2011/02/62.jpg" alt="" width="615" height="450" /></a></p><p>The <a
href="http://code.google.com/p/css-boilerplate/">CSS Boilerplate</a> project was started by one of the developers of Blueprint. The code is a  more refined, stripped-down version of the Blueprint framework,  optimized for speed and easy readability. Although the project hasn&#8217;t  been updated recently, it provides an opportunity for beginners to rule  out their own CSS project definitions.</p><p><br
class="spacer_" /></p><h2>YUI 2: Grids CSS</h2><p><a
href="http://developer.yahoo.com/yui/grids/"><img
class="image-border" title="7" src="http://netdna.webdesignerdepot.com/uploads/2011/02/72.jpg" alt="" width="615" height="450" /></a></p><p><a
href="http://developer.yahoo.com/yui/grids/">YUI2 Grids</a> is a  very popular framework put out by Yahoo under its YUI2 line. The code is  perfect for both fixed and fluid layouts, following rules set in CSS2  and CSS3. The framework is well documented under the Yahoo User  Interface Library and is considered one of the better frameworks for  beginners.</p><p><br
class="spacer_" /></p><p><em>This post was written exclusively for Webdesigner Depot by <a
rel="nofollow" href="http://jakerocheleau.com/">Jake Rocheleau</a>,  a passionate web designer and social media enthusiast. Jake loves  reading and writing about the latest digital Internet trends and  networking within the design community. Check him out on Twitter <a
rel="nofollow" href="http://twitter.com/jakerocheleau">@jakerocheleau</a> for more about his work.</em></p><p><em><strong>Do you use a grid based framework for your designs? Share your views with us!</strong></em><em><br
/> </em></p><p><br/><br
/><table
width="100%" style="border-top:1px solid #d7d7d7; border-bottom:1px solid #d7d7d7;" height="20"><tr><td
valign="center"> <a
href="http://www.mightydeals.com/deal/wpbusinessbundle.html?ref=inwidget"><font
face="Arial" size="3" color="#e64f32"><b>Never Ending WordPress Business Bundle &#8211; only $14!</b></font></a></td><td
width="90"> <a
href="http://www.mightydeals.com/?ref=inwidget"><br
/> <img
src="http://mightydeals.com/web/images/widget-logo.png" height="40" width="90" border="0"  /><br
/> </a></td></tr></table><p><br/></p> <a
href="http://www.webdesignerdepot.com/2011/03/web-culture-grid-based-layout-designs/">Source</a><style type="text/css">
 p img {display:inline-block; margin-right:10px;}
.alignleft {float:left;}
p.showcase {clear:both;}
body#browserfriendly p, body#podcast p, div#emailbody p{margin:0;}
</style>]]></content:encoded> <wfw:commentRss>http://www.webdesignerdepot.com/2011/03/web-culture-grid-based-layout-designs/feed/</wfw:commentRss> <slash:comments>32</slash:comments> </item> <item><title>What Every Web Developer Should Know About Front-End Performance</title><link>http://www.webdesignerdepot.com/2010/11/what-every-web-developer-should-know-about-front-end-performance/</link> <comments>http://www.webdesignerdepot.com/2010/11/what-every-web-developer-should-know-about-front-end-performance/#comments</comments> <pubDate>Tue, 16 Nov 2010 10:30:40 +0000</pubDate> <dc:creator>Walter</dc:creator> <category><![CDATA[Code]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[performance]]></category> <category><![CDATA[website speed]]></category><guid
isPermaLink="false">http://www.webdesignerdepot.com/?p=20582</guid> <description><![CDATA[Too often as developers, we ignore a crucial last step before launching a website: optimizing for performance. Most developers now recognize that organized, valid code ensures maintainability and compatibility. Anyone who doubts this merely has to speak to a developer who has picked up work on an old website that is littered with unorganized, uncommented [...]]]></description> <content:encoded><![CDATA[<p><img
class="alignleft" title="thumb" src="http://netdna.webdesignerdepot.com/uploads/performance/thumbnail.png" alt="thumb" width="200" height="160" /> Too often as developers, we ignore a crucial last step before launching a website:<strong> optimizing for performance</strong>.</p><p>Most developers now recognize that organized, valid code ensures  maintainability and compatibility.</p><p>Anyone who doubts this merely has to  speak to a developer who has picked up work on an old website that is  littered with unorganized, uncommented spaghetti code.</p><p>Just as preparing our code to be read by other developers is  important, so is preparing our code to be read by browsers. Great web  development might start with great organization, but it ends with great  optimization.</p><p>This article introduces best practices of front-end performance.<span
id="more-20582"></span></p><h1>The Story of a Web Request</h1><p><img
src="http://netdna.webdesignerdepot.com/uploads/performance/timeline.png" alt="web page timeline" /></p><p>When a visitor requests a page from your website, several things happen:</p><ol></ol><ul><li>Your web server returns an HTML document;</li><li>The visitor&#8217;s browser looks for and requests linked files (CSS, JavaScript, images);</li><li>Your web server returns those linked files;</li><li>The visitor&#8217;s browser displays those files, runs them or  looks through them for more things to request (e.g. CSS background  images).</li></ul><ol></ol><p>While this process seems simple enough, a number of complications could really slow it down:</p><ul><li>Each requested file has headers that must also be sent.  Sending many small files creates unnecessary overhead, which you avoid  with a couple of big files.</li><li>Most browsers are limited in the number of files they can  download from one domain at a time. If you have 24 files to download  from the same domain, the ninth won&#8217;t begin downloading until the first  has finished.</li><li>Many browsers block <em>all</em> parallel downloads when loading external JavaScript.</li></ul><p>While all this might sound somewhat complicated, there are best  practices to follow to make it much simpler.  Both Google and Yahoo  offer fairly comprehensive guidelines on taking website optimization to  the extreme:</p><ul
class="tight_list"><li><a
href="http://code.google.com/speed/page-speed/">Google Page Speed</a>,</li><li><a
href="http://developer.yahoo.com/yslow/">Yahoo YSlow</a>.</li></ul><p>Many of their recommendations require a bit of work. Below are the five best things you can do <em>today</em> to improve your website&#8217;s performance with minimal effort.</p><p><br
class="spacer_" /></p><h1>5 Quick Changes To Improve Your Website&#8217;s Performance</h1><h3>1. Move your JavaScript to the Footer</h3><p>Moving your JavaScript files to the page footer is the  quickest and easiest thing you can do to improve performance. Many  browsers block parallel downloads when loading external JavaScript  files; by putting your files in the footer, browsers will begin loading  other things first.</p><p>Look out, though, for side effects to timing and appearance.  If you are using JavaScript to change the appearance of an element, it  won&#8217;t be executed until after a longer time lag.</p><p><br
class="spacer_" /></p><h3>2. Put the CSS First</h3><p>Loading the CSS first is just as important as putting the JavaScript at the end of the HTML document, for two reasons:</p><ol><li>CSS often contains background images that require another round of requests. Getting these started ASAP is important.</li><li>Pages render as soon as the CSS is ready.</li></ol><p>By putting the CSS at the top of the document, you ensure  that all background images begin loading immediately and that your  website renders as quickly as possible.</p><p><br
class="spacer_" /></p><h3>3. Compile and Minimize your CSS and JavaScript</h3><p>When writing code for maintainability, using several  different style sheets and JavaScript files often makes sense. When  optimizing for performance, this is almost the worst thing you can do.  With each file you add, a header needs to be sent and an additional  request needs to make its way to and from the server.</p><p>Combine all of your CSS into one file and all of your  JavaScript into another, and then minimize them both. (Don&#8217;t forget to  put the CSS at the top of the HTML document and the JavaScript in the  footer.)</p><p>Although recompiling and minifying your files after each  change might sound like a pain, the performance difference is truly  dramatic.</p><p><strong>Compilation and minimization resources:</strong></p><ul
class="tight_list"><li>Online <a
href="http://www.minifycss.com/css-compressor/">CSS Compressor and Minifier</a>,</li><li>Online <a
href="http://www.minifyjs.com/javascript-compressor/">JavaScript Compressor</a>,</li><li>WordPress <a
href="http://wordpress.org/extend/plugins/wp-minify/">WP Minify</a> plug-in,</li><li><a
href="http://code.google.com/p/minify/">PHP5 library</a>,</li><li>Google&#8217;s <a
href="http://googlewebmastercentral.blogspot.com/2010/11/make-your-websites-run-faster.html">Apache Module</a>.</li></ul><p><br
class="spacer_" /></p><h3>4. Beware Third-Party Scripts</h3><p>Many websites today contain third-party scripts and widgets  that load data from other servers. Examples are the Tweet Button, the  Facebook fan box, the Share This button and even Google Analytics. You  would think that these would all be well engineered, but many are not.  For example, the <a
href="http://www.royans.net/arch/speeding-up-3rd-party-widgets-using-iframes/">Digg widget makes nine requests</a>, is 52 KB and blocks the main page from downloading!</p><p>Use these widgets sparingly, measure their performance and  look for asynchronous alternatives. Alternatives to the most popular  widgets are available; installing them is slightly more complicated, but  they perform much better. You can usually find them with a little  digging.</p><p>Asynchronous widget resources:</p><ul
class="tight_list"><li><a
href="http://code.google.com/apis/analytics/docs/tracking/asyncTracking.html">Google Analytics</a>,</li><li><a
href="http://www.sajalkayan.com/twitter-finally-gets-something-right-tweet-button.html">Tweet Button</a>,</li><li>WordPress <a
href="http://wordpress.org/extend/plugins/asynchronous-widgets/">Asynchronous Widgets</a> plug-in,</li></ul><p><br
class="spacer_" /></p><h3>5. Measure Your Results</h3><p><a
href="http://www.gtmetrix.com/"><img
src="http://netdna.webdesignerdepot.com/uploads/performance/gtmetrix.png" alt="gtmetrix" /></a></p><p>A number of great tools out there make it easy to measure the  performance of your website. Some can be used in the browser; others are  online:</p><ul><li><a
href="http://getfirebug.com/">Firefox Firebug</a><br
/> Check out the Net tab in Firebug to see a visual timeline of how long your website takes to load and why it&#8217;s so.</li><li><a
href="http://developer.yahoo.com/yslow/">YSlow for Firebug</a><br
/> Yahoo has released a plug-in for Firebug that analyzes a website  against its YSlow recommendations and suggests ways to improve  performance.</li><li><a
href="http://code.google.com/speed/page-speed/download.html">PageSpeed for Firebug</a><br
/> This works just like YSlow but is based on Google&#8217;s PageSpeed recommendations.</li><li><a
href="http://www.gtmetrix.com/">GTMetrix</a><br
/> This tool takes a URL and delivers a full report on the website&#8217;s  performance based on YSlow and PageSpeed. It&#8217;s convenient when Firebug  isn&#8217;t available or you want to share the results via a link.</li></ul><p><br
class="spacer_" /></p><h1>Going One Step Further</h1><p>Most web developers could implement the five tips above fairly  easily. That said, a number of other things are worth doing if you want  to dig a little deeper and optimize your server&#8217;s configuration.</p><p><br
class="spacer_" /></p><h3>Add Expires Headers</h3><p>Include an expires header with every file your server sends. This  tells the browser how long the file is good for. This way, the browser  knows to save the file for the next time it is referenced, so that the  browser doesn&#8217;t need to fetch it again from the server.</p><p>Many websites  include the same CSS file on every page, but there is no reason a  visitor should have to download it for every page; the browser should  know to cache it.</p><p><br
class="spacer_" /></p><h3>Use Gzip Compression</h3><p>Today&#8217;s computers are really fast. Gzip compression takes advantage  of this by asking the server to compress every file before sending it to  the visitor.</p><p>The visitor&#8217;s browser then downloads and uncompresses it.  In the past, we had to consider server resources in deciding whether to  enable this. Today, there is essentially no downside to enabling gzip.</p><p><br
class="spacer_" /></p><h3>Consider Installing mod_pagespeed</h3><p>Google has just released an Apache module called <a
href="http://googlewebmastercentral.blogspot.com/2010/11/make-your-websites-run-faster.html">mod_pagespeed</a>.  It automatically implements almost all of the techniques in this  article.</p><p>Understanding the techniques before implementing this module is  still important, though; if you know how the website works, you&#8217;ll be  able to take advantage of mod_pagespeed&#8217;s many filters.  One such  filter, <a
href="http://code.google.com/speed/page-speed/docs/filter-css-combine.html">Combine CSS</a>, finds, combines and minifies all CSS referenced in the HTML.</p><p>The module has a number of filters and settings that could improve your website&#8217;s performance. All are worth looking at.</p><p><br
class="spacer_" /></p><h1>Conclusion</h1><p>While not the most glamorous topic, optimization deserves more  attention. Our job as developers is to learn the industry&#8217;s best  practices in order to deliver the highest-quality work to our clients  and users.</p><p><br
class="spacer_" /></p><p><em>This post was written exclusively for Webdesigner Depot by Joel  Sutherland, founder and web developer at <a
href="http://www.newmediacampaigns.com/" target="_blank">New Media Campaigns</a>. He is a  part of the team that just launched <a
href="http://www.gethifi.com/" target="_blank">HiFi</a>, a modern content management  system built for designers with their clients in mind. <a
rel="nofollow" href="http://twitter.com/JoelSutherland" target="_blank">Follow Joel on  Twitter</a> or contact him on the HiFi website.</em></p><p><em><strong>Do you know of an easy way to improve a website&#8217;s performance  that  wasn&#8217;t mentioned in this article?  Please share it and your  experience  in the comments below.</strong></em></p><p><br/><br
/><table
width="100%" style="border-top:1px solid #d7d7d7; border-bottom:1px solid #d7d7d7;" height="20"><tr><td
valign="center"> <a
href="http://www.mightydeals.com/deal/wpbusinessbundle.html?ref=inwidget"><font
face="Arial" size="3" color="#e64f32"><b>Never Ending WordPress Business Bundle &#8211; only $14!</b></font></a></td><td
width="90"> <a
href="http://www.mightydeals.com/?ref=inwidget"><br
/> <img
src="http://mightydeals.com/web/images/widget-logo.png" height="40" width="90" border="0"  /><br
/> </a></td></tr></table><p><br/></p> <a
href="http://www.webdesignerdepot.com/2010/11/what-every-web-developer-should-know-about-front-end-performance/">Source</a><style type="text/css">
 p img {display:inline-block; margin-right:10px;}
.alignleft {float:left;}
p.showcase {clear:both;}
body#browserfriendly p, body#podcast p, div#emailbody p{margin:0;}
</style>]]></content:encoded> <wfw:commentRss>http://www.webdesignerdepot.com/2010/11/what-every-web-developer-should-know-about-front-end-performance/feed/</wfw:commentRss> <slash:comments>50</slash:comments> </item> <item><title>Developing Efficient, Streamlined CSS</title><link>http://www.webdesignerdepot.com/2010/11/developing-efficient-streamlined-css/</link> <comments>http://www.webdesignerdepot.com/2010/11/developing-efficient-streamlined-css/#comments</comments> <pubDate>Tue, 09 Nov 2010 10:30:11 +0000</pubDate> <dc:creator>Walter</dc:creator> <category><![CDATA[CSS]]></category> <category><![CDATA[Code]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[clean css]]></category><guid
isPermaLink="false">http://www.webdesignerdepot.com/?p=20264</guid> <description><![CDATA[CSS can be compared to a sculptor&#8217;s tool set; like sculptors at work, we designers use CSS to create structured layouts of websites. Over the years, this process has become more organized; rules have been put in place to create best practices of coding. In this article, we&#8217;ll take a look at some ideas you [...]]]></description> <content:encoded><![CDATA[<p><img
class="alignleft" src="http://netdna.webdesignerdepot.com/uploads/streamlined_css/steam-train-thumb.jpg" alt="Streamlined CSS Styles" width="200" height="160" />CSS can be compared to a sculptor&#8217;s tool set; like sculptors at work,  we designers use CSS to create structured layouts of websites.</p><p>Over the  years, this process has become more organized; rules have been put in  place to create best practices of coding.</p><p>In this article, we&#8217;ll take a look at some ideas you can use when writing style sheets to  speed up your code.</p><p>Efficient CSS is easy to manage and easy to read and  can be a resource for web designers. Getting organized is a big step,  but using CSS can be a little more complicated than that.</p><p>As you read this article, keep your own preferences in mind; the best  advice you can get from any developer is to find your own way of  working. Combine a few of the techniques here with your own methods to  get the most benefit.<span
id="more-20264"></span></p><h1>Why Bother Streamlining CSS?</h1><p>Many designers confuse front-end and back-end languages when talking  about parsing code. CSS and HTML are front-end design languages used to  format and style elements on a website. Files are downloaded and parsed  by the visitor&#8217;s browser, which means that front-end code has a  substantial loading time.</p><p>Code downloaded and parsed by the browser  takes time to be read and computed, just like code written in back-end  languages (such as PHP or Ruby). Streamlined CSS can greatly benefit a  website because it can shorten loading times and speed up page-element  structuring.</p><p>The benefits may not be obvious with today&#8217;s high-speed connections  and advanced operating systems. You may want to look at your website on a  mobile browser to compare load times and see how the website loads.</p><p><a
href="http://www.flickr.com/photos/tobysimkin/3423874024/"><img
title="Streamline CSS Styles" src="http://netdna.webdesignerdepot.com/uploads/streamlined_css/business-boardroom.jpg" border="0" alt="Business Boardroom" /></a></p><p>When CSS is coded efficiently, you should see the form and style of  website elements as they are being processed. This can look different  from browser to browser, but it still happens. The more you test your  website&#8217;s code, the more you&#8217;ll see it.</p><p>Keep your code standardized and simple. If you&#8217;re updating your blog  or personal website a few months after initial development, churning  through CSS styles that you&#8217;re familiar with is easier than dealing with  new ones. Adapting to <a
href="../2009/05/10-best-css-practices-to-improve-your-code/">established standards</a> helps in the long run.</p><p><br
class="spacer_" /></p><h1>How to Work With Efficient Code</h1><p>To begin coding styles with utmost efficiency, you&#8217;ll have to adopt  some new ideas. These are basic CSS techniques being used today by  top-notch Internet websites and app developers.</p><h2><strong>Keep Your Code Simple</strong></h2><p>This can be easily overlooked. When mapping out a set of data for  your styles, keep it simple. Create data sets in a column stack if you  need to.</p><p><a
href="http://www.flickr.com/photos/eplewis/4179681048/"><img
title="CSS Code Books" src="http://netdna.webdesignerdepot.com/uploads/streamlined_css/css-books.jpg" border="0" alt="Cascading Stylesheets" /></a></p><p>Start by creating a list of different sections to work on in your  styles. You can include text, forms, layout boxes, headers, footers and  anything else you might need. To really get organized, you can break it  down into a few known styles, such as an <code>id</code> or <code>class</code> for navigation links.</p><p>This first step helps create a blueprint for your website using plain  words, before you get into any style language. Afterwards, sitting down  to write code will be much simpler; having the resource list in front  of you will help you pour out code at an almost superhuman rate.</p><p><br
class="spacer_" /></p><h2>Keep Blocks of Code Delineated and Sparse</h2><p>There is an ongoing debate about how CSS code should be written. When  I first started, I used block notation because it was all I had ever  seen. But single-line notation is much faster when it comes to parsing  text and making it legible.</p><p>I&#8217;m not making a case for ignoring block-style CSS-far from it. When you&#8217;re dealing with an important element or <code>id</code> that holds six or seven major properties, keeping it in blocked form  will be easier. You&#8217;ll be isolating the important parts of your style,  making them easier to find at a glance.</p><p>Reading long styles in block notation is also easier because most  text editors wrap long lines, and reading property-value pairs can get  confusing when you&#8217;ve got 10 or more to go through. Being the web  designer, you have to make the call on how to space out the CSS code.  Keep efficiency in mind, and use your best judgment.</p><p><br
class="spacer_" /></p><h1>Working with other Developers</h1><p>If you&#8217;re a professional web designer or aspire to be one, chances  are you&#8217;ll work with a team sooner or later. This can be a blessing or a  curse, depending on the team.</p><p>Designers are often reluctant to make major changes to their work.  CSS code is a bit different because you&#8217;re trying to create a beautiful  layout using only property values, and files can get messy when passed  between a few hands. So, stay organized.</p><p>Comments are a major help. If lines or blocks of code might confuse  or mislead others, comments will save hours. Explain everything you put  into the style sheet as elegantly as possible.</p><p>Make sure no duplicate or appended styles are overwritten. Imagine that the <code>h1</code> to <code>h4</code> headings are styled high up in a CSS document, but then some code lower  down changes their fonts. This could be immensely confusing for someone  who didn&#8217;t write the code and now has to go through and fix the bug.</p><p>Communication is also critical. You could write the most efficient  code around, but a lack of communication will doom your team. Focus on  the task at hand, and work with the creative ideas produced collectively  by the team (not just your own).</p><p><br
class="spacer_" /></p><h1>Keep Track of Separate CSS Documents</h1><p>Another way to keep code clean and organized is to keep style types  separate. This works well for large websites on which holding all the  styles in a single document would be unrealistic.</p><p>Facebook is a good example. It likely has many different styles for  all its various pages: profile, search, registration, photos, etc. If  the styles were all consolidated in one file, I wouldn&#8217;t want to be the  guy who has to sort through the code just to fix a simple bug.</p><p>Facebook gets a lot more traffic than your website, but the  principles are the same. If organization is a concern, separate style  sheets can go a long way. Web designers often organize code based on the  aspect of the document that it structures (e.g. <em>layout.css</em>, <em>text.css</em>, <em>forms.css</em>).</p><p><a
href="http://www.flickr.com/photos/mkosut/3631119830/"><img
title="Web design work desk" src="http://netdna.webdesignerdepot.com/uploads/streamlined_css/design-workdesk.jpg" border="0" alt="CSS Design Workdesk" /></a></p><p>Not all styles need to be loaded on every page. And here lies the  benefit: the method allows for greater customization when building your  website. You&#8217;ll cut down on parsing time tremendously just by creating  separate views and styles.</p><p><br
class="spacer_" /></p><h2>Testing Support for IE</h2><p>Web developers have always painted Internet Explorer as the villain,  especially with CSS. Luckily, you can apply conditional comments (which  look like regular comments to most browsers) to the HTML.</p><p>You can use  these to apply styles in Internet Explorer. Check out conditional  comments if you&#8217;re not familiar with them; they can prove invaluable  when CSS properties don&#8217;t work right and you need an alternative.</p><p>With the release of <a
href="http://ie.microsoft.com/testdrive/">Internet Explorer 9 Beta</a>,  we&#8217;re getting a bit closer to a unified Internet experience. The only  problem is the number of people who are still running browsers as old as  IE6 and IE7, which have serious processing bugs (due to flawed  rendering engines) and sometimes require external styles. Thankfully,  support has improved, and Microsoft seems to be turning things around.</p><p><br
class="spacer_" /></p><h1>Adding a Table of Contents</h1><p>This step is optional, but I find it works wonders for my style  sheets. You can store the table outside of the CSS document itself, but I  have found this to be somewhat counterproductive-especially because  adding comments inline is so easy.</p><p>The main reasons to put a table of contents in your styles are that  it facilitates access and streamlines the editing process. Put markers  at the beginning of your document to separate the code into logical  divisions.</p><p><a
href="http://www.flickr.com/photos/kikiduck/2364268697/"><img
title="CSS Code Cheat Sheet" src="http://netdna.webdesignerdepot.com/uploads/streamlined_css/css-cheatsheet.jpg" border="0" alt="CSS Table of Contents" /></a></p><p>Creating your own keys is a good approach. For example, if you plan  to split your table according to the main areas of the document (layout,  font, header, navigation, etc.), you could key the sections with unique  characters.</p><p>You could use <code>=!layout</code> and <code>=!font</code> to  delineate the layout and font sections, respectively. You probably won&#8217;t  run into those exact sequences of characters anywhere in the code, so  adding them to both your table and the beginning of each comments  section should be safe. Then, use the search function in your text  editor to skip down to the section you want.</p><p>This is also a good strategy for projects in which many people will  be looking at the code. It keeps everything organized and accessible.</p><p>There are many ways to optimize code and make it more efficient, and  these tips are a great start. CSS is evolving, and a lot of new ideas  about it are being built up.</p><p>You need passion and dedication to make it in the design industry. If  you can hold on to your passion for digital design, then keeping up  with CSS best practices shouldn&#8217;t be difficult. Reaching out to others  in this huge global community of web designers can be a great help;  industry experts are usually happy to share their techniques and  innovations.</p><p><br
class="spacer_" /></p><p><em>This post was written exclusively for Webdesigner Depot by <a
rel="nofollow" href="http://jakerocheleau.com/">Jake Rocheleau</a>,  a passionate web designer and social media enthusiast. Jake loves  reading and writing about the latest digital and Internet trends and  networking with the design community. To hear more about his work, find  him on Twitter @<a
rel="nofollow" href="http://twitter.com/jakerocheleau">jakerocheleau</a>.</em></p><p><em><strong>What are your methods for streamlining CSS? Any suggestions for   newbie CSS developers? What new features or additional support would  you  like to see in future iterations of CSS?</strong></em></p><p><br/><br
/><table
width="100%" style="border-top:1px solid #d7d7d7; border-bottom:1px solid #d7d7d7;" height="20"><tr><td
valign="center"> <a
href="http://www.mightydeals.com/deal/wpbusinessbundle.html?ref=inwidget"><font
face="Arial" size="3" color="#e64f32"><b>Never Ending WordPress Business Bundle &#8211; only $14!</b></font></a></td><td
width="90"> <a
href="http://www.mightydeals.com/?ref=inwidget"><br
/> <img
src="http://mightydeals.com/web/images/widget-logo.png" height="40" width="90" border="0"  /><br
/> </a></td></tr></table><p><br/></p> <a
href="http://www.webdesignerdepot.com/2010/11/developing-efficient-streamlined-css/">Source</a><style type="text/css">
 p img {display:inline-block; margin-right:10px;}
.alignleft {float:left;}
p.showcase {clear:both;}
body#browserfriendly p, body#podcast p, div#emailbody p{margin:0;}
</style>]]></content:encoded> <wfw:commentRss>http://www.webdesignerdepot.com/2010/11/developing-efficient-streamlined-css/feed/</wfw:commentRss> <slash:comments>21</slash:comments> </item> <item><title>Twenty Ten&#8217;s Front-End Code: 5 Things it Gets Right</title><link>http://www.webdesignerdepot.com/2010/11/twenty-tens-front-end-code-5-things-it-gets-right/</link> <comments>http://www.webdesignerdepot.com/2010/11/twenty-tens-front-end-code-5-things-it-gets-right/#comments</comments> <pubDate>Mon, 01 Nov 2010 10:30:50 +0000</pubDate> <dc:creator>Walter</dc:creator> <category><![CDATA[Code]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[WordPress]]></category> <category><![CDATA[front end code]]></category> <category><![CDATA[twenty ten]]></category><guid
isPermaLink="false">http://www.webdesignerdepot.com/?p=20398</guid> <description><![CDATA[By now most bloggers using WordPress should have upgraded to the latest version of WordPress which is officially at version 3.0.1. Along with updates to the core framework, when version 3.0 was released the WordPress team also added a new default theme, replacing the now obsolete Kubrick. The new theme, as most of you are [...]]]></description> <content:encoded><![CDATA[<p><a
href="http://netdna.webdesignerdepot.com/uploads/2010/10/thumb21.jpg"><img
class="alignleft size-full wp-image-20400" title="thumb2" src="http://netdna.webdesignerdepot.com/uploads/2010/10/thumb21.jpg" alt="thumb2" width="200" height="160" /></a>By now most bloggers using WordPress should have upgraded to the latest version of WordPress which is officially at <a
href="http://wordpress.org/download/">version 3.0.1</a>.</p><p>Along with updates to the core framework, when version 3.0 was  released the WordPress team also added a new default theme, replacing  the now obsolete <a
href="http://binarybonsai.com/wordpress/kubrick/">Kubrick</a>. The new theme, as most of you are probably aware, is called <a
href="http://2010dev.wordpress.com/">Twenty Ten</a>.</p><p>Not to sound too corny here, but from the first moment I laid eyes on  Twenty Ten, I fell in love with it. But I&#8217;m not talking about theme&#8217;s  visual design (which is pretty humdrum); I&#8217;m talking about the front-end  code, which has seen <strong>a number of improvements over the previous default theme</strong>.</p><p>In this article, I&#8217;ll discuss some of these improvements that I feel are worthy of examination and imitation.</p><p>And keep in mind that this is not a discussion of the features of the theme itself; this is a discussion of the <strong>structure and organization of the HTML and CSS</strong> and how it provides an excellent model to follow for front-end developers.<span
id="more-20398"></span></p><h1>It&#8217;s HTML5 Ready</h1><p>The first thing you&#8217;ll notice when you view the source of the Twenty  Ten theme is the simplified doctype, which means it&#8217;s technically  capable of using HTML5. So, while there aren&#8217;t any of the common HTML5  elements in the theme (like  and ), the HTML5 doctype is a step in the right direction.</p><p><img
class="image-border" title="New Doctype in Twenty Ten" src="http://netdna.webdesignerdepot.com/uploads/twentyten_front_end_code/tt-doctype.jpg" alt="New Doctype in Twenty Ten" width="615" height="300" /></p><p>You&#8217;ll notice in the source that there are a few other markup  simplifications: the character encoding declaration is simplified, and  the HTML element doesn&#8217;t have the &#8220;xlmns&#8221; attribute. Both of these  improvements are based on the HTML5 spec.</p><p>So, even if you&#8217;re not using any of the common HTML5 elements in your pages, you could still <strong>make your pages HTML5-ready by including the new simplified doctype</strong>, and removing some of the other soon-to-be obsolete elements, thus following the example of the developers of Twenty Ten.</p><p><br
class="spacer_" /></p><h1>Proper Use of the h1 Tag</h1><p>This is an improvement that&#8217;s easier to examine when looking at the  actual PHP files that create the markup, and constitutes a definite  improvement over Kubrick for best-practices <strong>SEO, semantics, and accessibility</strong>.</p><p>In Kubrick, on every page the top-level heading (<code>&lt;h1&gt;</code>) is the website title. This is fine for the home page, but not secondary pages. Thus, a single article page in Kubrick has the article&#8217;s title marked up with the <code>&lt;h2&gt;</code> element. According to Roger Johansson of 456 Berea Street <a
href="http://www.456bereastreet.com/archive/200911/headings_and_document_structure_conclusions/">this is not best practice</a>.</p><p>Take a look at the screen grab below displaying how the new Twenty Ten theme handles this problem:</p><p><img
title="Twenty Ten's Improvement in Heading Structure" src="http://netdna.webdesignerdepot.com/uploads/twentyten_front_end_code/tt-headings.jpg" alt="Twenty Ten's Improvement in Heading Structure" width="615" height="228" /></p><p>The PHP code in header.php changes the markup depending on which page is being viewed. If the home page is being viewed, the element that surrounds the page title becomes the <code>&lt;h1&gt;</code> element. On any other page, the title is wrapped in a <code>&lt;div&gt;</code>. In the latter case, this allows the <code>&lt;div&gt;</code> element to be more meaningful on secondary pages, contributing to SEO and overall accessibility.</p><p><br
class="spacer_" /></p><h1>Eric Meyer&#8217;s CSS Reset Included</h1><p>Recognizing the usefulness of a CSS reset, the Twenty Ten theme developers have also included a variation of <a
href="http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/">Eric Meyer&#8217;s CSS Reset</a> at the top of the theme&#8217;s CSS file, crediting Meyer in a comment:</p><p><img
title="Twenty Ten Includes Eric Meyer's CSS Reset" src="http://netdna.webdesignerdepot.com/uploads/twentyten_front_end_code/tt-reset.jpg" alt="Twenty Ten Includes Eric Meyer's CSS Reset" width="615" height="300" /></p><p>A reset can go a long way towards <strong>achieving cross-browser compatible CSS layouts</strong>.  So the inclusion of the reset is no surprise here and is another technique employed by the Twenty Ten developers that&#8217;s worthy of imitation.</p><p><br
class="spacer_" /></p><h1>Closing Tags are Commented to Indicate IDs and Classes</h1><p>At one of my previous jobs, I was working on a lot of inherited code, and some of the previous developers suffered from <a
href="http://www.tyssendesign.com.au/articles/faqs/what-is-divitis/">divitis</a>,  making it difficult to rearrange or target elements in the markup. So, in new projects, I started adding comments at the end of <code>&lt;div&gt;</code> elements, to ensure that during future maintenance anyone could easily see which element ended where. This was especially important for deep-nested sets of <code>&lt;div&gt;</code> tags.</p><p>The Twenty Ten developers have <strong>recognized the value of comments</strong> to identify the names of <code>&lt;div&gt;</code> elements, so they&#8217;ve done something similar, except they&#8217;ve taken it a step further:</p><p><img
title="Twenty Ten's Helpful HTML Comments" src="http://netdna.webdesignerdepot.com/uploads/twentyten_front_end_code/tt-comments.jpg" alt="Twenty Ten's Helpful HTML Comments" width="615" height="400" /></p><p>Their comments not only include the ID or class name of the element  they identify, but also indicate whether or not the name is a class or  ID. The first comment in the screenshot above is for an element that has  an ID of &#8220;primary&#8221; (indicated by &#8220;#primary&#8221;) and a class name of  &#8220;widget-area&#8221; (indicated by &#8220;.widget-area&#8221;).</p><p>So, while my own convention is to just name the element regardless of  class or ID, they&#8217;ve included a single character (the hash or period)  to identify the attribute on which the name is based. This is a good  practice to follow, and is just a simple way <strong>to enhance the clarity and maintainability of your markup</strong>.</p><p><br
class="spacer_" /></p><h1>CSS is Commented More Clearly</h1><p>Finally, staying on the topic of commenting, I noticed a clear  improvement in the way CSS is commented and organized in Twenty Ten, as  compared to Kubrick. This is no doubt something that many front-end  developers have tried to do for a number years, and it&#8217;s good to see the  Twenty Ten developers following suit. Below is a screenshot showing the <strong>distinct comments</strong> in Twenty Ten&#8217;s CSS file, making them very easy to find when scanning through the styles:</p><p><img
title="Twenty Ten's Distinct CSS Comments" src="http://netdna.webdesignerdepot.com/uploads/twentyten_front_end_code/tt-csscomments.jpg" alt="Twenty Ten's Distinct CSS Comments" width="615" height="381" /></p><p>By contrast, in Kubrick the comments were not as easy to spot when scanning the file:</p><p><img
title="Kubrick's Less Distinct CSS Comments" src="http://netdna.webdesignerdepot.com/uploads/twentyten_front_end_code/tt-csskubrick.jpg" alt="Kubrick's Less Distinct CSS Comments" width="615" height="300" /></p><p><br
class="spacer_" /></p><h1>Conclusion</h1><p>It&#8217;s understood that one of the best ways to become a better coder is to <a
href="http://sixrevisions.com/web-development/5-good-habits-that-will-make-you-a-better-coder/">study the work of others</a>. And that advice certainly applies to front-end code that is easily accessible on pretty much every website.</p><p>The five things I&#8217;ve discussed in this article are not necessarily  anything new in front-end development, but I think seeing these  practices implemented on a single project is unique, and so the Twenty  Ten developers (who are evidently <a
href="http://en.blog.wordpress.com/2010/04/26/new-theme-twenty-ten/">Matt Thomas and company</a>) have done a great job in this regard, providing some excellent techniques and examples worthy of imitation.</p><p><br
class="spacer_" /></p><p><em>This post was written exclusively for Webdesigner Depot by Louis Lazaris, a freelance writer and web developer. Louis runs <a
rel="nofollow" href="http://www.impressivewebs.com/">Impressive Webs</a> where he posts articles and tutorials on web design. You can <a
rel="nofollow" href="http://twitter.com/ImpressiveWebs">follow Louis on Twitter</a> or get in touch with him through his website.</em></p><p><strong><em>Have you noticed anything else about the new default  WordPress theme&#8217;s code that&#8217;s worthy of discussion? Please share your  comments below.</em></strong></p><p><br/><br
/><table
width="100%" style="border-top:1px solid #d7d7d7; border-bottom:1px solid #d7d7d7;" height="20"><tr><td
valign="center"> <a
href="http://www.mightydeals.com/deal/wpbusinessbundle.html?ref=inwidget"><font
face="Arial" size="3" color="#e64f32"><b>Never Ending WordPress Business Bundle &#8211; only $14!</b></font></a></td><td
width="90"> <a
href="http://www.mightydeals.com/?ref=inwidget"><br
/> <img
src="http://mightydeals.com/web/images/widget-logo.png" height="40" width="90" border="0"  /><br
/> </a></td></tr></table><p><br/></p> <a
href="http://www.webdesignerdepot.com/2010/11/twenty-tens-front-end-code-5-things-it-gets-right/">Source</a><style type="text/css">
 p img {display:inline-block; margin-right:10px;}
.alignleft {float:left;}
p.showcase {clear:both;}
body#browserfriendly p, body#podcast p, div#emailbody p{margin:0;}
</style>]]></content:encoded> <wfw:commentRss>http://www.webdesignerdepot.com/2010/11/twenty-tens-front-end-code-5-things-it-gets-right/feed/</wfw:commentRss> <slash:comments>20</slash:comments> </item> <item><title>A Case for Coding Your Wireframes</title><link>http://www.webdesignerdepot.com/2010/09/a-case-for-coding-your-wireframes/</link> <comments>http://www.webdesignerdepot.com/2010/09/a-case-for-coding-your-wireframes/#comments</comments> <pubDate>Thu, 30 Sep 2010 10:30:23 +0000</pubDate> <dc:creator>Walter</dc:creator> <category><![CDATA[Code]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[coding wireframes]]></category> <category><![CDATA[prototyping]]></category> <category><![CDATA[wireframes]]></category><guid
isPermaLink="false">http://www.webdesignerdepot.com/?p=19955</guid> <description><![CDATA[Working as a designer day after day can be laborious. Luckily, the field has expanded, and so the process has become simpler. Many free tools and resources are out there. Wireframes bring elegance to design mock-ups. They are the basic structure of a website, with colors and enhancements removed. They are used to view design [...]]]></description> <content:encoded><![CDATA[<p><img
class="alignleft" src="http://netdna.webdesignerdepot.com/uploads/coding_your_wireframes/wireframe-prototype-thumb.jpg" alt="Sketching Code Prototypes for Design Wireframes" width="200" height="160" />Working as a designer day after day can be laborious. Luckily, the  field has expanded, and so the process has become simpler. Many free  tools and resources are out there.</p><p>Wireframes bring elegance to design mock-ups. They are the basic  structure of a website, with colors and enhancements removed.</p><p>They are  used to view design concepts with just the bare essentials, and they can  provide a useful perspective on any project.</p><p>Most wireframes are created in software suites such as Adobe  Photoshop and Fireworks, but some websites enable you to create  wireframe images right in the browser.</p><p>In this post, we&#8217;ll go over coding a basic  wireframe image in HTML and CSS and see how it can benefit the creative  process.<span
id="more-19955"></span></p><h1>Why Bother?</h1><p>Why spend time sketching a website&#8217;s structure? In some cases, it  might be unnecessary, but it can help when you&#8217;re stuck in a rut or  struggling to see the big picture.</p><p>It can benefit both designers and clients. In paid work, you&#8217;re  responsible for pleasing the client. Showing the basic structure of  their soon-to-be-designed website can give clients relief and a sense of  control over the whole process.</p><p>But if the design is very basic or has a  simple structure, then creating a wireframe might not be worth it;  mocking up the entire thing in Photoshop, with buttons and color, might  be just as quick.</p><p>Deciding what steps to take does require time and critical thinking.  After all, a wireframe is merely a tool. It is underrated by many web  designers but surprisingly useful once understood.</p><p><br
class="spacer_" /></p><h1>Prototyping Wireframes in Code</h1><p>For years, Adobe design software has been the premier suite for  wireframe creation, but the web has undergone substantial change and is  still evolving.</p><p><a
href="http://www.flickr.com/photos/s4xton/2425718415/"><img
title="Wireframe Prototype Code" src="http://netdna.webdesignerdepot.com/uploads/coding_your_wireframes/document-code.jpg" border="0" alt="CSS Wireframe Code" /></a></p><p>The rise of coding standards and increase in <a
href="http://www.w3.org/TR/html5/">HTML5 documentation</a> are big steps towards a common web. Now, coding a basic wireframe in  HTML and CSS is no more work than tackling the job in Fireworks.</p><p>With wireframes, you can attack a project head-on from multiple  angles. You can even test for compatibility with CSS2 and CSS3  techniques and browsers. Things don&#8217;t need to be complex at the  beginning; a wireframe simply serves as a solid foundation to begin  coding.</p><p>Sharing content also becomes easier with a wireframe. You can host  all the files you need on any web server, and you can set up a demo  directory and forward live updates to clients and overseers of your  project. Making changes, such as quick tweaks to margins and widths in  the document&#8217;s CSS, is simple, too.</p><p><br
class="spacer_" /></p><h1>Standardize Code for the Long Haul</h1><p>Wireframes save time in the development process. If the CSS styles  for your basic elements are already written, then the rest is just  filler (important filler, mind you).</p><p><a
href="http://www.flickr.com/photos/thejudders/3497086953/"><img
src="http://netdna.webdesignerdepot.com/uploads/coding_your_wireframes/web-standards.jpg" border="0" alt="Coding with Web Standards" /></a></p><p>Start out properly, with the correct HTML document type and directory  structure. Document types aren&#8217;t too different from one another. You  can read about them on the <a
href="http://www.w3.org/TR/REC-html40/sgml/dtd.html">W3C Specs page</a>. They don&#8217;t matter much in the old World Wide Web model, but HTML5 is thorough and allows your website to grow.</p><p>You have to test compatibility on as many operating systems and  browsers as possible anyway, and the wireframe prototyping stage is the  perfect time to do this, because you&#8217;re already focused on arranging the  layout.</p><p>This is also a good time to work on a mobile-friendly template. As  the structure changes, you should be able to incorporate ideas and  manipulate the document&#8217;s code. Development becomes easier because there  is less code to clutter up your mobile and custom styles.</p><p><br
class="spacer_" /></p><h1>Beginning the Structure of the Document Wireframe</h1><p>The best way to start is with a blank slate, because it affords you  the most creativity. The obvious elements to include in the code (as in  any other web document) are <code>html</code>, <code>head</code> and <code>body</code>.</p><p>This is the skeleton. You&#8217;ll need a few more elements for the wireframe to look good. The <code>div</code> (or division) is notable. This is the element used to box certain areas of the page, such as the logo or search box.</p><p><code>Divs</code> are the building blocks of HTML5 wireframe prototypes. Anything and everything can be enveloped in a <code>div</code>, and styling is a breeze when you apply classes and IDs to elements. Much of your main code will be split up by <code>divs</code> because they are the basic block elements.</p><p>With the new HTML5 specs, an element called <code>nav</code> has been  introduced. This can be combined with an unordered list and some CSS  properties to create and define your website&#8217;s main navigation area.  Below is a simple example of how you could structure your <code>nav</code>:</p><p><code>&lt;div id="header"&gt;<br
/> &lt;nav&gt;<br
/> &lt;ul&gt;<br
/> &lt;li&gt;&lt;a href="#"&gt;Home&lt;/a&gt;&lt;/li&gt;<br
/> &lt;li&gt;&lt;a href="#"&gt;About&lt;/a&gt;&lt;/li&gt;<br
/> &lt;li&gt;&lt;a href="#"&gt;Item 3&lt;/a&gt;&lt;/li&gt;<br
/> &lt;li&gt;&lt;a href="#"&gt;Contact&lt;/a&gt;&lt;/li&gt;<br
/> &lt;/ul&gt;<br
/> &lt;/nav&gt;<br
/> &lt;/div&gt; </code></p><p><br
class="spacer_" /></p><p><strong>Working With <code>header</code> and <code>footer</code> Elements</strong></p><p>You&#8217;ll notice in the example above that I used a <code>div</code> with an ID of <code>header</code> to separate my heading navigation. This is perfectly acceptable and  nothing is wrong with the above code. HTML5 gives us other options,  though.</p><p>The <code>header</code> element in the new HTML5 specs allows you to  further define your structure, which is useful mostly for web page  crawlers and screen readers, which separate a &#8220;heading&#8221; portion of the  content. It shouldn&#8217;t make any difference to your users, and it keeps  your code shipshape and show that you really understand what you&#8217;re  talking about.</p><p>Another interesting element that&#8217;s been added is <code>footer</code>. Same idea: use this element in place of a <code>div</code> to separate your footer content. Generally, footers are out of the way  and contain basic information about the website or company.</p><p>You could add links to the footer and use a <code>nav</code> element to define some of them, but that would be ill-advised. The <code>nav</code> element specifies the main navigation area, so adding it to the footer or anywhere else would be redundant.</p><p>In this scenario, using the <code>footer</code> element and  separating the navigation links as an unordered list is best. You could  use a columned footer, with a number of columns of links. These could be  separate <code>div</code> elements displayed next to each other, all wrapped in the main footer.</p><p><a
href="http://www.flickr.com/photos/anyaka/93001382/"><img
title="CSS Design &amp; Style Techniques" src="http://netdna.webdesignerdepot.com/uploads/coding_your_wireframes/css-style-design.jpg" border="0" alt="CSS Coloring Crayons Styles" /></a></p><p><br
class="spacer_" /></p><h1>CSS Techniques for Styling Wireframes</h1><p>If you understand HTML and have worked with the web for a while, then  you probably know some basic CSS. Many of the new features of CSS3 are  for adding fancy rounded corners and drop-shadows to text.</p><p>I don&#8217;t mean to suggest that CSS styling is not important, but the  core layout and positioning is what ultimately makes your website&#8217;s  structure. With CSS, you define width, margin and spacing. These are the  basic properties of most web elements, and they&#8217;re the last step in  creating a truly outstanding wireframe.</p><p>If you&#8217;re intrigued by CSS3&#8242;s new properties and selectors, then check out Webdesigner Depot&#8217;s <a
href="../2009/08/5-css3-design-enhancements-that-you-can-use-today/">collection of enhancements</a>. It contains guides all over the web about the new features in CSS3.</p><p><br
class="spacer_" /></p><p><strong>Adding <code>clearfix</code> to Styles</strong></p><p>If you are unfamiliar with the clearfix technique, do <a
href="http://www.webtoolkit.info/css-clearfix.html">some research</a>. It&#8217;s a popular class that you would add to a <code>div</code> container that holds two or more floating blocks.</p><p>If you&#8217;ve never heard of clearfix, it might seem confusing, but the concept is simple. Think of a container <code>div</code> that has two <code>div</code>s  inside it, both floated left. By default, most browsers would render  the two columns as directly touching each other, and the containing <code>div</code> would expand down the page to fit whichever column is longest.</p><p>By adding a <code>clearfix</code> class to your container, both columns will fit happily inside the container <code>div</code>,  which expands down far enough to fit both elements. This solves many  problems in wireframe prototyping, particularly with two-column layouts  (i.e. the main content and the sidebar). This method will also work for  three- and even four-column layouts, each column would just need to fit  in a smaller space.</p><p><br
class="spacer_" /></p><p><strong>Displaying CSS: Keeping Styles External</strong></p><p>What to do with CSS placement is another important decision.  Professional web designers and developers simply suggest keeping an  independent <code>.css</code> file, separate from your HTML code.</p><p>This way, the structure is in one document and the layout and design is  in another. Both are equally important to wireframes, but they perform  distinct tasks.</p><p>All of your HTML code is strictly structural. You can put links inside paragraphs inside container <code>div</code>s  inside other containers, and so forth. Styling controls the size,  spacing, margins and lettering of paragraphs and links, and the  wireframe defines the width of containers and their placement on the  page.</p><p>Page elements provide further examples. You would code the <code>div</code> containers for content and sidebars, but you would style and position  them using CSS. For a designer, understanding how to separate content  and style is key to mastering wireframes.</p><p><br
class="spacer_" /></p><h1>Implement Dynamic Page-Element Placeholders</h1><p>Fancy jQuery effects and Ajax-ified web elements seem to be all the  rage. Trends grow, and nearly all popular websites feature some dynamic  content. It&#8217;s important to consider. If they complement the design, why  not feature blocks in your wireframe?</p><p>Developing an entire back-end system for a dynamic log-in box might  not be practical, but noting the JavaScript libraries you will need is a  great start. You could also code styles that structure this box and set  things in place for later, when you would add color and detail.</p><p><a
href="http://www.flickr.com/photos/bendodson/3394810309/"><img
src="http://netdna.webdesignerdepot.com/uploads/coding_your_wireframes/designing-for-social-web.jpg" border="0" alt="Designing for the Social Web" /></a></p><p>These themes can be applied across many interface elements. You could  use search suggestions similar to Google&#8217;s or leave notes in your code  to implement a dynamic news or Twitter-feed box, either of which would  make your wireframe dynamic and provide an elegant way to represent a  solid-state object in place of dynamic content. During the prototyping  phase, this is all you need anyway.</p><p><br
class="spacer_" /></p><h1>Common Wireframe Development Mistakes</h1><p>It&#8217;s difficult to go wrong when you&#8217;re just starting to code the basic structure of a website, but keep certain details in mind.</p><p>Remember that a wireframe&#8217;s purpose is to present a framework without  much detail. It&#8217;s useful during the initial stages of planning the page  elements; you can delve deep into your website and see the big picture.</p><p>Keep things simple and in order. Overlooking this is a common mistake  and it will cripple your ability to meet deadlines. A wireframe doesn&#8217;t  need to be anywhere near perfect; it&#8217;s supposed to be a rough outline  of the website. Even a strictly HTML and CSS wireframe should consist  only of page element outlines.</p><p>Avoid detours by focusing on your main goals. Remember why you started the process with a wireframe in the first place!</p><p>Wireframes can also solve many problems that beset the design  process. Coding a prototype in HTML and CSS is the best way to get a  head start on a web project, large or small. It&#8217;s a simple, efficient  way to give shape to your ideas.</p><p>A <a
href="../2009/07/using-wireframes-to-streamline-your-development-process/">ton of articles</a> on the web relate to the wireframing process. I&#8217;ve covered the coding  and development side of things, but to learn more about wireframing,  keep reading. The design tips are out there; you just have to find them!</p><p><br
class="spacer_" /></p><p><em>This post was written exclusively for Webdesigner Depot by <a
rel="nofollow" href="http://jakerocheleau.com/">Jake Rocheleau</a>,  a passionate web designer and social media enthusiast. Jake loves  reading and writing about the latest digital Internet trends and  networking in the design community. Check him out on Twitter <a
rel="nofollow" href="http://twitter.com/jakerocheleau">@jakerocheleau</a> for more about his work.</em></p><p><em><strong>What are your experiences with the wireframe process? Do you work in   code first or in some other type of software? What do you think are  some  benefits to prototyping in code first?</strong></em></p><p><br/><br
/><table
width="100%" style="border-top:1px solid #d7d7d7; border-bottom:1px solid #d7d7d7;" height="20"><tr><td
valign="center"> <a
href="http://www.mightydeals.com/deal/wpbusinessbundle.html?ref=inwidget"><font
face="Arial" size="3" color="#e64f32"><b>Never Ending WordPress Business Bundle &#8211; only $14!</b></font></a></td><td
width="90"> <a
href="http://www.mightydeals.com/?ref=inwidget"><br
/> <img
src="http://mightydeals.com/web/images/widget-logo.png" height="40" width="90" border="0"  /><br
/> </a></td></tr></table><p><br/></p> <a
href="http://www.webdesignerdepot.com/2010/09/a-case-for-coding-your-wireframes/">Source</a><style type="text/css">
 p img {display:inline-block; margin-right:10px;}
.alignleft {float:left;}
p.showcase {clear:both;}
body#browserfriendly p, body#podcast p, div#emailbody p{margin:0;}
</style>]]></content:encoded> <wfw:commentRss>http://www.webdesignerdepot.com/2010/09/a-case-for-coding-your-wireframes/feed/</wfw:commentRss> <slash:comments>21</slash:comments> </item> <item><title>Fight Div-itis and Class-itis With the 960 Grid System</title><link>http://www.webdesignerdepot.com/2010/03/fight-div-itis-and-class-itis-with-the-960-grid-system/</link> <comments>http://www.webdesignerdepot.com/2010/03/fight-div-itis-and-class-itis-with-the-960-grid-system/#comments</comments> <pubDate>Wed, 31 Mar 2010 17:05:59 +0000</pubDate> <dc:creator>Walter</dc:creator> <category><![CDATA[CSS]]></category> <category><![CDATA[Code]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[960 grid system]]></category> <category><![CDATA[960gs]]></category> <category><![CDATA[HTML]]></category><guid
isPermaLink="false">http://www.webdesignerdepot.com/?p=16089</guid> <description><![CDATA[Years ago, HTML tables were the standard for laying out web pages. CSS and semantic thinking changed that, and today CSS frameworks make designing relatively easy. But they can also generate a surprising number of superfluous elements. The 960 Grid System encourages the addition of &#60;div&#62; elements and class attributes, especially on complicated pages. Is [...]]]></description> <content:encoded><![CDATA[<p><a
href="http://www.webdesignerdepot.com/2010/03/fight-div-itis-and-class-itis-with-the-960-grid-system"><img
class="alignleft" src="http://netdna.webdesignerdepot.com/uploads/divitis/divitis-teaser.gif" alt="" width="200" height="160" /></a>Years ago, HTML tables were the standard for laying out web pages. CSS and semantic thinking changed that, and today CSS frameworks make designing relatively easy.</p><p>But they can also generate a surprising number of superfluous elements.</p><p>The 960 Grid System encourages the addition of <code>&lt;div&gt;</code> elements and <code>class</code> attributes, especially on complicated pages. Is this really an improvement over nested tables?</p><p>Creating cleaner code means going beyond the framework and thinking about what it really represents.</p><p><span
id="more-16089"></span></p><p>CSS frameworks provide a workflow solution, namely a rapid deployment of grid-based web layouts. One of the most popular frameworks today is the 960 Grid System (<a
href="http://960.gs/">960.gs</a>), named after its default width. With practice, 960.gs can be a great tool for any web designer. But it also revisits a few old problems.</p><p>Before CSS saw widespread use, tables provided all the layout a web designer needed. More complicated designs had tables nested within tables, but used in excess these created a tangled mess of HTML. CSS-based layouts lured designers with the promise of less HTML; they also appealed to semantics enthusiasts. Simply put, CSS encouraged the use of HTML that described what content was about, not what it should look like.</p><p>As designers learned to use CSS, div elements replaced tables. But divs can be—and often are—nested, just like tables.</p><p><br
class="spacer_" /></p><h1>The Spread of Class-itis and Div-itis</h1><p>Clear, lean code offers many advantages. It’s easy to fix, quick to download and causes fewer problems across different types of browsers. Relevant tags help screen readers, search engines and mobile devices interpret meaning in addition to layout.</p><p>Other than the semantics, the great advantage of using <code>&lt;div&gt;…&lt;/div&gt;</code> over <code>&lt;table&gt;&lt;tr&gt;&lt;td&gt;…&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</code> is that we end up with less code to do the same job. But now designers face a glut of classes and divs.</p><p>Do CSS frameworks such as 960.gs recreate the underlying problem with tables? If their goal is efficient HTML, can designers and developers use 960.gs without spreading “class-itis” (i.e. excessive use of classes) and “div-itis” (i.e. so many divs that tables start looking good again)? Yes, they can.</p><p>To understand how, we need to look at the framework itself.</p><p><br
class="spacer_" /></p><h1>A Rundown of 960.gs</h1><p>960.gs provides a set of columns, written in CSS, that facilitate the laying out of web pages. Download the files, add them to your website and it’s ready to go. No special plug-ins or new technology are needed, and you can use it in conjunction with other CSS files.</p><p>Columns are contained within blocks called (naturally) “containers.” The defaults are <code>container_12</code> and <code>container_16</code>, which divide into 12 and 16 columns, respectively. Custom sizes are available.</p><p><img
src="http://netdna.webdesignerdepot.com/uploads/divitis/containers-sample.gif" alt="diagram of 960-pixel-wide containers" /></p><p>The diagram above shows the two default containers with 12 and 16 columns. The gray won’t be visible on your final website, of course. The columns merely show where blocks, called “grids,” can be arranged.</p><p>A grid is a block of content that can cross more than one column in a container. Grids float left by virtue of being held in <code>.container_x</code>, making them ideal for modular layouts. The width of each block is determined by which grid you apply to it: <code>grid_1</code> is one column wide, <code>grid_5</code> is five columns wide, etc.</p><p><img
src="http://netdna.webdesignerdepot.com/uploads/divitis/grids-sample-1.gif" alt="diagram of various grids within a container" /></p><p>Above, <code>.container_12</code> holds three grids. Each grid, in turn, would hold different elements of the page’s content.</p><p><img
src="http://netdna.webdesignerdepot.com/uploads/divitis/grids-sample-2.gif" alt="diagram of various grids within a container" /></p><p>Above, <code>.container_16</code> holds two blocks of 12 and 4 columns, respectively. Like <code>.container_12</code>, this 16-column-wide layout measures 960 pixels wide—but its columns are narrower.</p><p>Resizing the grids in which the content’s elements fit is simple: change the <code>grid_<em>x</em></code> in each div.</p><p><a
href="http://960.gs">The official 960.gs website</a> showcases websites that were built on the framework, and it also provides page templates, links to a custom grid generator and the framework itself. Detailed instructions are included, too, because there’s more to learn. Grid margins and the ability to step into gutters between grids make the system even more flexible.</p><p>In spite of these benefits, embedding <code>&lt;div class="grid_x"&gt;…&lt;/div&gt;</code> in <code>&lt;div class="container_x"&gt;…&lt;/div&gt;</code> encourages coders to use many class attributes (class-itis) and divs (div-itis).</p><p><br
class="spacer_" /></p><h1>Solutions</h1><p>Arguing against tables for layout is easy enough. But using three or more levels of nested divs doesn’t solve the problem—it just replaces one set of tags with another. Frameworks help but don’t always solve the dilemma. With a little forethought, many of these problems can be avoided.</p><h2>Only Use Classes That You Actually Need</h2><p>The simplest solution to excessive CSS code is to cut out what isn’t necessary. 960.gs was conceived as a wireframing tool, meant to be replaced when the website goes live. It includes more than 180 class definitions.</p><p>If your design is structured on, say, <code>.container_12</code> and never uses more than <code>.grid_5</code> and <code>.grid_7</code>, then remove the others from the CSS.</p><h2>Apply class=&#8221;grid_x&#8221; to Appropriate Elements: Headings, Images, Links, Paragraphs</h2><p>The <code>.container_x</code> and <code>.grid_x</code> classes aren’t restricted to div elements. The <a
href="http://www.w3schools.com/tags/att_standard_class.asp">class attribute</a> can be applied to any element except <code>html</code>, <code>head</code>, <code>meta</code>, <code>param</code>, <code>script</code>, <code>title</code> and <code>style</code>—so, practically anything in the <code>body</code>. If a pair of div tags enclose only one item, then they may be unnecessary.</p><h2>Applying Grid Code to Non-Divs</h2><table
style="border-collapse: collapse" border="1" cellspacing="0" cellpadding="6" width="615" bordercolor="#999999"><tbody><tr><th
style="font-size: 12px;"> Using divs</th><th
style="font-size: 12px;"> Using semantic code</th></tr><tr><td><code>&lt;div class="grid_12"&gt;<br
/> &lt;h1&gt;…&lt;/h1&gt;<br
/> &lt;/div&gt;<br
/> </code></td><td><code>&lt;h1 class="grid_12"&gt;…&lt;/h1&gt;</code></td></tr><tr><td><code>&lt;div class="grid_3"&gt;<br
/> &lt;img src="…" alt="photo" /&gt;<br
/> &lt;/div&gt;<br
/> </code></td><td><code>&lt;img src="…" alt="photo" class="grid_3" /&gt;</code></td></tr><tr><td><code>&lt;div class="grid_6"&gt;<br
/> &lt;ul&gt;<br
/> &lt;li&gt;…&lt;/li&gt;<br
/> &lt;li&gt;…&lt;/li&gt;<br
/> &lt;li&gt;…&lt;/li&gt;<br
/> &lt;li&gt;…&lt;/li&gt;<br
/> &lt;/ul&gt;<br
/> &lt;/div&gt;<br
/> </code></td><td><code>&lt;ul class="grid_6"&gt;<br
/> &lt;li&gt;…&lt;/li&gt;<br
/> &lt;li&gt;…&lt;/li&gt;<br
/> &lt;li&gt;…&lt;/li&gt;<br
/> &lt;li&gt;…&lt;/li&gt;<br
/> &lt;/ul&gt;<br
/> </code></td></tr><tr><td><code>&lt;table&gt;<br
/> &lt;tr&gt;<br
/> &lt;td&gt;&lt;a href="#"&gt;…&lt;/a&gt;&lt;/td&gt;<br
/> &lt;td&gt;&lt;a href="#"&gt;…&lt;/a&gt;&lt;/td&gt;<br
/> &lt;td&gt;&lt;a href="#"&gt;…&lt;/a&gt;&lt;/td&gt;<br
/> &lt;td&gt;&lt;a href="#"&gt;…&lt;/a&gt;&lt;/td&gt;<br
/> &lt;/tr&gt;<br
/> &lt;/table&gt;<br
/> </code></td><td><code>&lt;a href="#" class="grid_3"&gt;…&lt;/a&gt;<br
/> &lt;a href="#" class="grid_3"&gt;…&lt;/a&gt;<br
/> &lt;a href="#" class="grid_3"&gt;…&lt;/a&gt;<br
/> &lt;a href="#" class="grid_3"&gt;…&lt;/a&gt;<br
/> </code></td></tr></tbody></table><p><br
class="spacer_" /></p><h2>Grant Grid Properties to Certain Elements</h2><p>Being simple CSS, <code>.grid_x</code> has properties that would work with any other class name—or any element. By copying the properties to certain elements, extra classes become unnecessary.</p><p><code>.examples li { (properties of .grid_4) }</code></p><pre><code>&lt;ul class="examples"&gt;
  &lt;li&gt;…&lt;/li&gt;
  &lt;li&gt;…&lt;/li&gt;
  &lt;li&gt;…&lt;/li&gt;
&lt;/ul&gt;
</code></pre><p><br
class="spacer_" /></p><p>Below, applying the grid to list items creates even columns, with minimal changes to the HTML.</p><p><img
src="http://netdna.webdesignerdepot.com/uploads/divitis/list-columns-example.gif" alt="three list items transformed into columns" /></p><p>CSS turns the above list into a multi-column group. If you need a normal list with bullet points, just discard the <code>class="examples"</code> attribute. Is this semantic? Certainly—as long as the content merits a list. The CSS merely changes how each bullet point is presented.</p><p>Another example:</p><pre><code>.photos p { (properties of .grid_10) }
.photos img { (properties of .grid_6) }</code></pre><pre><code>&lt;div class="container_16 photos"&gt;
  &lt;img src="…" alt="photo" /&gt;
  &lt;p&gt;First caption&lt;/p&gt;
  &lt;img src="…" alt="photo" /&gt;
  &lt;p&gt;Another caption&lt;/p&gt;
&lt;/div&gt;
</code></pre><p>This automatically puts captions, enclosed in paragraph tags, adjacent to photos.</p><p><img
src="http://netdna.webdesignerdepot.com/uploads/divitis/photo-on-16.jpg" alt="photo and caption on a grid with minimal HTML" /></p><p>When tables are not appropriate, the tabular effect is easy to create with non-tabular HTML.</p><pre><code>.datelist { (properties of .container_12) }
.datelist h3 { (properties of .grid_3) }
.datelist p { (properties of .grid_7) }
.datelist strong { (properties of .grid_1) }
</code></pre><pre><code>&lt;div class="datelist"&gt;

  &lt;h3&gt;subhead&lt;/h3&gt;
  &lt;p&gt;…&lt;/p&gt;
  &lt;strong&gt;3 p.m.&lt;/strong&gt;
  &lt;strong&gt;Jan 1, 2010&lt;/strong&gt;

  &lt;h3&gt;subhead&lt;/h3&gt;
  &lt;p&gt;…&lt;/p&gt;
  &lt;strong&gt;3 p.m.&lt;/strong&gt;
  &lt;strong&gt;Jan 1, 2010&lt;/strong&gt;

&lt;/div&gt;
</code></pre><p><br
class="spacer_" /></p><p><img
src="http://netdna.webdesignerdepot.com/uploads/divitis/faux-table-example.gif" alt="tablular data marked with non-table tags" /></p><p>The example above is a schedule of events in which each “cell” in the table has a different tag to reflect its unique content, rather than having the catch-all <code>&lt;td&gt;</code> tag. (Ideal? Maybe not. The HTML doesn’t distinguish between groups of content.)</p><p>Applying <code>.grid_x</code> properties to other elements requires some planning, but it results in less-cluttered HTML and doesn’t interfere with 960.gs itself.</p><p><br
class="spacer_" /></p><h1>Use Classes in Parent Items, not Child Items</h1><p>Div-itis and class-itis aren’t limited to CSS frameworks.</p><p>All of the examples in the last section share an interesting trait: only one class declaration in each. Wherever the same class attribute is used several times in a row in the HTML, change the parent instead of the children.</p><p>Unnecessary:</p><pre><code>.item { (various properties) }</code></pre><pre><code>
&lt;ul&gt;
  &lt;li class="item"&gt;…&lt;/li&gt;
  &lt;li class="item"&gt;…&lt;/li&gt;
  &lt;li class="item"&gt;…&lt;/li&gt;
  &lt;li class="item"&gt;…&lt;/li&gt;
  &lt;li class="item"&gt;…&lt;/li&gt;
  &lt;li class="item"&gt;…&lt;/li&gt;
&lt;/ul&gt;</code></pre><p><br
class="spacer_" /></p><p>Above, all six elements have a class. They’re redundant because the classes are identical. Here’s a better way:</p><pre><code>.group-of-items li { (various properties) }</code></pre><pre><code>&lt;ul class="group-of-items"&gt;
  &lt;li&gt;…&lt;/li&gt;
  &lt;li&gt;…&lt;/li&gt;
  &lt;li&gt;…&lt;/li&gt;
  &lt;li&gt;…&lt;/li&gt;
  &lt;li&gt;…&lt;/li&gt;
  &lt;li&gt;…&lt;/li&gt;
&lt;/ul&gt;</code></pre><p><br
class="spacer_" /></p><p>The remedy here for class-itis is to assign a single class to the parent element. CSS selectors do the job, applying the styling to every <code>&lt;li&gt;</code> inside the <code>.group-of-items</code> class. This method can be used on any group of elements with a common parent. For example:</p><pre><code>&lt;div&gt;
  &lt;h1 class="title"&gt;…&lt;/h1&gt;
  &lt;h1 class="subhead"&gt;…&lt;/h1&gt;
  &lt;p class="publication-date"&gt;…&lt;/p&gt;
  &lt;p class="body-text"&gt;…&lt;/p&gt;
  &lt;p class="body-text"&gt;…&lt;/p&gt;
  &lt;p class="body-text"&gt;…&lt;/p&gt;
  &lt;p class="body-text"&gt;…&lt;/p&gt;
  &lt;p class="body-text"&gt;…&lt;/p&gt;
&lt;/div&gt;</code></pre><pre><code>.title { (various properties) }
.subhead { (various properties) }
.publication-date { (various properties) }
.body-text { (various properties) }
</code></pre><p><br
class="spacer_" /></p><p>Most of the paragraphs above are just simple paragraphs and yet have needless class attributes. We also have two headings, distinguished only by their classes—yet adjoining <code>&lt;h1&gt;</code> elements don’t make for a good content structure. Here is a better solution:</p><pre><code>&lt;div class="article"&gt;
  &lt;h1&gt;…&lt;/h1&gt;
  &lt;h2&gt;…&lt;/h2&gt;
  &lt;p class="publication-date"&gt;…&lt;/p&gt;
  &lt;p&gt;…&lt;/p&gt;
  &lt;p&gt;…&lt;/p&gt;
  &lt;p&gt;…&lt;/p&gt;
  &lt;p&gt;…&lt;/p&gt;
  &lt;p&gt;…&lt;/p&gt;
&lt;/div&gt;</code></pre><pre><code>.article h1 { (various properties) }
.article h2 { (various properties) }
.article .publication-date { (various properties) }
.article p { (various properties) }
</code></pre><p><br
class="spacer_" /></p><p>Now only two classes remain. We’ve kept the <code>.publication-date</code> class to distinguish it from the normal paragraphs below it. Because HTML doesn’t have a “date” tag, this class is necessary to show what the paragraph contains. The new <code>.article</code> class enables you to style that div <em>and the elements in it</em> in the CSS with minimal mark-up. The CSS in both examples has four definitions each, and yet we end up with much cleaner code in the second.</p><p>In general, identical elements with a common parent do not need extra attributes. Classes only help when there’s a difference between them. A rule of thumb: use classes only when you need to distinguish between otherwise identical types of content.</p><h2>Simplify</h2><p>The purpose of the 960 Grid System, and CSS frameworks in general, is to reduce the effort needed to lay out web pages. The benefit of CSS is that it reduces the amount of HTML necessary to display a page. But as a layout language, <a
href="http://meyerweb.com/eric/thoughts/2009/02/17/wanted-layout-system/">CSS isn’t perfect</a>. Frameworks are merely tools that help people achieve solutions, not the solutions themselves. It’s up to designers and developers to combat class-itis and div-itis.</p><p><br
class="spacer_" /></p><p><em>Written exclusively for Webdesigner Depot by <a
href="http://benthinkin.net"> Ben Gremillion</a>. Ben is a freelance web designer who solves communication problems with better design.</em></p><p><em><strong>How do you say more with less? Share how you streamline code and your workflow in the comments below…</strong><br
/> </em></p><p><br/><br
/><table
width="100%" style="border-top:1px solid #d7d7d7; border-bottom:1px solid #d7d7d7;" height="20"><tr><td
valign="center"> <a
href="http://www.mightydeals.com/deal/wpbusinessbundle.html?ref=inwidget"><font
face="Arial" size="3" color="#e64f32"><b>Never Ending WordPress Business Bundle &#8211; only $14!</b></font></a></td><td
width="90"> <a
href="http://www.mightydeals.com/?ref=inwidget"><br
/> <img
src="http://mightydeals.com/web/images/widget-logo.png" height="40" width="90" border="0"  /><br
/> </a></td></tr></table><p><br/></p> <a
href="http://www.webdesignerdepot.com/2010/03/fight-div-itis-and-class-itis-with-the-960-grid-system/">Source</a><style type="text/css">
 p img {display:inline-block; margin-right:10px;}
.alignleft {float:left;}
p.showcase {clear:both;}
body#browserfriendly p, body#podcast p, div#emailbody p{margin:0;}
</style>]]></content:encoded> <wfw:commentRss>http://www.webdesignerdepot.com/2010/03/fight-div-itis-and-class-itis-with-the-960-grid-system/feed/</wfw:commentRss> <slash:comments>49</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (User agent is rejected)
Database Caching 16/64 queries in 0.028 seconds using disk
Object Caching 1478/1570 objects using disk

Served from: www.webdesignerdepot.com @ 2012-02-10 13:12:49 -->
