REFRESH LOUISVILLE
April 20, 2010
One Source to Rule
Them All.
OR
How to use media queries to
optimize the same markup
for different devices
and features.
The League of Moveable Type
/>Reference
EVERY WEB DESIGNER’S QUESTION
How much should I
charge per hour?
EVERY WEB DESIGNER’S ANSWER
Let’s build an app.
1
Build for mobile first.
SKETCH
Start building
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Rate Calculator</title>
<!
iPhone specific details:
/>index.html
>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<link rel="apple-touch-icon-precomposed" href="_images/touch-icon.png" />
<! Base stylesheet for all devices >
<link rel="stylesheet" href="_css/base.css" media="handheld, all" />
</head>
<body>
</body>
</html>
index.php
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Rate Calculator</title>
<!
iPhone specific details:
/>index.html
>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<link rel="apple-touch-icon-precomposed" href="_images/touch-icon.png" />
<! Base stylesheet for all devices >
<link rel="stylesheet" href="_css/base.css" media="handheld, all" />
</head>
<body>
</body>
</html>
index.php
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Rate Calculator</title>
<!
iPhone specific details:
/>index.html
>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<link rel="apple-touch-icon-precomposed" href="_images/touch-icon.png" />
<! Base stylesheet for all devices >
<link rel="stylesheet" href="_css/base.css" media="handheld, all" />
</head>
<body>
</body>
</html>
index.php
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Rate Calculator</title>
<!
iPhone specific details:
/>index.html
>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<link rel="apple-touch-icon-precomposed" href="_images/touch-icon.png" />
<! Base stylesheet for all devices >
<link rel="stylesheet" href="_css/base.css" media="handheld, all" />
</head>
<body>
</body>
</html>
index.php
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Rate Calculator</title>
<!
iPhone specific details:
/>index.html
>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<link rel="apple-touch-icon-precomposed" href="_images/touch-icon.png" />
<! Base stylesheet for all devices >
<link rel="stylesheet" href="_css/base.css" media="handheld, all" />
</head>
<body>
</body>
</html>
index.php
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Rate Calculator</title>
<!
iPhone specific details:
/>index.html
>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<link rel="apple-touch-icon-precomposed" href="_images/touch-icon.png" />
<! Base stylesheet for all devices >
<link rel="stylesheet" href="_css/base.css" media="handheld, all" />
</head>
<body>
</body>
</html>
index.php
Rate Calculator
/>Reference
2
Media queries = neat.
Types & Features
Media: