L04. Intro to HTML
CSCI 344: Advanced Web Technologies
Spring 2025
1
Announcements
2
Resume discussion of Net Neutrality & Content Moderation (10 minutes)
3
Outline
4
Outline
5
Most web pages use three technologies
HTML
CSS (Cascading Style Sheets)
JavaScript
6
Outline
7
Install and Configure VS Code
8
Install and Configure Node
9
Side Note: Organizing Files
Now that you’re taking a computer science class, it’s important to think about where you’re storing your files. Please do the following EXACTLY as specified:
10
Side Note: Organizing Files
When you’re done, your file structure should look something like this:
csci344
├── tutorials
└── lectures
└── lecture04
└── index.html <-- file you will make today
11
Create an HTML file in VS Code
12
Outline
13
Intro to HTML (Hypertext Markup Language)
HTML is a way of creating web documents using “markup tags”
How the Browser Interprets HTML
HTML File
Invisible section
(for metadata)
<html lang="en">�<head>� <title>DOM Example</title>� <meta name="author" content="Sarah V.">� <link rel="stylesheet" href="main.css">�</head>��<body>� <main>� <h1>Hello!</h1>� <p>Welcome to this webpage.</p>� </main>�</body>�</html>
<html>
<title>
<head>
<body>
<link>
<main>
<h1>
<p>
Hello!
Welcome to this webpage.
<meta>
Visible section
(99% of your stuff goes here)
Lots of elements can go inside of the body element
16
Body
<body>
</body>
Image�<img src="??" />
Embedded Video
<iframe src="??"></iframe>
Hyperlink
<a href=”??”>my link</a>
Containers
<div></div>
<span></span>
<nav></nav>
<article></article>
<header></header>
<section></section>
<footer></footer>
Table
<table>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
</tr>
<tr>
<td>Cell 3</td>
<td>Cell 4</td>
</tr>
</table>
Outline
17
1. Avoid spaces, capital letters, and special characters when naming files
When creating new HTML files, it is important to follow the naming conventions listed below:
18
2. Most tags have an opening tag and a closing tag
<h1>My Heading</h1>
But some don’t:
�You’ll eventually figure out the rules as you continue building web pages. You can also consult the HTML Reference to learn more about the rules of each individual tag.
19
3. The browser ignores whitespace
The browser ignores whitespace:��<h1>My Title</h1>�
...is interpreted the same way as...�
<h1> My
Title
</h1>
20
4. Make your code readable by indenting and using line breaks
Make your code readable by indenting and using line breaks. Please don’t do this:��<main><p>Welcome, <strong>Leonard</strong></p><ol><li>item 1</li><li>item2</li><li>item 3</li>�</ol></main>
4. Make your code readable by indenting and using line breaks
Instead, do this:��<main>� <p>� Welcome, <strong>Leonard</strong>� </p>� <ol>� <li>item 1</li>� <li>item 2</li>� <li>item 3</li>� </ol>�</main>
5. Attribute syntax
Many tags have required or optional attributes (e.g. a tags, img tags, input tags, etc).
Ensure that your attributes are always followed by an equals sign and values are surrounded by quotation marks.
Example: �<img src="my_image.jpg" alt="description of image for screen reader" />
23
No space between attribute, equals sign, and quotations
6. Last in, first out (LIFO)
Correct��<p>Welcome, � <strong>Leonard</strong>�</p>��
Incorrect��<p>Welcome, � <strong>Leonard</p>�</strong>
24
<p> Welcome
</p>
<strong>
Leonard
</strong>
Think boxes inside of boxes inside of boxes
7. Use comments to help you understand your code
<!-- Welcome Section -->�<section>� <p>� Welcome, <strong>Leonard</strong>� </p>� <ol>� <li>item 1</li>� <li>item 2</li>� </ol>�</section>
Outline
26
Linking to Resources
Linking is perhaps the biggest idea of the web: documents link together creating a “web” of networked resources.
Many different HTML tags use the concept of linking:
27
Linking to Resources
Absolute links
Relative links
Internal links
28
Outline
29
Please see the�Activity 4 Instructions
30