Skip to content

Commit 94684ec

Browse files
committed
responsive web design
1 parent 7a086dd commit 94684ec

38 files changed

+992
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<!DOCTYPE html>
2+
<html lang="de">
3+
<head>
4+
<meta name="viewport" content="width=device-width, initial-scale=1" />
5+
<title>Change Font Size With Media Queries</title>
6+
<style>
7+
div.example {
8+
background-color: lightgrey;
9+
padding: 20px;
10+
}
11+
12+
@media screen and (min-width: 600px) {
13+
div.example {
14+
font-size: 80px;
15+
}
16+
}
17+
18+
@media screen and (max-width: 600px) {
19+
div.example {
20+
font-size: 30px;
21+
}
22+
}
23+
</style>
24+
</head>
25+
<body>
26+
<h2>Change the font size of an element on different screen sizes</h2>
27+
28+
<div class="example">Example DIV.</div>
29+
30+
<p>
31+
When the browser's width is 600px wide or less, set the font-size of DIV
32+
to 30px. When it is 601px or wider, set the font-size to 80px. Resize the
33+
browser window to see the effect.
34+
</p>
35+
</body>
36+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>RWD Introduction</title>
8+
<link rel="stylesheet" href="styles.css" />
9+
</head>
10+
<body>
11+
<header>
12+
<div class="header">
13+
<h1>Chania</h1>
14+
</div>
15+
</header>
16+
17+
<div class="row">
18+
<nav class="col-3 col-s-3 menu">
19+
<ul>
20+
<li>The Flight</li>
21+
<li>The City</li>
22+
<li>The Island</li>
23+
<li>The Food</li>
24+
</ul>
25+
</nav>
26+
27+
<main class="col-6 col-s-9">
28+
<h1>The City</h1>
29+
<p>
30+
Chania is the capital of the Chania region on the island of Crete. The
31+
city can be divided in two parts, the old town and the modern city.
32+
</p>
33+
</main>
34+
35+
<aside class="col-3 col-s-12">
36+
<div class="aside">
37+
<h2>What?</h2>
38+
<p>Chania is a city on the island of Crete.</p>
39+
<h2>Where?</h2>
40+
<p>Crete is a Greek island in the Mediterranean Sea.</p>
41+
<h2>How?</h2>
42+
<p>You can reach Chania airport from all over Europe.</p>
43+
</div>
44+
</aside>
45+
</div>
46+
47+
<footer class="footer">
48+
<p>
49+
Resize the browser window to see how the content respond to the
50+
resizing.
51+
</p>
52+
</footer>
53+
</body>
54+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
2+
* {
3+
box-sizing: border-box;
4+
}
5+
6+
.row::after {
7+
content: "";
8+
clear: both;
9+
display: table;
10+
}
11+
/* oben containers are together*/
12+
[class*="col-"] {
13+
float: left;
14+
padding: 15px;
15+
}
16+
17+
html {
18+
font-family: "Lucida Sans", sans-serif;
19+
}
20+
21+
.header {
22+
background-color: #9933cc;
23+
color: #ffffff;
24+
padding: 15px;
25+
}
26+
27+
.menu ul {
28+
list-style-type: none;
29+
margin: 0;
30+
padding: 0;
31+
}
32+
33+
.menu li {
34+
padding: 8px;
35+
margin-bottom: 7px;
36+
background-color: #33b5e5;
37+
color: #ffffff;
38+
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
39+
}
40+
41+
.menu li:hover {
42+
background-color: #0099cc;
43+
}
44+
45+
.aside {
46+
background-color: #33b5e5;
47+
padding: 15px;
48+
color: #ffffff;
49+
text-align: center;
50+
font-size: 14px;
51+
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
52+
}
53+
54+
.footer {
55+
background-color: #0099cc;
56+
color: #ffffff;
57+
text-align: center;
58+
font-size: 12px;
59+
padding: 15px;
60+
}
61+
62+
/* For mobile phones: */
63+
[class*="col-"] {
64+
width: 100%;
65+
}
66+
67+
@media only screen and (min-width: 600px) {
68+
/* For tablets: */
69+
.col-s-1 {width: 8.33%;}
70+
.col-s-2 {width: 16.66%;}
71+
.col-s-3 {width: 25%;}
72+
.col-s-4 {width: 33.33%;}
73+
.col-s-5 {width: 41.66%;}
74+
.col-s-6 {width: 50%;}
75+
.col-s-7 {width: 58.33%;}
76+
.col-s-8 {width: 66.66%;}
77+
.col-s-9 {width: 75%;}
78+
.col-s-10 {width: 83.33%;}
79+
.col-s-11 {width: 91.66%;}
80+
.col-s-12 {width: 100%;}
81+
}
82+
@media only screen and (min-width: 768px) {
83+
/* For desktop: */
84+
.col-1 {width: 8.33%;}
85+
.col-2 {width: 16.66%;}
86+
.col-3 {width: 25%;}
87+
.col-4 {width: 33.33%;}
88+
.col-5 {width: 41.66%;}
89+
.col-6 {width: 50%;}
90+
.col-7 {width: 58.33%;}
91+
.col-8 {width: 66.66%;}
92+
.col-9 {width: 75%;}
93+
.col-10 {width: 83.33%;}
94+
.col-11 {width: 91.66%;}
95+
.col-12 {width: 100%;}
96+
}

0 commit comments

Comments
 (0)