-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
72 lines (70 loc) · 2.49 KB
/
index.html
File metadata and controls
72 lines (70 loc) · 2.49 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Assignment 5</title>
<link rel="icon" href="./resources/favicon.svg" type="image/svg+xml">
</head>
<body style="background-color:#abd8ff;">
<img src="./resources/banner.svg" alt="A partly sunny mountain-scape." height="300px" width="100%"/>
<nav class="menu">
<ul>
<li>
<a href="./index.html">HOME</a>
<a href="./views/two.html">PAGE 2</a>
<a href="./views/three.html">PAGE 3</a>
</li>
</ul>
</nav>
<h1>Assignment 5</h1>
<h2 class="css-question">How to Apply CSS to HTML</h2>
<p class="css-question">
It is a best practice to link to external Cascading Style Sheets (CSS) rather
than styling a page directly from the HTML document.
To acheive this, we create a <code>.css</code> file and link to it at the top of our
html document.
<h3>Example:</h3>
<pre>
<code>
<head>
<link rel="stylesheet" href="styles.css"></link>
</head>
</code>
</pre>
It is also possible to use css directly within an HTML document.
To do this we include the css code in inside an html tag.
<h3>Inline CSS Example</h3>
<pre>
<code>
<p style="color:red;" >
This paragraph will be red.
</p>
</code>
</pre>
</p>
<h2 class="js-question">How to Use JavaScript in a Webpage</h2>
<p class="js-question">
To link an external javascript file, we simply create a <code>.js</code> file and link
to it.
<h3> External Linkage Example</h3>
<pre>
<code>
<head>
<script src="script.js"></script>
</head>
</code>
</pre>
It is also possible to use javascript directly within an HTML document.
To do this we include the javascript code in a <code><script></code> tag.
<h3> Internal Scripting Example</h3>
<pre>
<code>
<script>
console.log("This script runs from within the HTML document!");
</script>
</code>
</pre>
</p>
</body>
</html>