Introduction to React.js and Next.js
Every website you visit—whether it’s a blog, an online store, or a social media platform—is built on a foundation of HTML and CSS.
These two technologies form the backbone of the modern web.
HTML (HyperText Markup Language) defines the structure of a web page.
CSS (Cascading Style Sheets) controls the appearance and layout of that structure.
A simple way to understand their relationship is to think of HTML as the skeleton of a building and CSS as the interior design and paint that make it visually appealing.
Understanding HTML and CSS is the first and most important step for anyone who wants to become a web developer, create personal websites, or understand how the internet really works.
HTML uses elements (also called tags) to describe different parts of a web page.
Each element tells the browser what kind of content it represents.
Every HTML page follows a standard structure:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>My First Web Page</title>
</head>
<body>
<h1>Hello, World!</h1>
<p>This is my first HTML page.</p>
</body>
</html>
<!DOCTYPE html> tells the browser this is an HTML5 document.
<html> is the root element.
<head> contains metadata (not visible on the page).
<body> contains all visible content.
HTML provides six levels of headings:
<h1>Main Title</h1>
<h2>Section Title</h2>
<h3>Subsection</h3>
Paragraphs are created using the <p> tag:
<p>This is a paragraph of text.</p>
Links allow users to navigate between pages:
<a href="https://example.com">Visit Example</a>
Images add visual content:
<img src="image.jpg" alt="A descriptive text">
The alt attribute is important for accessibility.
HTML supports ordered and unordered lists:
<ul>
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
</ul>
<ol>
<li>Learn HTML</li>
<li>Learn CSS</li>
<li>Build Projects</li>
</ol>
Semantic elements describe their meaning clearly:
<header>
<h1>My Blog</h1>
</header>
<main>
<article>
<h2>First Post</h2>
<p>This is an article.</p>
</article>
</main>
<footer>
<p>© 2025 My Blog</p>
</footer>
Using semantic HTML improves accessibility and code readability.
CSS controls how HTML elements look on the screen.
It defines colors, fonts, spacing, layouts, and animations.
CSS rules consist of:
A selector
A property
A value
p {
color: blue;
font-size: 16px;
}
This rule applies to all <p> elements.
<p style="color: red;">Red text</p>
<style>
p { color: green; }
</style>
<link rel="stylesheet" href="styles.css">
p {
color: black;
}
External CSS keeps code clean and maintainable.
body {
background-color: #f4f4f4;
font-family: Arial, sans-serif;
}
CSS supports named colors, HEX, RGB, and HSL formats.
Every element is a box made of:
Content
Padding
Border
Margin
div {
width: 300px;
padding: 20px;
border: 2px solid black;
margin: 10px;
}
Understanding the box model is essential for layout design.
Flexbox is a modern layout system:
.container {
display: flex;
justify-content: space-between;
align-items: center;
}
<div class="container">
<div>Item 1</div>
<div>Item 2</div>
</div>
Flexbox makes responsive layouts easier than older methods.
<!DOCTYPE html>
<html>
<head>
<title>Simple Website</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<h1>Welcome to My Website</h1>
</header>
<main>
<p>This website is built using HTML and CSS.</p>
<button>Click Me</button>
</main>
</body>
</html>
body {
font-family: Arial, sans-serif;
background-color: #ffffff;
text-align: center;
}
header {
background-color: #333;
color: white;
padding: 20px;
}
button {
padding: 10px 20px;
background-color: #007bff;
color: white;
border: none;
cursor: pointer;
}
This example demonstrates structure (HTML) and styling (CSS) working together.
HTML and CSS are:
Essential for web development
Beginner-friendly
Required knowledge for frameworks like React or Vue
Even backend developers benefit from understanding these technologies.
After mastering HTML and CSS, consider learning:
Responsive Design
CSS Grid
JavaScript basics
Web accessibility (ARIA)
Browser rendering performance
HTML and CSS are the building blocks of the web.
HTML gives structure and meaning to content, while CSS transforms that structure into visually appealing, user-friendly designs.
Learning these technologies opens the door to modern web development and provides a solid foundation for more advanced tools and frameworks.
Whether you want to build a personal blog, a portfolio, or a professional website, mastering HTML and CSS is the first step toward creating your presence on the web.