2. Intro to HTML
2. Intro to HTML
Prerequisites
● How to use your computer
● How to open a file in your browser
What you’ll learn
● W3C & the specification process
● HTML Syntax & Attributes
● Basic HTML tags
● Common Attributes
● HTML Nesting
● HTTP Requests
● Form HTML tags
● What Accessibility Is
● Semantic HTML
What is HTML?
Hyper
Text
Markup
Language
W3C
Status:
● Published: 2008
● Recommendation Status: Oct. 28, 2014
HTML Feature Support
What can I use now?
What level of support do browsers offer?
attribute attribute
name value
HTML Syntax
● HTML consists of
o element/tag
o attribute
o values
<a href="https://www.wyncode.co">Wyncode</a>
Boilerplate
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>My Document</title>
</head>
<body>
[Most of your code goes here]
</body>
</html>
Doctype
HTML4
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
HTML5
<!DOCTYPE HTML>
HTML Comments
<!-- This is a comment -->
Head
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>My Document</title>
</head>
<body>
[Most of your code goes here]
</body>
</html>
Title
<title>My Document</title>
<meta>
<meta name="viewport"
content="width=device-width, initial-
scale=1">
What are the attributes?
<meta name="viewport"
content="width=device-width, initial-
scale=1">
<link>
<link rel="stylesheet"
type="text/css" href="style.css">
<script>
<script src="js/application.js"></script>
Body
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>My Document</title>
</head>
<body>
[Most of your code goes here]
</body>
</html>
<a>
I'm with
<a href="https://www.wyncode.co">
Wyncode.
</a>
<a>
<img>
<img src="https://placeimg.com/640/480/any"
alt="Profile Pic" />
<div></div>
<div>
<div class=”left-panel”>
<h1>My Homepage</h1>
<p>
Welcome, I really love Bill M.
</p>
</div>
<div class=”right-panel”>
<img src=”https://placeimg.com/640/480/any”/>
</div>
<div>
Generic Containers
● <div> a logical division of the page, like a
banner, navigation bar, sidebar, or footer.
● <span> individual words and phrases (often
called inline elements) within paragraphs
<div>, <span>
<div id="main">
<p><span>Content</span> goes here</p>
</div>
Road trip: Common Attributes
<div><p><a href="#">Link</a></p></div>
Spot the bug
When elements contain other elements, each element must
be properly nested, that is, fully contained within its parent.
<div><a href="#">Link</p></a></div>
Spot the bug
When elements contain other elements, each element must
be properly nested, that is, fully contained within its parent.
<div><p><a href="#">Link</a></p>
Spot the bug
When elements contain other elements, each element must
be properly nested, that is, fully contained within its parent.
<div><p><a href="#">Link</p></a></div>
<form>
<label>First Name:</label>
<input type=”text”>
email
tel
radio
hidden
<select>
<select>
<option>Number 1</option>
<option>Second Opt</option>
</select>
<select>
Buttons