HyperText Markup Language
CONTENT!
STRUCTURE!
Tell your neighbor in your own words the purpose of HTML
<p> The p tags plus this content is an element. </p>Opening tag
Closing tag
Element
<img src="../img/stuff.jpg" alt="img is a self-closing tag" >Common Self-closing Tags
Is this an element?
Resources
Additional information attached to an element.
"id" and "class" attributes are typically used to generate content or to act as a reference for other technologies like CSS & JS.
<img src="./resources/stuff.jpg" alt="Write something descriptive"><p class="lead">Content content content</p><h1 id="brand">Apple</h1><input type="password"
required
minlength="8"
>Now add appropriate attributes to 3 elements on your codepen
<ul>
<li>List item #1</li>
<li>List item #2</li>
<li>List item #3</li>
</ul>Nesting Elements
<nav>
<ul>
<li><a href="http://slides.com">Home</a></li>
<li><a href="http://google.com">About</a></li>
<li><a href="https://developer.mozilla.org">Contact</a></li>
</ul>
</nav>Don't be like this guy.
Which of these is more intuitive?
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Stuff and Things</title>
</head>
<body>
<div>
<h1>Big Header</h1>
</div>
<div>
<p>
<b>Middle Content!!</b>
</p>
</div>
<div>
<p>
© 2016
</p>
</div>
</body>
</html><!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Stuff and Things</title>
</head>
<body>
<header>
<h1>Big Header</h1>
</header>
<main>
<p>
<strong>Middle Content!!</strong>
</p>
</main>
<footer>
<p>
© 2016
</p>
</footer>
</body>
</html>Why use semantic HTML?
Examples of structural semantic HTML
<header>
<nav>
<main>
<aside>
<section>
<footer>
<figure>
Examples of text markdown semantic HTML
<strong>
<em>
<figcaption>
<summary>
<date>
<time>
<details>
<pre>
Elements are usually either "block-level" elements or "inline" elements.
Block-level
occupies an entire row space of its parent element (container), thereby creating a "block."
Block-level elements may appear only within a <body> element.
Inline
occupies only the space bounded by the tags that define the inline element.
p {
color: red;
}
p {
color: blue;
}
Cascading Style Sheets (CSS) is a language that add style to the HTML.
Cascading is key here. The file is read top to bottom.
If you style one element twice, it will accept the second styling as the truth.
p {
color: red;
}
p {
color: blue;
}
Syntax
Targeted Element
Property
Value
Targetting IDs and Classes
Classes
IDs
.red-text {
color: red;
}
#intro {
color: red;
}
Common Properties
Resources
valeriekraucunas@gmail.com
vkraucunas.com