42
@iamdangavin | [email protected] | www.iamdangav.in Responsive Web Design Hello This is a presentation on Responsive Web Design

Responsive Web Design & WordPress

Embed Size (px)

DESCRIPTION

How to become responsive. We will go over the various methods & styles used to make your site responsive. We will discuss CSS media queries, FitText.js, FitVid.js and responsive slideshows.

Citation preview

Page 12: Responsive Web Design & WordPress

@iamdangavin | [email protected] | www.iamdangav.in

Hello Responsive Web Design

What it really takes to be responsive.

• Adaptive Grid System

• Scalable Images / Video

• Media Queries

• Organization

• Crying

Page 20: Responsive Web Design & WordPress

@iamdangavin | [email protected] | www.iamdangav.in

Hello Responsive Web Design

What it really takes to be responsive.

• Adaptive Grid System - ✓

• Scalable Images / Video

• Media Queries

• Organization

• Crying

Page 23: Responsive Web Design & WordPress

@iamdangavin | [email protected] | www.iamdangav.in

Responsive Web DesignHello

The toughest challenge in implementing the responsive bits was fluid media. A lot of trial and error went into finding the right CSS solution, but what’s cool is we’ve been able to apply it to many more themes that we maintain on wordpress.com

- Lance Willett

simpledream.net/about

Page 24: Responsive Web Design & WordPress

@iamdangavin | [email protected]

Hello

/* Images */.entry-content img,.comment-content img,.widget img{ max-width: 97.5%; /* Fluid images for posts, comments, and widgets */}img[class*=”align”],img[class*=”wp-image-”]{ height: auto; /* Make sure images with WordPress-added height and width attributes are scaled correctly */}img.size-full{ max-width: 97.5%; width: auto; /* Prevent stretching of full-size images with height and width attributes in IE8 */}

Page 27: Responsive Web Design & WordPress

Hello

@iamdangavin | [email protected]

/* Media / Videos */object,embed,iframe{ max-width: 100%; /* Make sure embeds fit their containers */}

Page 28: Responsive Web Design & WordPress

Hello

@iamdangavin | [email protected]

<script src=”path/to/jquery.min.js”></script><script src=”path/to/jquery.fitvids.js”></script>

<script> jQuery(document).ready(function(){ // Target your .container, .wrapper, .post, etc. jQuery(“#thing-with-videos”).fitVids(); });</script>

FitVid.jsA lightweight, easy-to-use jQuery plugin for fluid width video embeds.

Supports: YouTube, Vimeo, Blip.tv, Viddler, Kickstarter* Add your own video vendors

Fitvid.js

Page 29: Responsive Web Design & WordPress

@iamdangavin | [email protected] | www.iamdangav.in

Hello Responsive Web Design

What it really takes to be responsive.

• Adaptive Grid System - ✓

• Scalable Images / Video - ✓

• Media Queries

• Organization

• Crying

Page 31: Responsive Web Design & WordPress

Hello

@iamdangavin | [email protected]

@media

/* Media = Smallerscreens */@media only screen and (max-width: 1023px){

.your-style-here{ }}/* Media = iPad / Orientation: Landscape */@media only screen and (min-width: 481px) and (max-width: 1024px) and (orientation: landscape){

.your-style-here{ }}/* Media = iPad / Orientation: Portrait */@media only screen and (min-width: 481px) and (max-width: 1024px) and (orientation: portrait){

.your-style-here{ }}/* Media = Mobile / iPhone Orientation: Landscape */@media handheld, only screen and (max-width: 480px) and (orientation: landscape){

.your-style-here{ }}/* Media = Mobile / Orientation: Portrait */@media handheld, only screen and (max-width: 480px) and (orientation: portrait){

.your-style-here{ }}/* Media = Mobile / All others */@media handheld, only screen and (max-width: 767px){

.your-style-here{ }}

Page 32: Responsive Web Design & WordPress

@iamdangavin | [email protected] | www.iamdangav.in

Hello Responsive Web Design

CSS3 Media Queries

css3-mediaqueries.js is a JavaScript library to make IE 5+, Firefox 1+ and Safari 2 transparently parse, test and apply CSS3 Media Queries. Firefox 3.5+, Opera 7+,

Safari 3+ and Chrome already offer native support.

code.google.com/p/css3-mediaqueries-js/

Page 35: Responsive Web Design & WordPress

@iamdangavin | [email protected] | www.iamdangav.in

Hello Responsive Web Design

What it really takes to be responsive.

• Adaptive Grid System - ✓

• Scalable Images / Video - ✓

• Media Queries - ✓

• Organization

• Crying

Page 36: Responsive Web Design & WordPress

Hello

@iamdangavin | [email protected]

Organization

/* Media = iPhone*/<link rel="stylesheet" type="text/css" media="screen and (max-device-width: 480px)" href="mobile.css" />

/* Media = iPad*/<link rel="stylesheet" type="text/css" media="screen and (max-device-width: 1024px)" href="tablet.css" />

/* Media = Core*/<link rel="stylesheet" type="text/css" media="screen" href="style.css" />

Page 37: Responsive Web Design & WordPress

@iamdangavin | [email protected] | www.iamdangav.in

Hello Responsive Web Design

What it really takes to be responsive.

• Adaptive Grid System - ✓

• Scalable Images / Video - ✓

• Media Queries - ✓

• Organization - ✓

• Crying

Page 40: Responsive Web Design & WordPress

@iamdangavin | [email protected] | www.iamdangav.in

Hello Responsive Web Design

What it really takes to be responsive.

• Adaptive Grid System - ✓

• Scalable Images / Video - ✓

• Media Queries - ✓

• Organization - ✓

• Crying - ✓