Slide 1
HTML Basics
Joan Boone
jpboone@email.unc.edu
HTML Basics Joan Boone jpboone@email.unc.edu Slide 1 Topics Part - - PowerPoint PPT Presentation
INLS 572 Web Development HTML Basics Joan Boone jpboone@email.unc.edu Slide 1 Topics Part 1: HTML Documents Part 2: HTML 5.3, Current Specification Part 3: HTML + CSS Slide 2 HTML Basics: Document Structure HTML defines the structure
Slide 1
Joan Boone
jpboone@email.unc.edu
Slide 2
Slide 3
the content.
<!DOCTYPE html> <html> <head> <meta charset=”utf-8”> <title>Title goes here</title> </head> <body> Page content goes here </body> </html>
Slide 4
Text elements
Images (jpg, png, gif)
<img src="mypic.png" alt="image desc">
Links
<a href="https://sils.unc.edu">SILS</a> Other content elements, but we will not cover...
Tables <table> <tr> <th> <td> Forms <form> <input>
Slide 5
<div>
and can be associated with a style sheet or script
<div>
<h2>Appalachian Trail</h2> <p>Stretching from Georgia to Maine, the National ...</p> … </div>
<p>... maintains <span>95.5 miles</span> of the 2,185 mile ...</p>
<span>
can also be associated with an id or class attribute for styling purposes
Slide 6
nc-national-parks.html
Click image to view in browser Click here to view in CodePen
Slide 7
Where to get images
Flickr Creative Commons, Freeimages.com
Image editing
transparent backgrounds
Optimization
Slide 8
Graphical, with flat colors,
Photographs MDN Web Docs: Choosing an image format
Slide 9
Anchor element <a>...</a>
<a href="https://sils.unc.edu">SILS</a>
Absolute vs. relative URLs
protocol, domain name, and path name; used for referencing external resources (outside of your website or server)
(“internal link”) <a href="/courses/2020/fall">Fall semester classes begin</a> <a href="https://digitalaccessibility.unc.edu/resources/all-resources/">
Digital Accessibility</a>
Destination link (URL) address Visible text
Slide 10
the default page (or home page for your website)
<img src="images/UNC_SILSlogo.png"> <link href="css/style.css" rel="stylesheet" /> <a href="index.html">INLS 572</a>
Recommendation: design a directory structure that is descriptive, maintainable, and will meet future needs.
Slide 11
Slide 12
HTML, CSS, DOM, and JavaScript
Slide 13
When can I use... HTML, CSS compatibility tables
Slide 14
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html> instead of
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<link rel="stylesheet" href="styles.css"> instead of
<link rel="stylesheet" href="styles.css" type=”text/css”>
<script> instead of <script type="text/javascript">
Slide 15
Before HTML5, the most commonly used element for
HTML5 introduces semantic elements that provide descriptive names to sections of a document
header, footer, figure, figcaption
Google's Web Authoring Statistics study for common class names
Slide 16
Source: Viking Code School, HTML5 Semantic Tags
Slide 17
Slide 18
Early HTML included elements to define
margins, alignment) to format the content
Today, use Cascading Style Sheets (CSS) to
Slide 19
Slide 20
External style sheets (recommended!) <head>
<title>Title goes here</title> <link rel=”stylesheet” href=”style.css”> </head>
Embedded style sheets (ok for small style sheets) <head>
<title>Title goes here</title> <style> ... </style> </head>
Inline styles (don't do this!) <h2 style=”color:blue”>The sky is blue</h1>