Design

Building an Online Web Design Portfolio: Tools, Themes, and Templates


  

There many benefits to having an online web design portfolio, but there is something more than beneficial to displaying web design work online, in the arena in which it was intended; it just feels at home. Optimized and ready to show off its full potential. A high-quality portfolio can leverage the same interactive, responsive features that a well designed website uses, letting you show clients your strengths and capabilities.

A successful online portfolio will use the same rich media functionality that a great website would, too — and with these hosting services, templates, and themes, you don’t have to be an experienced developer to do set yours up. These tools allow designers at all levels of expertise to create a sleek, functional online web design portfolio worthy of the work it displays, from low-maintenance to highly customizable.

We’ll start off by taking a look at portfolio hosting services that allow for a wide range of customization. For those who use WordPress to host their portfolio or personal website, we’ve collected responsive and rich media capable themes and templates that are specially oriented toward portfolios.

Portfolio Hosting Services

Behance

Behance is perhaps the best-known and highest-visibility portfolio hosting service on the Web. They emphasize the fact that the Behance network gets “fifteen times the traffic of all other leading portfolio websites combined� — a powerful asset for designers looking to gain more exposure and a wider audience.

Behance offers fully customizable portfolios for creative professionals of various disciplines, and its graphics-heavy layouts and multimedia options are well suited for web designers. A free account offers unlimited images, video, text, and audio, and its social-media integration lets you share your work across multiple platforms. You can display work on your LinkedIn profile, promote it on Twitter and Facebook, or use Behance’s community tools to follow other users, and gain followers, too.

You’ll find curated sites, collections, and galleries from big names to independent designers, as well as active job boards and groups. Behance aims to connect talented designers and professionals with each other and with career opportunities.

Behance ProSite

ProSite.com is Behance’s paid portfolio hosting service that features even more customization options, personal domain names, white-label branding (no Behance logos), and syncing with the Behance network. The service costs $11 per month and functions as a personal website for creative professionals; you can import your blog and develop your personal branding vision. Behance ProSite is accessible to designers with all levels of development experience: no programming knowledge is required to build a site, and you can choose from a large variety of layouts and templates.

Behance Prosite

Viewbook

Portfolio hosting service Viewbook is embracing the mobile revolution: it’s available on Web and mobile and offers iPad-app integration, so you can display your work on the go. The interface is clean and minimalist, though the portfolios feature plenty of customization options.

Viewbook focuses heavily on social media: you can share and publish your work to Tumblr, Twitter, Facebook, and more with one click, or embed Viewbook albums in your personal website or Facebook timeline. Support is available for Adobe Lightroom, Google Analytics, and Wufoo forms for freelancers. Pricing is three-tiered, ranging from $4 per month for a basic gallery to $19 per month for a personal domain, unlimited websites, full customization, and Viewbook’s iPad app.

Viewbook

Cargo Collective

Cargo Collective is a web publishing platform with an emphasis on portfolio capabilities and support. The service offers public website hosting and “Personal Networks� for users, as well as a support and development forum. Some basic programming skills are needed to complete customization, though many templates are available as well. However, Cargo is best suited for those designers with more development experience.

Cargo sites offer built-in video and audio players for externally hosted content, as well as cloud-based image hosting. An expansive directory lists experienced designers and developers to aid other users in customization. Like Behance, Cargo Collective is community-oriented.

Cargo Collective

Wix

Wix is a DIY website-building service that lets users create a custom site — with no knowledge of coding necessary. Based on a drag-and-drop format, Wix now offers rich media capabilities, with both Flash and HTML5 support. Hundreds of free templates are available, and the service is based on a freemium model: users create free accounts, and upgrades cost between $4 and $16 per month for features like custom domains and e-commerce designs.

Wix

Fresh.li

Fresh.li, like Wix, offers creative-professional portfolio services without requiring programming experience. They boast that users can create “a new website in five minutes,� using either a fresh.li subdomain or a personal URL. Free portfolios aren’t as extensively customizable as other options, and just six templates are available, but paid options allow for customization using HTML and CSS.

Fresh.li

Carbonmade

Carbonmade, with its simple but sleek interface, is strictly a portfolio-hosting service: no networking or career services are included, though it’s a useful option for designers who might have less experience and are primarily looking for a place to display their work.

Carbonmade portfolios are functional and relatively minimalist in design, though the site itself features whimsical graphics and illustrations. Free and paid options are available; the latter, at $12 per month, offers domain binding and technical support.

Carbonmade

Specialized Portfolio Hosting Services

Certain portfolio-hosting services are geared toward particular categories of creative professionals, or toward goals like career building. The services below are for designers who are looking for specific capabilities from their online portfolios.

The Creative Finder

The Creative Finder is a division of DesignTAXI, a news site with a focus on web design. It offers portfolio hosting and integration with networking and career services, letting creative talent find employment opportunities and professional connections. Portfolios on The Creative Finder function essentially as galleries of a user’s work, allowing for professional contact, networking, private messaging, and linking to profiles on social-media platforms.

The Creative Finder

Sortfolio

Sortfolio is career-focused, as well. The service offers listings for designers rather than full portfolios. It offers the most functionality to designers who are already relatively established, but who want to expand their reach to big-name clients. Free listings are available, and $99 per month will get you large, interactive display ads and personal-branding options.

Sortfolio

Krop

Krop is a tool for job-seeking web designers and creatives; it brings together job listings from recruiters and paid portfolio hosting, at $9.99 per month. Portfolios are fully customizable, and Krop’s back-end creative database lets recruiters target designers by specific capability, location, availability, and professional level.

Subfolio

Subfolio, a DIY portfolio tool, allows users to configure portfolios on their own servers. The service is best for designers with significant development skills: it’s a PHP5 file browser application that lets users manage settings, file types, themes, and more. Subfolio reads the files you place within a directory folder and then turns the content into a website, turning folders into sections and files into pages. It’s currently in private beta, though you can request an invitation here.

Subfolio

Themes and Templates for WordPress

Many web designers choose to host their personal websites and portfolios on WordPress. The platform’s open-source software and powerful CMS offer extensive customization options for users of all development skill levels. Many portfolio-specific themes and templates are available for WordPress, and, as with the hosting services detailed above, options are available for those looking for all degrees of customization. Below are a number of themes and templates that are particularly well suited to web designers.

Responsive Themes

Responsive themes allow portfolio content to be displayed correctly — and attractively — on multiple devices, screen sizes, and resolutions. Given the rapidly increasing importance of the mobile web, it’s crucial for web designers to optimize their portfolios and content for mobile devices if they want to reach a broader audience.

Theme Trust

ThemeTrust.com offers premium WordPress themes with responsive, minimalist interfaces, many of which are optimized for web-design portfolios. Some examples of portfolio themes (all ThemeTrust themes below cost are priced at $49):
Theme Trust

Infinity

Infinity, a responsive portfolio theme, features a grid layout and infinite scrolling capabilities. The image-heavy interface allows designers to showcase their work front and center. Among its features are a built-in lightbox, social-media integration, and threaded comments.

Infinity

Solo

Solo, a single-page portfolio theme, leverages jQuery effects within a minimalist layout. The theme features expanding project displays, automatic scrolling, and integration with Flickr and Twitter.

Solo

Reveal

Reveal offers an Ajax-powered portfolio with a responsive layout; the theme features animated jQuery drop-down menus, smooth portfolio filtering animations, and extensive customization options. The image-heavy, grid-system layout displays well on all devices.

Reveal

Hero

Hero’s parallax home-page banner lets designers prominently feature their best work. The responsive theme includes templates for pagination and archive pages, making it easy to organize a larger body of work.

Hero

ThemeForest

ThemeForest.net offers themes and templates for designers with programming backgrounds: for WordPress, Joomla, HTML/HTML5, Magento, and more. Below are examples of responsive themes and templates which work particularly well for web-design portfolios.

Theme Forest

Tinfoil

Tinfoil is a one-page portfolio template that includes jQuery tools and minified CSS and JavaScript. Beyond the portfolio itself, the template features a gallery, blog, contact form, and more.

Tinfoil

Parallax

Parallax, an HTML portfolio template, offers (of course) a parallax slider, a skeleton grid system, and a three-layered background that creates the illusion of depth. The WordPress version focuses more on blog capabilities, though it also offers extensive customization options, with an intuitive interface.

Parallax

Milestones

Milestones, a single-page template for either personal or commercial portfolios, is a colorful template with a host of features especially useful for web designers. It offers valid HTML5, a contact form, a jQuery slider for the portfolio itself, and various social-media integration options.

Milestones

Themify

Themify.me provides WordPress themes that are extensively customizable — without requiring coding knowledge. Theme packages do include PSD files and Themify frameworks if you have programming experience and would like to further customize them.

Themify.me

Folo

For designers focusing primarily on networking, Folo is a useful theme: it allows designers to display their work samples and available services, and features the same customization options as other portfolio themes. Folo’s circular slider and twenty-one layout options — lists or grids — make it a flexible option for designers looking for business opportunities.

Folo

Blogfolio

Blogfolio’s interface combines a web-design portfolio with blog posts, turning your portfolio into an integrated personal website. The theme’s image-heavy layout features threaded comments, custom menus, feature boxes, and various grid or list options.

Blogfolio

Simfo

Simfo, a responsive portfolio theme, offers full customization for designers with programming experience; it’s coded with HTML5 and CSS3. The theme offers a feature slider, a plugin-free lightbox gallery, and optional search options, RSS, and social-media icons.

Simfo

In the End

Whether your development skills are as well honed as your design abilities or whether you’re looking for a simple, straightforward online portfolio, there is an array of choices available for hosting services, themes, and templates. The best part? Flexible customization options mean that you can change your portfolio as your skills, needs, and experience changes — all with the support of design communities and networks. What are some of your favorite web design portfolio options?

(rb)


Selling Art: Creative and Artistic Advertisements


  

We live in a world, in a society, where it’s almost impossible to go a day or a couple of hours or even a few of minutes without trying to be sold something. Sometimes an opportunity to purchase can present itself subtly; perhaps a friend has a product you like or perhaps you drove past a billboard on the interstate. Sometimes the opportunity to purchase presents itself directly in the form of a salesperson, or even a blatant advertisement of some sort urging you to buy.

Most times, advertisements are the way in which we are given opportunities to, at the very least, learn about a product. Whether it’s a commercial or a billboard or a radio spot, advertisements are everywhere. The inconsistency in advertisements comes in the way in which they are presented, for example, are they humorous or serious, or in this case, what is the art direction?

Today, we are going to look at some print advertisements that use an artistic approach to selling their product. Sometimes print advertisements use glamour shots, or even great photo manipulations to convey a point, but this time we just want to showcase some of the artistic advertisements whose main focus is on conveying their point very creatively.

Selling Art

Bayer Nazol: Smells of the World, Countryside
The best advertisements are those that over exaggerate a bit. Here, this wonderful illustration let’s us believe that if we buy and use this product we can pretty much smell everything. The hand drawn, simplistic direction makes this fun.

Top Digital: Paradise
This audio company used some illustrations to show how they use sounds and such to create their paradise. The illustrator uses some crazy designs and shapes to create the finished product.

BWF Badminton
The focus for this ad is basically the motion and energy created by badminton. Quite frankly, many don’t believe this sport to be that exhilarating or exciting, but this advertisement tries to show otherwise. This is an extremely creative ad.

Cocaine: Amy
Though a bit of a controversial piece, this ad did a great job illustrating someone who can be argued to be an icon.

Yellow Pages: Coffee
Art isn’t just about what you can draw or paint, but it’s also the way in which you compose. This collage of sorts visualizes a coffee cup and saucer. A very interesting piece.

La Curacao Store: Orange and Carrot
The folks in charge of these ads decided they wanted to use art straight up by mixing the colors of the fruits and vegetables used in certain blends they have tried. This one focuses on oranges and a carrot smoothies.

Gilera Creation
Well, this one is obviously all about the art, with one of the most famous pieces of art represented in the background. The team here makes it seem as if the motorcycle is a piece of art (note: the paint splashes and brush and palette) to be put up against the greats.

Gotte Optician: Tie Guy
While not sure if these shapes were actually cut out or if this is some great shading, the illustration here as well as the imagined process gets all the focus.

Invaders Pest Control: Disintegrate, Mosquito
This is an extremely simple, yet effective piece that uses another illustration to convey their point.

Jornal O Povo: Hendrix
This ad shows another illustration of a huge musical icon, drawn and with a seemingly thought provoking question to go along with it. The only visual focus, really, is the actual illustration.

La Salle
There’s a lot of things going on in this advertisements and a lot of things to be said, but each is conveyed creatively with a mixture of illustrations and pictures. The ad is for a school of the arts, so why not use art to convey their message?

Magazine Luiza: Coffee Machine Sale
With a bit of a humorous look, this is another illustrated piece that helps convey a little bit of fun. It’s simple, it’s easy to get and the art is pretty good too.

Marmaluzi Baby Food: Frozen Meat
The illustration and composition here are amazing. The idea was obviously to look a bit like a comic book cover or movie poster and they did such a great job. It’s very different for an ad, especially one for baby food.

Mikro Club
It’s easy to think, when you’re advertising a night club to just have pictures of the club and work around that. This club decided to take a very artistic and creative approach to the idea, which actually strikes up a bit of interest.

Nescafe: Sailor
Sometimes when you want to get a message across, the best way to do it is with no frills and fluff. This simple, nice illustration does just that.

Purrel Hand
Hand sanitizer is meant to kill the germs found on your hand. This ad illustrates many of the things we touch that have the germs on them. Some of these are eye openers and nevertheless, this is a wonderfully executed illustration.

UNICEF: School Bullying
The idea here is that bullying is not a game, especially for the one that is being bullied. The art director here chose to parallel that idea with a game of pinball via a super amazing illustration.

Spoleto Restaurants: Food Fantasy, Little Red Riding Hood
Though this has a nice fun and childlike illustration, this advertisement does have a very serious message. Nonetheless, the texture and the execution of it all are very inspiring.

The Times of India
Again, this creative ad isn’t about how great of a drawing or painting is put in place, but how the actual focus is prepared. This seems to be a bunch of newspapers gathered to look much like a finger print.

The Ultra Asian, 1
This massive illustration attempts to create a large piece dedicated to asian culture. There is no one focus, but the task was carried out creatively and beautifully.

Vogele Shoes: Box Models, Skater
This shoe company is about making a creative difference with affordable shoes. How can you not like it?

La Fabbrica di Nichi
Many graphic designers and illustrators put a good amount of emphasis on typography as an art. Here we have an advertisement that uses some decent typography to get their point across.

Caos Sustainability: 7 Billions, 2
In an attempt to display a bunch of scientific (and sometimes boring) information, this agency decided to try a little creativity for their art direction. It’s as if they took a picture of a couple faucets and made a kaleidoscope–it’s a bit busy but attractive.

Koolfoam Mattress: Lullaby Baby
There are a lot of ways someone can visualize a baby sleeping on a soft mattress. This agency decided to take an artistic and illustrative route.

The Pepsi Slavic Epopee, Kubicek
There are times when companies try to take something extremely iconic and make it conform to their idea of their company. This go round, Pepsi decided they wanted to reinvent the Slavic Epopee –and the illustrator did an amazing job.

Perfecthalf.com: Common Place, Her
This is an extremely different and creative approach to an advertisement. Advertising what would seem to be a dating service, they show their uncommon approach through this uncommon ad.

Angels in my Kitchen Bakery & Confectionery: Santa’s Gift
Guess Santa got tired of someone stealing his treats? This extremely artistic and creative advertisement seems to believe as such.

Scrabble
Some people really believe that there is an art to playing word games such as Scrabble. This advertisement tries to make that clear, not just by presenting the words that can come out of the letters, but through the artistic execution of this ad.

Faber-Castell: The Scream
As previously mentioned, some agencies love to take something that’s recognizable and use it for the sake of the company they are selling for. This time the agency is trying to sell art supplies by using some of the most famous art works seen–by creatively recreating them.

Conclusion

Now that you have gotten through this showcase, and seen the many ways that art is used to sell products or services through print advertising campaigns, we want to hear from you. What did you think about this collection, or what type of print advertisements do you prefer? Are their any great iconic print campaigns you feel should have made the list?

(rb)


CSS generated content and screen readers

As all widely used web browsers (unless you still consider IE7 as being widely used) now support the :before and :after pseudo-elements along with the content property, using those pseduo-elements has become more and more common.

There are many clever CSS tricks they can be used for, like implementing a particular design without having to insert extra markup into your HTML. There is one catch though, and many developers seem unaware of this: several screen readers will speak content that is created this way. VoiceOver does (in both OS X and iOS). NVDA does when used with Firefox, though not with IE. I made a CSS generated content demo page so you can try it yourself.

Read full post

Posted in , .

Copyright © Roger Johansson



Websites With Seamless Social Media Integration


  

Well, its official: social media is here to stay. While it can be difficult to keep up with the ever-changing social landscape, a basic understanding and implementation of the different platforms available can get big results. Companies of all sizes are taking advantage of the free publicity and word-of-mouth that social media can offer them.

One of the most logical ways for companies to capitalize on this trend is to integrate their social media campaigns with their websites. Unfortunately, some websites treat their social media links as an after-thought, and it shows. These sites will often use stock icons supplied by the social media outlets that do little to coordinate with the look and feel of the website itself. In other cases, the links might just be shoved into any blank space that was previously unoccupied. Either way, this is no way to treat such a potentially valuable marketing tool.

The following collection of websites, on the other hand, do a fantastic job of integrating their social media campaigns into the design itself. Through custom designed icons and typography, these social media elements fit into the page stylistically, and are easily accessible without overwhelming the user.

Websites With Seamless Social Media Integration

Trailer Park Truck is food truck based in Los Angeles, and they want to make sure their fans can always find their current location. They placed their twitter and Facebook links in the left margin of the site in what looks like an attached wooden sign.

Adventure World is a theme park in Australia with a fun, retro website. Rather than use icons that might clash with the site’s design, they opt for the typographic treatment. They chose a quirky script font that coordinates perfectly with the images as well as the other typography on the site.

Lefft is the portfolio site for Irish Illustrator and UX designer, Paddy Donnelly. The site as a whole has a very colorful, tactile feel to it, and the social icons complement this beautifully. A subtle hover effect darkens the icons as you mouse over them.

Brand designer Aran Down‘s portfolio site has recurring ribbon embellishments used throughout. This treatment works very well with the custom-colored social icons used.

No Leath is a women’s shoe company with a pretty slick parallax scrolling site. Not wanting their social links to be left behind as their customers scroll, they are in a fixed position, right underneath the main navigation. They have been subtly customized in black, with a slight bevel to match the black leather shoes of course. Gotta match the shoes.

Flint Boutique specializes in wedding invitation design, and that is translated very nicely into their website. Their oversized Facebook button includes a variation on the traditional Facebook “f” inserted into a heart. That combined with coordinating typefaces and a faux-stamped texture makes it feel as handmade as their invitations.

The portfolio site for Pixel Peak design is a study in simplicity. It follows a very grid-like structure and the attention to detail is spot-on. The social icons blend in with the header seamlessly, and the hover effect on each slides up to reveal a pop of color.

Carl Rosekilly‘s design portfolio site is layered, dark and bright all at once. His links to Facebook, Twitter and Flickr are meant to look like little discarded bits of paper, which may not work on other sites, but it fits this grungy, layered site very well.

Tigi Hair Products uses an ultra elegant black bird icon positioned above an equally eye-pleasing Twitter feed. It cycles through their most recent tweets, one at a time. It is just large enough and centered on the page for maximum impact.

The Rexona For Men site wants to know what makes you a superhero? Styled like a comic book, the social icons take on the shape of shields.

The Thomas Oliver Band doesn’t want you to forget to follow them, tweet them, or email them. That’s why they practically nailed their social buttons to the floor. As you scroll up and down their site, the simply styled buttons remain anchored to the bottom of the window.

The World Wildlife Fund’s Earth Hour 2012 site is simple, using cool colors, simple shapes and plenty of white space. They chose to use an oversized footer with a large Twitter call-to-action. It matches the aesthetic established for the rest of the site, while calling due attention to itself.

Blind Pig Design is the portfolio site for designer Aaron Awad. It has a hip, illustrated vibe with subtly distressed elements for character. He uses a halftone pattern for his social media icons, which lets them fit right into their surroundings nicely.

The portfolio site for Marco Rosella has one of the most interesting navigation concepts I’ve ever seen. Rather than scrolling up, down, or side-to-side, you zoom into the content on the z axis. When you zoom in far enough to get to the contact info, that’s where you will find links to his Linkedin, Twitter and Facebook, cut into interesting, organic shapes.

Moovents is a social media agency, so one would expect great social media integration in their website. Keeping it simple, but sophisticated and noticeable, their social icons are greyscale versions of the famous logos, presented front and center in the header bar.

House musician Ricky Ryan‘s website features small but mighty social links colored in shades of copper. Placed right under the musician’s logo, (which stays in place no matter where you are within the site’s horizontal navigation) they are not likely to be missed.

The site for Upward Creative has a very mod 1960s look, and the simple row of circular icons certainly lends itself to that era as well.

Pulp Fingers is a team of designers and developers that specialize in making apps. The overall look of the site is very retro and playful, with typography and images seemingly cut out of construction paper. The Facebook and Twitter icons have a similar look, with a slight paper texture.

The minimalist site for Tokyu Agency deserves minimalist icons as well. Breaking free of their usual enclosing shapes, these icons use only the familiar initials as links. Only a slightly darker color than that of the background, they are barely there, yet always there, as they are in a fixed position at the top of the window. A mouseover reveals a colorful circle background for each icon.

Layout Lab‘s website is light and breezy with lots of negative space and a healthy dose of lime green for flavor. The links to their Twitter and Dribble accounts look right at home in fixed tabs on the upper left side of the window.

The site for Fancy Rhino uses triangles as a recurring design element. Team member photos, and portfolio work all appear in triangular shapes, so why not their social links? A simple row of triangles on their contact section communicates the different ways you can follow their work.

Friendly Gents is a Cincinnati web design studio with a vintage barbershop-inspired site. They use a lot of distressed fabric textures, and their social media links look like they are literally embossed into the fabric.

Ghosthorses‘ website is another with a quirky retro style. It uses a lot of mid-century typography, and textured ribbon embellishments. Their custom styled Twitter feed and follow button fit the rest of the page’s style like a glove.

Fringe Web Development goes even further back in time, with a turn of the century look and feel. The main navigation is in a left sidebar with a row of simple, elegantly styled social buttons right beneath it.

Liechtenecker is a “superfresh” web agency in Germany. Their site is fun, colorful, and textured, and the honeycomb-shaped social links are no different. They stand out in contrast to the neutral beige background, yet they complement the visuals on the rest of the site perfectly.

Share Your Thoughts

That does it for our list, but now its your turn to get social and share some of your own favorites. Which did you like on this list? Do you have any others that we missed that should to be included? Take a moment and give us your opinions in the comment section below.

(rb)


The Mobile Web: CSS Image Replacement for Retina Display Devices


  

I see more and more devices that have a pixel ratio bigger than 1.5, even 2. My Galaxy Nexus for example has a pixel ratio of 2 and so do the latest versions of the iPhone and iPad. Retina display seems to be the next evolution and next challenge for us as designers.

introduction

Native mobile app designers have already learned how to take advantage of those devices with high pixel ratios to display bigger images with better quality, so as to enhance user experience. They are used to creating the images in both normal and retina @2x sizes for the iPhone, and creating 4 sets of drawables in 4 different sizes for Android devices.

With the iPad 3 also having retina display, it is definitively something that will be harder to avoid from now on. In this article, you will see how to use some CSS3 tricks in the field of image replacement to serve images with better quality to those high resolution devices.

Story Behind the Code

It all began when I was creating a jQuery Mobile application for the iPhone. The idea was to make a full HTML5 jQueryMobile app, and to embed it in a “native shell�, using Phonegap.

For this application, I created a bottom tab-bar that was imitating the native iOS tab-bar, and also a header with a logo image in it. Both the header and footer were HTML elements that used image replacement techniques to display the icons and logo.

When I tested the application on the iPhone 4S, I saw that the logo and the icons were highly rasterized and looked pretty ugly.

The Demo

The demo

I re-created a fake application page similar to the iOS native style so you can see what is going on. Whether you have a retina device or not, you can test it here with your phone. You can see the demo here. You can also download the code here.

As I said, if you load the page on a non retina device, it will look good. If you load it on a retina device, the images get rasterized.

This is due to the pixel ratio being 2, so the image is multiplied by two and stretched by the device, creating this unclean rendering. Here are some screenshots of the demo on iPad 3, iPhone 4 and Galaxy Nexus with the images being rasterized:

Galaxy Nexus:
Android rasterized

iPhone 4:
iPhone rasterized

iPad 3:
iPad 3 rasterized

CSS Image Replacement Techniques

In this demo, I used different techniques for replacing images that will have varying consequences when we will want to change for retina images.

The first image we replace is in the logo, being sure to only set the height of the element. The HTML looks like this:

<div class="ui-header"> <h1> My logo </h1></div>

The CSS like this:

.ui-header h1{

color:#fff;

display: block;

outline: 0 none !important;

overflow: hidden;

margin:0;

text-align: center;

text-overflow: ellipsis;

white-space: nowrap;

text-indent:-9999px;

background:url(img/logo.png) no-repeat center center;

height:33px;

}

Again, what’s important here is that we give it height, but no width.

The second technique is to use the delete button. We want to keep the text for this one, so we will add the icon in the :before pseudo class. The HTML looks like this :

<p> <a href="#"> Delete item </a> </p>

And the CSS code like this:

.delete:before{

content: " ";

display:block;

width:20px;

height:20px;

position:absolute;

left:6px;

background:url(img/delete.png) no-repeat;

}

Note that in this case, we gave the element both a width and a height but no padding.

The next element to which we want to add an icon is the download button. The HTML looks like this:

<p> <a href="#"> Download </a></p>

And the CSS like this:

.download {

background:rgb(222, 227, 232) url(img/nuage.png) no-repeat 8px 6px;

border:1px solid rgb(199, 206, 212);

padding: 25px 0 25px 120px;

font-size:20px;

color:rgb(144, 160, 176);

text-shadow: 0 1px 1px rgb(239, 242, 245);

}

This is what we will call the third technique: assigning some padding, but no height or width. You will understand why below.

For the footer however, we also assign a width and height for the element, padding too. The HTML:

<a class="bubble button" href="#"> bubble </a>

The CSS:

.ui-footer .button{

background-color:rgba(187, 185, 185, 0.2);

border:1px solid rgb(22, 22, 22);

box-shadow: 0px 1px 2px rgba(22, 22, 22, 0.5) inset ;

text-indent:-9999px;

padding:10px 15px;

width:40px;

height:40px;

background-position: center center;

background-repeat:no-repeat;

margin: 0 5px;

}

.bubble{

background-image:url(img/bubble.png);

}

At this point we have different case scenarios for the image replacement that will load non retina images for all devices, for now.

Media Queries Pixel-Ratio to the Rescue

The next idea was then to find a solution to make those devices load better quality images. I remembered the media query device-pixel-ratio (vendor prefix needed). I never used it before, and decided to give it a try. You will need some vendor prefixes here (Mozilla is the strangest one).

The idea was pretty simple: I decided to try to serve those devices an image that would have twice the size of the desktop one. I chose a @2x notation for the retina image because I’m used to doing so when I create images for native iOS apps. I ended up doing something like this:

@media only screen and (-webkit-min-device-pixel-ratio: 2),

only screen and (min--moz-device-pixel-ratio: 2),

only screen and (-o-min-device-pixel-ratio: 2/1),

only screen and (min-device-pixel-ratio: 2) {

#myelement{

background:url(myicon@2x.png) no-repeat;

}

}

You would think that this works good. True, the retina image is loaded, but the problem is that the image is now twice the size. Still not displaying properly. Here is what it looked like on my Galaxy: the icons are nice and sharp, but not quite right.

Android double sized

Background-Size Property Lends a Hand

Now that we have the high resolution images loading, we need to ensure they are the right size. To do this, we will use the super useful CSS3 background-size property that is actually able to resize backgrounds as needed. You can either use pixel properties for width first then height, use percentages, or set the value to “auto�.

It’s simple to see it in the code. (Note that I used the id #retina for the demo purpose to only target the second part of the demo, but you can of course omit it in your code)

For the header button you remember that we did set the height but not the width, to do the trick here, we will then set the background height to the same value (we can leave the width at auto).

#retina .ui-header h1{

background:url(img/logo@2x.png) no-repeat center center;

-webkit-background-size: auto 33px ;

-moz-background-size: auto 33px ;

background-size: auto 33px ;

}

For the delete button technique it’s a bit easier, since we did set both width and height AND since it has no padding, we can set the value to 100% for each, meaning that the icon will use the whole container space:

#retina .delete:before{

background:url(img/delete@2x.png) no-repeat;

-webkit-background-size: 100%  100% ;

-moz-background-size: 100%  100% ;

background-size: 100%  100% ;

}

For the download button, it gets trickier. Since we did not give it any width or height, we will then have to set the exact sizes of the non retina image for this one:

#retina .download {

background:rgb(222, 227, 232) url(img/nuage@2x.png) no-repeat 8px 6px;

-webkit-background-size: 70px 68px ;

-moz-background-size: 70px 68px ;

background-size: 70px 68px ;

}

For the footer icons, we did set width and height, but the element has some padding. So here we will have to set at least one of the two values to make it work:

#retina .bubble{

background-image:url(img/bubble@2x.png);

}

#retina .loupe{

background-image:url(img/loupe@2x.png);

}

#retina .folder{

background-image:url(img/folder@2x.png);

}

#retina .ui-footer .button{

-webkit-background-size: 40px auto ;

-moz-background-size: 40px auto ;

background-size: 40px auto ;

}

And this is what it now looks like:

Final product

What About HTML Images?

I only base this article on the CSS images, but of course there are also images directly in the HTML. For this, you will have to take a look at some responsive image techniques. So far I tested retina.js and have to admit that it’s pretty simple to use, you just have to put a @2x image in the same folder as the normal one and include the script. There is also the Retina Images plugin that seems to do the same job, but needs more server side configuration.

Limitations and Conclusion

As you can see, each case is different and you will have to play with the background-size values to get exactly what you want. The other limitation would be browsers downloading two images for this hack: first the normal, then the retina. I’m not an expert in this particular domain and did not run tests for the demo so if you want to, feel free to do and you can post the results I’m curious to know the browser used and if the images are downloaded twice.

The techniques used in this article are based on a lot of CSS3 code, so might not be supported by all browsers. Also, having to create all the images in two sizes can be hard for maintaining the code, and take more space on the server side. So you will have to think carefully before you use such techniques. Forcing devices to load images twice the size, and then to resize them can also be bandwidth consuming.

In conclusion, I would advise that even though this is a good technique for creating sleek pixel perfect nice interface for devices that support it, there are considerations to be made before using such a technique. Naturally, this won’t be the solution for everyone.

Going further

If you are interested in displaying nice icons without having to create the files twice, you also can take a look at the iconic font technique and at SVG images. There is also this article you can look to, but here again, this is not widely supported.

(Credits for the monochromatic icon set)

(rb)


  •   
  • Copyright © 1996-2010 BlogmyQuery - BMQ. All rights reserved.
    iDream theme by Templates Next | Powered by WordPress