HTML Cheatsheet

In rough order of how much we use them:

Text

Paragraph

<p>Hello</p>

    â†’    

Hello

Headers

<h1>Hello</h1>

    â†’    

Hello

<h2>Hello</h2>

    â†’    

Hello

<h3>Hello</h3>

    â†’    

Hello

<h4>Hello</h4>

    â†’    

Hello

<h5>Hello</h5>

    â†’    

Hello

<h6>Hello</h6>

    â†’    

Hello

Span

Spans can go inside other text tags.

<p>Hello <span>World</span></p>

    â†’    

Hello World

Divs

Divs are rectangles which can contain other elements:

<div>
  <p>Hello</p>
  <div>
    <p>World</p>
  </div>
</div>

    â†’    

Hello

World

Images

<img> tags can be used to load .jpg, .png, .svg files

<img src="/static/dog.jpg" />

    â†’    

Absolute

<a href="/">Link Text Goes Here</a>

    â†’     Link Text Goes Here

Relative

<a href="anotherPageDeeper">Link Text Goes Here</a>

    â†’     Link Text Goes Here

Another webpage

<a href="https://google.com">Google</a>

    â†’     Google

Starting a HTML page

<html>
  <head>
    <title>website title</title>
  </head>
  <body>
    <p>Website goes here!</p>
  </body>
</html>

Inputs

<input />

    â†’    

<input type="password"/>

    â†’    

<input type="checkbox" />

    â†’    

<input type="submit" />

    â†’    

<input
  type="radio"
  id="contactChoice1"
  name="contact"
  value="email"
/>
<label for="contactChoice1">Email</label>

<input
  type="radio"
  id="contactChoice2"
  name="contact"
  value="phone"
/>
<label for="contactChoice2">Phone</label>

<input
  type="radio"
  id="contactChoice3"
  name="contact"
  value="mail"
/>
<label for="contactChoice3">Mail</label>

    â†’    

Select

<select>
  <option value="">Please choose an option</option>
  <option value="dog">Dog</option>
  <option value="cat">Cat</option>
  <option value="hamster">Hamster</option>
</select>

    â†’    

Script

<script src="javascript.js"></script>

<script>
console.log('Hello World')
</script>
<head>
  <link href="main.css" rel="stylesheet">
</head>