• Feed RSS
Showing posts with label Web Design. Show all posts
Showing posts with label Web Design. Show all posts

Responsive Web Design: Layouts and Media Queries

With the growing number of Smartphone produced in the last three years and the diversity of screen sizes it’s practically impossible to ignore users that browse on a mobile device. Whether they use an Android phone, Windows Mobile phone, a BlackBerry device or an iPhone, whether they are on a tablet, on a Smartphone or on a big screen, each user deserves the best experience possible. As designers, it is our goal to provide those users a nice experience browsing the websites we created, whatever the device used to browse is.
Today most of the clients want their website to be mobile compatible, so this is particularly challenging. Creating a version for each device is impossible, due to the number and diversity of those devices, but also simply because we don’t know what will be created tomorrow. That’s where the concept of “Responsive Webdesign” comes to the rescue.
Responsive Web Design: Layouts and Media Queries



A responsive website is a website that will respond and adapt to the user’s behavior and screen size. The idea is to resize and reorder the design, adapt images, typography, columns, etc., based on screen - browser size, resolution and orientation instead of providing each device a specific website.

A Look at 3 Different Types of Layout

Basic Fluid Layout

Fluid layout is based on a system of relative units instead of absolute pixels. This kind of layout has been around for a while now, and most of the designers use fluid grids created in percentage to achieve such layouts.
The idea is pretty simple: instead of giving the layout rigid width in pixels, we will give it relative ones in percentage. The fluid layout based websites usually take the whole browser width, hence the 100% in this example.
You can see a demo of a fluid design here.
Fluid
Data JavaScript credit: Andreas Bovens
The style.css gives us common styles for the page (color, typo), but let’s take a look at our fluid.CSS file :
#header {
    width: 100%;
    margin: 0;
    padding: 0;
}
#content {
    float: left;
    width: 60%;
    margin: 0 0 20px 0;
    padding: 0;
}
#content .inner {
    margin-right: 2%;
}
.sidebar{
    float: left;
    margin: 0 0 20px 1%;
    padding: 0;
}
#bar1{
    width:20%;
}
#bar2{
    width:18%;
}
#footer {
    clear: both;
    width: 100%;
    margin: 0;
    padding: 0;
}
Our header and footer have a 100% width, so they’ll take the whole screen available. The main content has a 60%, and our sidebars 20% and 18% so that we will be able to create a design that will fit the whole space available.
This design adapts perfectly on big screens, but we can see that the sidebar content tend to become hard to read when we resize too small.

Adaptive Layout

The adaptive layout is based on a pretty simple idea: instead of using percentage we will give our layout fixe sizes, but we will adapt those sizes depending of the width of the browser/viewport, thus creating a layout with different “break points”.
For each of those break point, we will use media queries (will come back to explain them in detail in the second part of the article) to adapt the layout of our website so that content is not too hard to read.
You can see and example of adaptive layout here.
Adaptive
The HTML and style.css did not change; all we changed was the structure of the page. Let’s take a closer look at our CSS file.
The "normal" website uses this CSS:
body{
    width:1280px;
    margin:0 auto;
}
#header {
    width: 100%;
    margin: 0;
    padding: 0;
}
#content {
    float: left;
    width: 800px;
    margin: 0 0 20px 0;
    padding: 0;
}
#content .bloc{
    margin-right: 10px;
}
.sidebar{
    float: left;
    margin: 0 0 20px 20px;
    padding: 0;
    width:220px;
}
#footer {
    clear: both;
    width: 100%;
    margin: 0;
    padding: 0;
}
I gave the header and footer a 100% width, but the content has a fixed width. Now the good part, the break points with media queries:
/* Media queries */
@media screen and (max-width: 1200px) {
    body{
    width:1000px;
    margin:0 auto;
    }
    #content {
    width: 700px;
    }
    .sidebar{
    width:280px;
    }
}

@media screen and (max-width: 980px) {
body{
    width:850px;
    margin:0 auto;
    }
    #content {
    width: 550px;
    }
    .sidebar{
    width:280px;
    }
}

@media screen and (max-width: 750px) {
    body{
    width:600px;
    margin:0 auto;
    }
    #content {
    width: 400px;
    }
    .sidebar{
    width:190px;
    margin: 0 0 20px 10px;
    }
}

@media screen and (max-width: 540px) {
    body{
    width:450px;
    margin:0 auto;
    }
    #content {
    width: 450px;
    }
    #content .bloc{
    margin:0px;
    }
    .sidebar{
    width:450px;
    margin: 0 0 10px 0;
    }
}

@media screen and (max-width: 380px) {
    body{
    width:360px;
    margin:0 auto;
    }
    #content {
    width: 360px;
    }
    #content .bloc {
    margin:0px;
    }
    .sidebar{
    width:360px;
    margin: 0 0 10px 0;
    }
}
For each break point given by a media query, I changed the size of the body, the content, and the sidebar. Under 540px, the text in the sidebar was too hard to read, so I gave the sidebar the same size as the content, what has the effect of putting the sidebars under the content.
This nice thing about adaptive layout is the possibility to modify and adapt not only the size of the blocs, but the layout and there place on the page.
The big difficulty is then to choose those break points. A first technique could be to base the break points on most "common" device width. Chris Coyier from CSStricks put a nice list of media queries together. Another way to choose the break points it to actually test the design at different screen sizes and see when it gets ugly or when user can’t really read the text easily, and put break point at those size.
Live example of adaptive layout :
Foodsense

Adaptive Example

Responsive Layout

We could define the responsive layout, as a mix between the fluid and adaptive layouts. It will use the relative units of the fluid layout and the break points of the adaptive one.
Here you can see the demo of our previous example, in responsive layout.
Responsive Example
You can see here how fluid the design is: using percentage enables us to create very smooth transition between the different break points of our design.
Here is our stylesheet for the "normal" version:
#page{
    max-width:1280px;
}
#header {
    width: 100%;
    margin: 0;
    padding: 0;
}
#content {
    float: left;
    width: 60%;
    margin: 0 0 20px 0;
    padding: 0;
}
#content .bloc {
    margin-right: 2%;
}
.sidebar{
    float: left;
    margin: 0 0 20px 1%;
    padding: 0;
}
#bar1{
    width:20%;
}
#bar2{
    width:18%;
}
#footer {
    clear: both;
    width: 100%;
    margin: 0;
    padding: 0;
}
What’s important here is the use of max-width (instead of width for an adaptive layout). It’s this property that enables us to create this smooth transition. Using a max-width, we won’t have to use as many break points as for an adaptive layout, and all the other sizes will be given in a relative unit (percentage for our example).
And the CSS for the media queries:
/* The media queries*/
@media screen and (max-width: 1000px) {
    #bar1,
    #bar2{
    width:39%;
    }
    .sidebar{
    float: left;
    margin: 0 0 20px 1%;
    padding: 0;
    }
}

@media screen and (max-width: 540px) {
    #bar1,
    #bar2{
    clear:both;
    width:100%;
    }
    .sidebar{
    float: left;
    margin: 0 0 20px 1%;
    padding: 0;
    }
    #content {
    clear:both;
    width:100%;
    }
    #content .bloc {
    margin:0;
    }
}
All the other size will be once again given in percentage, relative to the max-width of our body.
Note that for screen size under 540px, we once again gave the sidebars and the content a 100% width, and place the sidebars under the content using some clear: both.
The advantage of the responsive layout is that you won’t have to use too many break points. Since the size are given in percentage, they will adapt automatically, so the major role of the break points will be to be place where design breaks, to re-order our layout (putting sidebars under content in our example) and give the user a more pleasant reading.
Fore Fathers Group

Responsive

Media Queries: Create and Define Break Points

Media queries where introduced in the CSS3 specifications. Put in a simple way, media queries enables the web designer to create conditionals stylesheets based on width, height, but also orientation, color, etc. There’s a huge list of media queries available on the official w3c website but we will only use some of them in our case. Here is a list of the most commonly used media queries and what they do :

Media Query Utilisation

Media Query Use
min-width: … px Used when the viewport’s width is bigger or equal to width
max-width: … px Used when the viewport’s width is smaller or equal to width
min-device-width: … px Used when the device’s width is bigger or equal to width
max-device-width: … px Used when the device’s width is smaller or equal to width
orientation : portrait // orientation: landscape Target orientation
-webkit-min-device-pixel-ratio : 1.5 Used to target high density device on android and ios
As for print style sheets, media queries can be used as external or internal styles sheets. An external style sheet is easier to organize, it is not downloaded by browsers which don’t support it, but it uses extra http request. An internal style sheet on the other hand does not require extra http request, but the whole stylesheet is downloaded for browsers even if they do not support media queries, and it can be harder to organize. Both have then pro and cons, you’ll have.
You already saw the internal syntax in the example above:
body {
    background: gray;
}
@media all and (max-width:500px) {
body {
        background: blue;
    }
}
And here is the external syntaxes:
<link rel="stylesheet" type="text/CSS"  media="screen and (max-device-width: 480px) " href="mobile.CSS" />

Some "tricks" Worth Knowing About Media Queries

Cascade Matters

Yeah that’s right, as for any peace of CSS code, cascade matters.
Consider the following example:
#container{
background:rgba(111, 78, 152, 0.9); /*violet */
color:rgb(1, 1, 1);

@media all and (min-width:500px) {
    #container{
    background: rgba(255, 0, 0, 0.9); /* red */
    color: white;
    }
}
@media all and (min-width:700px) {
   #container{
    background: rgba(0, 0, 255,0.9); /*blue */
    font-family: serif;
    }
}
See the example on jsfiddle.
If the width of our browser is bigger than 500px, the color of the text gets white, and the background red. If we enlarge the screen up to more than 700px, the background gets blue, but the color of the text stays white because it inherited the color of the min-width:500px media query applied before (700 being, well, bigger than 500).

Creating Stacked Media Queries

Consider the following example :
#container{
    background:rgba(111, 78, 152, 0.9); /*violet */
    padding:10px 5px;
    color:rgb(1, 1, 1);
}

@media all and (min-width:500px) and (max-width:699px) {
   #container{
   background: rgba(255, 0, 0, 0.9); /* rouge */
   font-family: serif;
   }
}
@media all and (min-width:700px) {
   #container{
   background: rgba(0, 0, 255,0.9); /*bleu */
   color: white;
   font-family: serif;
   }
}
See the example on jsfiddle.
The first media query will only be applied for screen between 500px and 699px, and the second for screen bigger than 700px. In the case of stacked media queries, since property is only applied for a certain width, they are not herited. In our example, if we also want to apply a serif font the layout bigger than 700px, we will have to repeat this property.
You’ll need a viewport meta tag to make the media queries work. The viewport meta tag enables you to take control of the viewport of the device. Basically, if no viewport is set, mobile device will try to fit the whole page on the screen, resulting in very small websites.
The viewport meta tag looks like this:
<meta name="viewport"  content="initial-scale=1, width=device-width">
We basically tell the device, that we will be using the device width as the width of our page, and that there will be no zooming on the page when we first launch it.

It’s Not Only About the Mobile!

In my examples, I showed some media queries used for mobile optimization, tablets and smaller screens. But I wanted as a conclusion, to emphasize the fact that media queries are not only about mobile optimization. We tend to see more and more mobile device, but also more and bigger screens.
We know have an xbox that can connect to internet, some of the box our internet providers provide us are equipped with a browser, and even some television are able to connect to internet. Maybe tomorrow you will get a web browser on your fridge, who knows. If we use responsive webdesign to optimize for smaller screens, we can also use them to optimize for bigger ones.
Let's remember: responsive webdesign is about adapting layout to the user's browser size, orientation, whatever that size might be!

Some Useful Resources:

Conclusion

As you can see, responsive webdesign is not that hard to use and enables web designers to create nice layouts that will adapt to many devices and screen sizes. Your now it’s your turn: did you ever used responsive design? In what kind of projects? Do you have some advice and special tips? How do you define your break points? Let us know in the comments.
read more

Extremely Helpful Free Starter Kits For Web Designers

"Every designer needs a starter kit containing useful tools and resources. Designer’s starter kits are extremely helpful in creating mock-ups for the future projects and are a great time-saver. The elements of these starter kits can vary from buttons to check-boxes and from tabs to dropdown menu.
Here, we have collected some cool starter kits that every web designer must have. These kits are free to download and customize. We hope you like this collection and find it useful for you. Enjoy!
Showcase Gallery
Showcase Gallery is the perfect starting place for a sleek gallery website or to display your portfolio work. This download includes a well organized PSD file.

Apple Style Navigation Menu
Clean ready to use Web navigation menu. The used font is Lucida Sans. Menu comes in three flavors!

iUnits
iUnits is a PSD containing icon designs for the Apple iPhone, iPad, and Nano. Each icon is fully layered and customizable.

Free psd Calendar mockup
Simple, clean calendar mockup. The download contains a layered PSD resource file. The used font is Lucida Sans.

Big Block UI
Big Block UI is a fresh take on common user interface elements. The PSD is well organized and colors can easily be changed.

Free PSD Progress Tracker Bars
This set contains 5 Progress Tracker Bars.

Simple UI Elements
Simple UI Elements is a clean, well organized PSD file containing common user interface elements for web and app designs.

Small Blue UI Kit
A small ui kit, made in blue color. Here you have a limit selector, toggle, buttons, loading bar.

Sleek UI Elements
Whether you’re creating a website or mobile app, well designed UI elements are key to a good user experience. This PSD contains a number of useful elements in a modern, sleek style.

Dark Clean Forms Collection
Beautifully designed Dark Clean Forms Collection.

Black UI Kit
Up for grabs is a free PSD UI kit designed by Alex Patrascu. The file is fully layered and very well organized to make it easy to work with. Alex did a fantastic job of including a lot of the common elements needed when designing a website or app.

Simple To-Do List
Here is a simple to-do list with a nice clean design and is easily editable.

PSD Layout for Flash / JavaScript Gallery
Ready to use design for Flash or Javascript Gallery. Replace the text, place your own graphics and enjoy.

Free PSD Media Player
The psd file contains media player elements in 3 different flavors.

TRAK
Provides a set of shapes (stereotypes) and connectors to enable architecture description views to be produced using the open source TRAK enterprise architecture framework.

3 Different Styles of Notification Boxes
This set contains 3 Different Styles of Notification Boxes.

Functional Buttons
Ready to use free set of functional buttons. Colors are easy to adjust using Adobe Photoshop.

Slider Boxes
This set contains three web 2.0 styled slider boxes.

Mac OS X Interface 2
Leopardy interface stencil kit. This one makes extensive use of tables, for maximum flexibility while maintaining pixel precision.

6 Free Preview Slider Templates
This set contains 6 Free Preview Slider Templates

3 Shadow Pockets
This set conttains 3 beautifully designed Shadow Pockets.

Free PSD Menu Template
It’s modern, clean and aesthetically pleasing. I wanted to put my spin on it. Something quick, easy yet elegant and fun. Hopefully you can use for a possible business project or client.

Wireframe Magnets
This DIY magnet template is based on the Konigi wireframe stencils and includes 3 sheets of elements that might be useful in whiteboard prototyping.

Free PSD Share Button Kit
This is “Tell yoru Friends” Bar for your webpage. 3 different style. Dark and light background, dark and light Bar, Fully editable PSD layers with Shapes-Text-Mask. Fully Scalable.

Lion UI Kit
Lion UI Kit is a handy PSD mockup tool with fully layered and editable elements from the latest OS X operating system.

Interactive Sketching Notation 1.1
The latest Interactive Sketching Notation (version 1.1) stencil for OmniGraffle.

Blaubarry UI Kit
Blaubarry UI Kit is a PSD full of useful buttons, sliders, scrollbars, and form elements. The file makes use of shape layers for easy editing and resizing.

Solid UI Kit
Solid UI Kit is a fresh design created by Alvin Thong from Sixbase. The download includes a well organized, easily editable PSD file.

Eclipse GUI Design
Widgets for Eclipse and Mac OS X

Watchguard
This is another Visio stencil converted to .gstencil. This includes several Watchguard security appliance/firewall objects.

Web Sketch Cursors
CSS3 Compliant cursors in a “sketch” style, for mocking up web UX designs. Includes: default, crosshair, pointer, move, text, wait, help, progress, not allowed, vertical text, and several resize arrows.

Minimalistic UI kit the color Google
Do you like google plus? Maybe for his services? Maybe for its interface? And maybe even for something?

GMUI_SlixUI
“Slix UI” controls is a set made to make Web & App designers’ lives much easier. It was mainly designed to be used in Apps, but it can just as easily be used in the web . It gives you ready to use solutions for huge part of the most stuff you need to build an interface.

Simple UI element pack
Simple UI element pack, free for use! enjoy!

Wireframe Magnets
This DIY magnet template is based on the Konigi wireframe stencils and includes 3 sheets of elements that might be useful in whiteboard prototyping. Simply download and print the PDFs onto magnet sheets, optionally laminate them if you intend to use with dry-erase markers, and finally cut them out.

Facebook Applications
A pretty sizable collection of Facebook related elements to use in creating wireframes for Facebook applications.

"
read more

Useful iPad Apps for Web Designers

"
iPad enables the potential for web designers to accomplish their task and project on time because it is a portable workstation that allows designers to work on the dot. iPad is packed with thousands of creative apps that can enhance and assist designers on their project.
We are going to take a look at iPad applications that really come in handy for web designers.

The Web Designer’s Idea App


The Web Designer's Idea app
This powerful reference tool includes more than 1350 website designs arranged thematically so you can easily find inspiration for your own design work.

Dribbblr


Dribbblr app
Browse the latest work of famous designers worldwide and never miss a shot again. You don’t need to have an Dribbble account to use Dribbblr but if you provide a username, the App will show you latest shots by designers you follow.

CSS3Machine


CSS3Machine app
CSS3Machine makes the most advanced CSS3 styles simple to implement and fun to experiment with. Easily create stunning gradients, drop-shadows, and 2D- and 3D-transforms. CSS3Machine even builds WebKit animations in seconds!

Web Design 205: Designing CSS Floating Layouts


Web Design 205: Designing CSS Floating Layouts app
Have you wondered ever how to build floating layouts using only elements and CSS? If so, this tutorial, Designing CSS Floating Layouts vanquishes the mystery and headache by showing you how to build fantastic floats from the ground up.

iMockups for iPad


iMockups for iPad app
iMockups for iPad is the premiere mobile wireframing and mockup app for your web, iPhone and iPad projects. The ease and mobility of an iPad app with the power of a desktop app at your fingertips.

Gusto


Gusto app
Gusto was created to embrace the workflow of web development on the iPad. Quickly identify your project with a beautifully generated thumbnail of your website. Open your project and download multiple files and folders at a time from your FTP or SFTP server.

App Cooker


App Cooker
App Cooker supports you through the 5 key aspects of planning any mobile application: the idea, the mockups, the app icon, the communication and the business model. Each of these areas has its own dedicated section on the “App Board”, the focused workplace where each project can be defined quickly then refined gradually. Whether you are a seasoned developer or yet to make an app, App Cooker’s powerful processes and clear and intuitive user interface will allow you to get productive immediately, forming the backbone of any application development project.

SketchBook Pro for iPad


SketchBook Pro for iPad app
Autodesk SketchBook Pro for iPad is a professional-grade paint and drawing application. Whether you are an occasional doodler or a professional illustrator, SketchBook Pro transforms your iPad into the ultimate digital SketchBook.

SketchPad HD


SketchPad HD app
SketchPad is a fun, easy to use drawing and note taking application for the iPad. SketchPad allows you to draw in a variety of colors, collect and browse through notes and share notes that you create on the iPad over email.

Adobe Photoshop Express


Adobe Photoshop Express app
Adobe Photoshop Express software lets you use simple gestures to quickly edit and share photos from your mobile device. Enjoy having your photo and video library right in your hand — without wasting your device’s valuable storage space.

Adobe Ideas


Adobe Ideas app
Adobe Ideas is your digital sketchbook, letting you capture and explore ideas anywhere you go. Sketch design concepts while sitting in a cafe, capture and store color themes while browsing through the photos on your phone, or jot down notes on a photo. Any time you need to explore creative ideas, Adobe Ideas is there with you.

Font Book for iPad


Font Book for iPad app
A great app to see what your creative headlines or body copy will look like in different fonts.

Typography Insight


Typography Insight app
Typography Insight is an iPad application which introduces new ways of learning and teaching typefaces. It leverages iPad’s touch interface and high resolution display to visualize and to manipulate typeface. With Type Insight, you can easily experiment and inspect the detail shapes of historical typefaces.

Ampersands


Ampersands app
This app is quite simply a celebration of the innate beauty of the humble ampersand. Used by millions of us every day, this ligature of the letters et [Latin for "and"] can now be shown off in all its glory thanks to the iPad’s superb display quality.

Web Design and Usability Guidelines


Web Design and Usability Guidelines app
Web Design and Usability Guidelines is your guide for developing usable and useful Web sites. The guidelines were developed to assist Web managers, designers, usability specialists, and others create Web sites that are highly responsive, easy-to-use, and useful. This app brings these best practices and guidelines to you.

Source Viewer XL


Source Viewer XL app
Whether you are a web designer or just curious – this application is for you. Source Viewer shows the HTML, CSS and Javascript source code of any website.

FTP On The Go PRO


FTP On The Go PRO app
An FTP client for the iPad, iPhone, and iPod touch. View and edit HTML/CSS/JS/PHP/ASP, or other files on your server with its built in editor to change your website from anywhere. View images and documents (JPG, PDF, DOC, XLS, PPT, etc) too.

Dropbox


Dropbox app
Dropbox is a free service that lets you bring all your photos, docs, and videos anywhere. With the Dropbox app, you can take everything that matters to you on the go.

Keynote


Keynote app
Exclusively designed for the iPad, iPhone, and iPod touch, Keynote makes creating a world-class presentation — complete with animated charts and transitions — as simple as touching and tapping.

iPDF Reader Free


iPDF Reader Free app
iPDF Reader is the world’s slimmest eBook and PDF reader, now available for the iPad.

WordPress


WordPress app
It’s easy to manage your WordPress blog or site from your iOS device. With WordPress for iOS, you can moderate comments, create or edit posts and pages, and add images or videos with ease.

Things for iPad


Things for iPad app
Things is a beautifully focused and amazingly intuitive task manager. Effortlessly manage to-dos, notes, due dates, and projects. A smart today list and the scheduling feature allow you to work as effectively as possible – every day.

Web Designer Magazine


Web Designer Magazine app
Web Designer is the premier magazine for aspiring online creatives and industry professionals. The monthly title offers cutting-edge practical projects spanning XHTML, CSS, Flash and WordPress as well as hosting features and interviews with the web community’s most influential people.

Computer Arts


Computer Arts app
Computer Arts, the Italian magazine dedicated to digital design and computer graphics, is now available as an iPad App. Read our tutorials on Photoshop, InDesign, Flash, Illustrator and many more, discover our features about the world of design you love and how you can make money with your skills, and learn how the professionals create their masterpieces.

Phaidon Design Classics iPad Edition


Phaidon Design Classics iPad Edition app
The application offers, at the touch of a finger, access to an encyclopedic, illustrated history of 1,000 timeless design classics by not only renowned designers, such as Marcel Breuer, Achille Castiglioni, Le Corbusier, Jasper Morrison, Dieter Rams, Eero Saarinen, and Philippe Starck but also anonymously designed pieces, such as the clothes peg, the corkscrew, and the chopstick, that have stood the test of time.
"
read more