Girl Develop It is here to provide affordable and accessible programs to learn software through mentorship and hands-on instruction.
Some "rules"
The mobile web is (really) big.
Solutions?
Rather than tailoring disconnected designs to each of an ever-increasing number of web devices, we can treat them as facets of the same experience.
Ethan Marcotte, "Responsive Web Design"
Design by thinking of the structure of your website, and how different elements fit into the structure.
Desktop View
Tablet View
Mobile View
Examples:
Fluid Grids
div.sidebar {width: 320px;}
) prevent resizing content for different browsers.em
or %
to allow flexibility.div.sidebar {width: 30%;}
max-width
or min-width
to add limits where needed.Flexible Images
img {width: 600px}
makes all images exactly 600px wideimg {max-width: 600px}
makes all images no more than 600pximg {max-width: 100%}
makes images fit inside their containers"viewport" meta tag
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0">
Tells mobile browsers to use the actual size of the device instead of emulating a desktop browser.
A media type and at least one expression that limits the style sheets' scope by using media features, such as width, height, and color
background-color: grey;
@media screen and (min-width: 300px) and (max-width: 600px)
{
background-color: red;
}
@media screen and (min-width: 900px) and (max-width: 1200px)
{
background-color: blue;
}
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0">
Frequently used in responsive web design
Most of our styling will stay the same
Colors, padding, etc.
Only change what needs to for each view
Tablet example
/** Tablet view **/
@media screen and (max-width: 960px){
h1 {
font-size: 1.1em;
line-height: 40px;
}
header nav li{
line-height: 40px;
}
}
In tablet view, we don't need the header to be so big
Mobile example
/** Mobile view **/
@media screen and (max-width: 480px){
#famous article.woman {
float: none;
margin: 5px auto;
padding: 2%;
width: 80%
}
}
In mobile view, we don't want the bios to float
Enhance our Women in Computing web site to use HTML5 & CSS3
Remember that HTML5 is still new
That means we have to be aware of what each browser can do
And make sure that people don't lose functionality
HTML5 IE enabling script