- index.html
- style.css
HTML
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Connecting external scripts</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1>External scripts</h1>
<p>External scripts, like external styles, are used much more often than inline scripts.</p>
<p>It's easier to make changes to them, especially when the same script is connected to a large number of pages.</p>
<p>And external resources are also cached by the browser, making pages load faster. And in the web, that's important.</p>
<!-- connect an external script here -->
</body>
</html>
CSS
body {
margin: 20px;
font-size: 18px;
line-height: 24px;
}
h1 {
font-size: 52px;
line-height: 64px;
font-family: "Monaco", "Courier", monospace;
color: #618ad2;
transition: color 0.5s;
}
You have moved to another page
GoalsCompleted
0
Connect an external script to the page. To do this:
- Before the closing
</body>
tag, insert the<script></script>
tag., - then add a
src
attribute to it with the valueexternal.js
.