Ultimate HTML Guide
Learn HTML from scratch with this complete beginnerβfriendly guide. No prior coding experience needed.
π Table of Contents
1.1 Building Your First Header
Every web page starts with a simple set of tags that tell the browser what is a header and what is a paragraph.
<h1>Hello World</h1>
<p>This is my first web page.</p>
<h1>β Heading level 1 (the most important heading).<p>β Paragraph tag.- Most HTML elements have an opening tag
<tag>and a closing tag</tag>.
1.2 Links & Navigation
Links are what make the web interconnected. The <a> anchor tag creates hyperlinks.
<a href="https://example.com">Visit Example</a>
hrefβ the destination URL.- Absolute URL β full web address (
https://google.com). - Relative URL β points to a file within your site (
about.html). target="_blank"β opens link in a new tab.
1.3 Images & Multimedia
The <img> tag embeds images. The alt attribute is essential for accessibility.
<img src="photo.jpg" alt="A description of the photo" />
srcβ image source (URL or file path).altβ alternative text (shown if image fails to load, read by screen readers).width/heightβ optional dimensions.
1.4 Lists & Tables
Lists and tables help organise information clearly.
<ul>
<li>Apples</li>
<li>Bananas</li>
</ul>
<ol>
<li>Wake up</li>
<li>Brush teeth</li>
</ol>
<table>
<tr><th>Name</th><th>Age</th></tr>
<tr><td>Alice</td><td>25</td></tr>
</table>
<ul>β unordered list (bullet points).<ol>β ordered list (numbers).<table>β rows (<tr>), headers (<th>), data (<td>).
1.5 Forms & Inputs
HTML forms collect user input β search boxes, login fields, contact messages.
<form action="/submit" method="post">
<label for="name">Name:</label>
<input type="text" id="name" name="name" />
<button type="submit">Send</button>
</form>
<form>β container for inputs.action(where data goes),method(GET or POST).<label>β text description linked to an input viafor.<input>β the field itself.typedefines behaviour (text, email, password, etc.).<button type="submit">β submits the form.
1.6 Semantic HTML
Semantic HTML elements describe their meaning to both the browser and the developer.
<header>Logo & navigation</header>
<nav>Links</nav>
<main>Main content</main>
<article>Blog post</article>
<footer>Copyright</footer>
<header>β introductory content, logo, navigation.<nav>β major navigation links.<main>β the dominant content of the page (only one).<article>β selfβcontained composition.<section>β thematic grouping of content.<aside>β sidebar, tangentially related content.<footer>β footer with copyright, links, contact info.
1.7 CSS Basics
CSS (Cascading Style Sheets) controls the look and feel of your web pages.
<style>
h1 { color: #3b82f6; font-size: 2rem; }
p { color: #475569; }
</style>
- Inline CSS β
styleattribute inside an HTML tag. - Internal CSS β
<style>tag inside<head>. - External CSS β separate
.cssfile linked via<link>.
1.8 CSS Box Model
Every element is a rectangular box: content + padding + border + margin.
.box {
width: 200px;
padding: 20px;
border: 5px solid #ef4444;
margin: 30px;
}
paddingβ space inside the border.borderβ border around padding.marginβ space outside the border.box-sizing: border-boxβ includes padding and border in width/height.
1.9 Flexbox & Grid
Flexbox and Grid are modern CSS layout systems for building responsive designs.
.flex-container {
display: flex;
flex-direction: row;
justify-content: center;
gap: 1rem;
}
.grid-container {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 1rem;
}
- Flexbox β oneβdimensional (row or column).
- Grid β twoβdimensional (rows AND columns).
1.10 Project: Personal Bio Page
Apply everything you've learned to build a complete personal bio page.
- Semantic HTML β
<header>,<nav>,<main>,<section>,<footer>. - Navigation β links to Home, About, Projects, Contact.
- About section β heading, paragraph, image.
- Skills list β unordered list of skills.
- Projects section β 2β3 project cards using flexbox or grid.
- Contact form β name, email, message, submit button.
- CSS styling β colours, padding, margin, border, boxβshadow.
- Responsive β media query for mobile.
π Want to go further?
Explore the full HTML course with interactive demos, code examples, and challenges.
Full HTML Course β