Skip to content

Instantly share code, notes, and snippets.

@taptapdan
Created July 19, 2018 15:36
Show Gist options
  • Save taptapdan/44827ef9d94bdcc7e9f6e73450ac70a8 to your computer and use it in GitHub Desktop.
Save taptapdan/44827ef9d94bdcc7e9f6e73450ac70a8 to your computer and use it in GitHub Desktop.
HTML Workshop

HTML Workshop

What is HTML?

HTML, HyperText Markup Language, is a markup language used to create web pages. It essentially a language to describe the structure and content of a document.

Note: HTML is separate from CSS. CSS is a presentation language used to describe the style/appearance of the content. What font type or sizes, colors, spacing between text, etc.

Elements, Tags, Attributes

Elements

Elements are used to define the structure and content of the document. These includes things like <h1>, <h2>, <h3> ... <h6> (headings), <p> (paragraphs), <a> (links), etc.

Elements are represented by the element name wrapped in angle brackets: < >.

Tags

To mark the beginning and end of an element we use tags. Tags usually come in an open and close pair.

  • Opening tag: <span>
  • Closing tag: </span> notice the forward slash
  • So then: <span>content of the tag</span>

Attributes

Attributes are properties that can be supplied to provide additional information about an element. Some common attributes are id, href, and class.

  • Attributes are specified within the opening tag
  • Attributes usually have a name and value
  • They are written like name="value"

For example, if you wanted to provide a clickable link to a website, you could use the a tag along with the href attribute like this:

<a href="https://perts.net">Visit PERTS</a>

Document Structure

Starting Document

<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title>HTML Workshop</title>
  </head>
  <body>

  </body>
</html>

Nesting

When you place on element within another elements, it's called nesting.

For readability / organization, it's a good idea to indent nested elements.

Self Closing Elements

Some elements don't need a closing tag. Examples are:

  • <meta> (which you see in the "Starting Document" above),
  • <br>,
  • <img>,
  • and <hr>.

Resources

Specifications

HTML 5.2
https://www.w3.org/TR/html52

Images

PERTS Logo: https://perts.net/static/images/pertslogo.png

PERTS logo

Screenshot: https://www.evernote.com/l/AJ41BuPTEKVDLas0xi09fiDn46RkyJpGVVoB/image.png

devices using PERTS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment