Skip to main content

2. HTML Elements

HTML Element Reference

https://www.w3schools.com/tags/default.asp

Heading

<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>

Paragraph

<p>This is a paragraph.</p>

Div

<div>This is a div.</div>

Span

<span>This is a span.</span>

https://www.w3schools.com/html/html_links.asp

<a href="https://www.w3schools.com">Visit W3Schools.com!</a>

Ordered List

<ol>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>

Unordered List

https://www.w3schools.com/html/html_lists.asp

<ul>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>

Image

https://www.w3schools.com/html/html_images.asp

<img src="pic_trulli.jpg" alt="Italian Trulli" />

Table

https://www.w3schools.com/html/html_tables.asp

<table>
<thead>
<tr>
<th>Company</th>
<th>Contact</th>
<th>Country</th>
</tr>
</thead>
<tbody>
<tr>
<td>Alfreds Futterkiste</td>
<td>Maria Anders</td>
<td>Germany</td>
</tr>
<tr>
<td>Centro comercial Moctezuma</td>
<td>Francisco Chang</td>
<td>Mexico</td>
</tr>
<tr>
<td>Ernst Handel</td>
<td>Roland Mendel</td>
<td>Austria</td>
</tr>
</tbody>
</table>

Form Elements

Input

<label for="fname">First name:</label> <input type="text" id="fname" name="fname" />

Button

<button type="button" onclick="alert('Hello World!')">Click Me!</button>

Select

<label for="cars">Choose a car:</label>
<select id="cars" name="cars">
<option value="volvo" selected>Volvo</option>
<option value="saab">Saab</option>
<option value="fiat">Fiat</option>
<option value="audi">Audi</option>
</select>

Multiple Select

<label for="cars">Choose a car:</label>
<select id="cars" name="cars" size="4" multiple>
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="fiat">Fiat</option>
<option value="audi">Audi</option>
</select>

Checkbox

<input type="checkbox" id="vehicle1" name="vehicle1" value="Bike" />

Radio

<label for="option1"> <input type="radio" id="option1" name="options" value="option1" /> Option 1 </label>
<label for="option2"> <input type="radio" id="option2" name="options" value="option2" /> Option 2 </label>
<label for="option3"> <input type="radio" id="option3" name="options" value="option3" /> Option 3 </label>

Textarea

<textarea name="message" rows="10" cols="30">

Form

<form action="/action_page.php" method="get">
<label for="fname">First name:</label><br />
<input type="text" id="fname" name="fname" value="John" /><br />

<label for="lname">Last name:</label><br />
<input type="text" id="lname" name="lname" value="Doe" /><br /><br />

<input type="submit" value="Submit" />
</form>