Progressing with HTML

By the end of this chapter you will have learnt about some other HTML tags and know everything you need to build a basic unstyled website.

1. Headers

2. Footers

3. Navigation

Example:

				<!DOCTYPE html>
				<html lang="en">
					<head>
						<title>My First Website</title>
						<meta charset="utf-8">
						<meta name="viewport" content="width=device-width, initial-scale=1">
					</head>
					<body>
						<nav>
							<ul>
								<li><a href="about.html">About</a></li>
								<li><a href="experience.html">Experience</a></li>
								<li><a href="portfolio.html">Portfolio</a></li>
								<li><a href="contact.html">Contact</a></li>
							</ul>
						</nav>
					</body>
				</html>

4. Tables

Example:

				<!DOCTYPE html>
				<html lang="en">
					<head>
						<title>My First Website</title>
						<meta charset="utf-8">
						<meta name="viewport" content="width=device-width, initial-scale=1">
					</head>
					<body>
						<table>
							<thead>
								<tr>
									<th>Column1</th>
									<th>Column2</th>
									<th>Colomn3</th>
								</tr>
							</thead>
							<tbody>
								<tr>
									<td>C1:R1</td>
									<td>C2:R1</td>
									<td>C3:R1</td>
								</tr>
								<tr>
									<td>C1:R2</td>
									<td>C2:R2</td>
									<td>C3:R2</td>
								</tr>
							</tbody>
						</table>
					</body>
				</html>

5. Forms

6. Adding JavaScript

7. Adding CSS Styles

8. Building our first webpage (Cont.)

This demo uses the same code from the previous chapter but builds on it with the topics we have just covered.

To see what the code outputs click this link, or build the website yourself!

				<!DOCTYPE html>
				<html lang="en">
					<head>
						<title>My First Website</title>
						<meta charset="utf-8">
						<meta name="viewport" content="width=device-width, initial-scale=1">

						<link rel="stylesheet" href="myStylesheet.css">
					</head>
					<body>
						<header>
							<h1>HTML and CSS Demo</h1>
							<nav>
								<ul>
									<li><a href="about.html">About</a></li>
									<li><a href="experience.html">Experience</a></li>
									<li><a href="portfolio.html">Portfolio</a></li>
									<li><a href="contact.html">Contact</a></li>
								</ul>
							</nav>
						</header>

						<section>
							<h2>Section Heading</h2>
							<p>This section contains two articles</p>
							<article>
								<h3>Article Heading</h3>
								<p>Paragraph... Maecenas nec velit eu mi sodales euismod. Sed aliquet in lectus sodales faucibus. Nullam orci orci, congue vel tempor eu, posuere nec sapien. Mauris eleifend dolor vel pretium commodo. Morbi ullamcorper a eros ut egestas. Quisque aliquet quis sapien vulputate elementum. In efficitur turpis ipsum, at varius nisl euismod sed.</p>
							</article>

							<article>
								<h3>Article Heading</h3>
								<p>Paragraph... Pellentesque quis justo ac mauris rutrum blandit. Ut risus lectus, placerat eget nulla ac, placerat semper leo. Curabitur tempor dui in nunc volutpat sollicitudin. Vestibulum vel erat euismod tellus rutrum dapibus nec vel metus.
							</article>
						</section>

						<section>
							<h2>Fruit & Veg</h2>
							<article>
								<h3>Fruit</h3>
								<ul>
									<li>Apple</li>
									<li>Orange</li>
									<li>Pear</li>
								</ul>
							</article>

							<article>
								<h3>Veg</h3>
								<ol>
									<li>Potato</li>
									<li>Carrot</li>
									<li>Peas</li>
								</ol>
							</article>
						</section>

						<p class="actionLink"><a href="http:daniel-ellis.co.uk" target="_blank">Click this link to view my website</a></p>
						<img src="cat.jpg" alt="A cute ginger cat laid on its back in a basket">

						<table>
							<thead>
								<tr>
									<th>Column1</th>
									<th>Column2</th>
									<th>Colomn3</th>
								</tr>
							</thead>
							<tbody>
								<tr>
									<td>C1:R1</td>
									<td>C2:R1</td>
									<td>C3:R1</td>
								</tr>
								<tr>
									<td>C1:R2</td>
									<td>C2:R2</td>
									<td>C3:R2</td>
								</tr>
							</tbody>
						</table>

						<form id="contactForm" method="post" action="/contact.php">
							<ul>
								<li>
									<label for="name">*Name:</label>
									<input type="text" name="name" id="name" placeholder="What's your name?" value="" maxlength="70" autofocus required>
								</li>
								<li>
									<label for="email">*Email:</label>
									<input type="email" name="email" id="email" placeholder="What's your email?" value="" required>
								</li>
								<li>
									<label for="phone">Phone:</label>
									<input type="phone" name="phone" id="phone" placeholder="What's your telephone number?" value="">
								</li>
								<li>
									<label for="message">*Message:</label>
									<textarea rows="5" cols="50" name="message" id="message" form="contactForm" placeholder="What's your enquiry?" maxlength="500" required></textarea>
								</li>
								<li class="btn">
									<input type="reset" value="Reset">
									<input type="submit" id="submit" value="Submit">
								</li>
							</ul>
						</form>

						<footer>
							© Copyright 2018 Dan Ellis
						</footer>
					</body>
				</html>