-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
362 lines (310 loc) · 13 KB
/
Copy pathindex.html
File metadata and controls
362 lines (310 loc) · 13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Make your first website</title>
<link
href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600,700,900,200italic,300italic,600italic,700italic,900italic|Source+Code+Pro:200,300,400,500,600,700,900' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/reveal.min.css">
<link rel="stylesheet" href="css/style.css" id="theme">
</head>
<body>
<div class="reveal">
<div class="slides">
<section>
<h2>Make your first website</h2>
<p> <em>
<!-- em will make the words italic -->
Brought to you by
<a href="http://codekitchen.mit.edu/">
CodeKitchen
</a>
</em>
</p>
</section>
<section>
<h2>Before we start</h2>
<p>Today we will build on the last week's workshop
<a href="http://web.mit.edu/bgolder/www/codekitchen/essentials/#/" target="_blank">
Secret Coding Essentials.
</a>
Make sure you have
<a href="http://www.sublimetext.com/2">Sublime Text</a>
or some other
<a href="http://codekitchen.mit.edu/editors/">text editor</a>
installed.
</p>
</section>
<section>
<p>In this workshop we will talk about what a website is, how to
"open it" and look inside, and how to make your own.
</p>
</section>
<section>
This is a <strong>hands on</strong> workshop. Feel free to pause me any time if something is not clear.
</section>
<section>
<h2>Part 1: What is a web page?</h2>
</section>
<section>
<section id="fragments_page">
<p>In a nutshell, it: </p>
<ul>
<li class="fragment">is a set of files that your browser (Chrome/Safari/Firefox/etc) downloads and then displays on a screen </li>
<li class="fragment">has a precise address that you type to the URL bar at the top of your browser</li>
<li class="fragment">comes from another computer (typically a server)</li>
<li class="fragment">is made out of HTML, CSS, & JavaScript
(more later on these)</li>
<li class="fragment">can be an interactive document (like Facebook)</li>
</ul>
</section>
</section>
<section>
<p>
These slides are a web page.
<a href="http://codekitchen.mit.edu/">http://codekitchen.mit.edu/
</a>
is also an example of a web page
</p>
</section>
<section>
<p>Every browser gives you the ability to see the source code of
the website. This is extremely useful for understanding and
building websites of your own.
</p>
<p>
If you are using Google Chrome on a Mac, type <code>Option+Command+U</code> to look at the web page's source code.</p>
<a href="https://blog.kissmetrics.com/how-to-read-source-code/" target="_blank">
For other OS + browsers read here. </a>
</p>
</section>
<section>
<p>Where did these files come from?
<strong>A server!</strong>
</p>
</section>
<section>
<p>In the simplest terms, a server is just another computer. But
we usually use servers for different purposes than our personal
computers. Servers are usually connected to the internet, or are
at least connected to a local network. They rarely have monitors
or GUI software so they often accessed through the command line.
</p>
</section>
<section>
<h2>Part 2: What is a web page?</h2>
</section>
<section>
<section id="fragments_site">
<p>Big Picture:</p>
<ul>
<li class="fragment">one or more webpages</li>
<li class="fragment">(sometimes) a bunch of different web pages</li>
<li class="fragment">(sometimes) a server application that generates web pages on the fly (like Facebook), which would be called a web app</li>
</ul>
</section>
</section>
<section>
<p>Let's look at a website: </p>
<ol>
<li>Download the folder from
<a href="https://www.dropbox.com/sh/9gzjdy7s43l9guz/AABHUfwevHGyD3loGBYFtoqTa?dl=1" target="_blank">
Dropbox
</a>
and save it somewhere on your computer
</li>
<li> Open the folder with your text editor (like Sublime Text)</li>
<li>Change few things and see the difference</li>
</ol>
</section>
<section>
<p>You have just seen the basic building blocks of a website. How cool :) Specifically you saw:</p>
<ol>
<li>file with <code>.html</code> extension. This file structures the content of the web page</li>
<li>file with <code>.css</code> extension. This is a special file that stores the styling information about the website</li>
<li>file with <code>.js</code> extension. This file adds interactions and logic</li>
</ol>
</section>
<section>
<h2>Ready to take a look at each 'ingredient'?</h2>
</section>
<section>
<h2>Part 3: HTML</h2>
<h3>(Hypertext Markup Language)</h3>
</section>
<section>
<p>Let's look at the
<strong>developer console</strong>. This is similar to looking at
the source code, except that instead of showing the original
code that was downloaded from the server, it shows us how the
browser sees the website <em>right at this moment</em>. The
console is powerful.
</p>
<p>
If you are using Google Chrome on a Mac, </strong>type <code>Option+Command+I</code>
</p>
</section>
<section>
<p>HTML is not really a language, it's actually a standard, a specification published by the W3C, World Wide Web Consortium. </p>
<p>Browsers voluntarily adhere to the specification or not. Sometimes they only adhere to portions of it.</p>
</section>
<section>
<p>The W3C negotiates the specifications for the web, including HTML, CSS (<code>.css</code> file you saw in the example), and Javascript (<code>.js</code> file you saw). Browsers have to implement support for any changes to the specification.</p>
</section>
<section>
<p>Google Chrome, Mozilla Firefox, and Apple's Safari adhere to the vast majority of the most recent HTML specification (currently HTML5). </p>
<p> Microsoft's Internet Explorer is notorious for ignoring the standards set by W3C.</p>
<p> There is never 100% compliance. Many parts are hotly debated.</p>
</section>
<section>
<h3>Wait, wait! Did you just say "HTML5"? What's that about?</h3>
<p>HTML5 & HTML4 are just editions of the standard. Similar to International Building Code 1999 vs IBC 2001</p>
<p>We are writing HTML5 because that is the most recent spec. There are very few differences. We aren't using any of the obscure features that browsers aren't ready to support.</p>
</section>
<section>
<h3>Enough about standards, let's cook actual HTML!</h3>
</section>
<section>
<p>HTML is a tree with nodes, where each node has:</p>
<ol>
<li class="reveal"><em>opening and closing pointy brackets</em></li>
</ol>
<p class="reveal"> <code> <em><</em>a href=”http://dusp.mit.edu”<em>></em>link to DUSP<em></</em>a<em>></em></code>
</p>
</section>
<section>
<ol start="2">
<li class="reveal"><em>tag name (or node type)</em></li>
</ol>
<p class="reveal"> <code><<em>a</em> href=”http://dusp.mit.edu”>link to DUSP</<em>a</em>></code>
</section>
<section>
<ol start="3">
<li class="reveal"><em>contents</em>
<p>this is what you see. It can hold other HTML tags as well</p>
</li>
</ol>
<p class="reveal"><code> <a href="http://dusp.mit.edu"><em>link to DUSP</em></a></code></p>
</section>
<section>
<ol start="4">
<li class="reveal"><em>attributes</em>
<p>in the format <code>attributename="value"</code></p>
</li>
</ol>
<p class="reveal"><code> <a <em>href="http://dusp.mit.edu"</em>>link to DUSP</a></code></p>
</section>
<section>
<p>There are only a small set of commonly used tags.</p>
<pre>body div p span a
header navigation
ul ol li
link script
img
em strong
form input
</pre>
<p>You can memorize most of them, but you can look them up any time. They are well documented.</p>
</section>
<section>
<h3>Curious for more tags?</h3>
<p>
<a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element" target="_blank">
Here
</a>
is an up-to-date list of all the HTML tags (tags are also sometimes called elements).</p>
</section>
<section>
<h2>Part 4: CSS</h2>
<h3>aka Cascading Style Sheets</h3>
<p>which cascade like waterfalls of styling rules</p>
</section>
<section>
CSS has a simple, consistent syntax:
<pre>selector {
setting: value;
}
</pre>
</section>
<section>
Here are some common CSS selectors:
<p>
Select via tag names
</p>
<pre>
img {
width: 100%;
}
</pre>
</section>
<section>
<p>
Select using a "class" attribute
</p>
</ol>
<pre>.options {
list-style-type: none;
}
</pre>
</section>
<section>
<p>
Select using the "id" attribute
</p>
<pre>#container {
width: 32rem;
}
</pre>
</section>
<section>
<p>
CSS can get complicated quite fast. Especially if you want a fancy layout. It is not intuitive. But colors and fonts are easy! :)
</p>
<img src="img/css.gif" alt="">
</section>
<section>
<a href="http://flukeout.github.io/" target="_blank">
Here
</a>
is a great tutorial on CSS selectors
</section>
<section>
More on colors: you can enter colors in a number of ways
<pre>
color: orange; // Color assigned by name
color: #0f0; // 3 digit hex
color: #00ff00; // 6 digit hex
// color defined using RGB and "alpha" values
color: rgba( 34, 12, 64, 0.3);
</pre>
</section>
<section>
<p>There are special units</p>
<code> px, em, rem </code>
</section>
<section>
<h2>Part 5: Go Live</h2>
</section>
<section>
<code>ssh</code> into your athena account and navigate to your <code>www</code> folder and deploy our example site there.
<p>
Forgot how?
<a href="https://gist.github.com/bengolder/7997954">Checkout</a> my basic command line tutorial
</p>
</section>
<section>
Any questions?
</section>
</div>
</div>
<script src="js/head.min.js"></script>
<script src="js/reveal.min.js"></script>
<script>
// Required, even if empty.
Reveal.initialize({
history: true,
transition: 'none',
});
</script>
</body>
</html>