HTML Basics
- Use semantic tags like
<header>,<main>, and<footer>. - Always include the
<meta viewport>tag for responsiveness. - Link your CSS file using
<link rel="stylesheet" href="styles.css">.
Common HTML Tags Reference
| Tag | Description | Example |
|---|---|---|
<h1> – <h6> |
Headings from largest to smallest | <h2>My Title</h2> |
<p> |
Paragraphs of text | <p>Hello World</p> |
<img> |
Inserts images | <img src="photo.jpg" alt="example"> |
<a> |
Creates links | <a href="page.html">Click here</a> |
CSS Basics
- Use classes for reusable styles.
- Use Flexbox or Grid for layouts.
- Use variables (custom properties) for consistent colors.
Example CSS Syntax
body {
background-color: #0b0d10;
color: #e9eef5;
font-family: Arial, sans-serif;
}
Extra Tips
- Keep your code indented and readable.
- Validate your HTML and CSS using online validators.
- Save files as index.html so your site loads automatically.