Introduction to HTML & CSS A Guide for Beginners
Introduction to HTML & CSS A Guide for Beginners
Abstract
HTML and CSS are the foundational technologies used to build and design websites.
This guide introduces beginners to the core concepts of web development, including
how to structure web pages with HTML and style them using CSS. The document
provides hands-on examples and tips to help learners begin building their own
simple websites.
The internet is built on websites—and every website begins with two fundamental
languages: HTML (HyperText Markup Language) and CSS (Cascading Style Sheets). HTML
structures content, while CSS makes it visually appealing. Whether you're starting
a blog, building a portfolio, or launching a startup, knowing these basics is
essential.
2. What is HTML?
HTML is used to define the structure and content of web pages. It uses "tags" to
identify elements like headings, paragraphs, images, and links.
Example:
<!DOCTYPE html>
<html>
<head>
<title>My First Page</title>
</head>
<body>
<h1>Hello, world!</h1>
<p>This is my first HTML page.</p>
</body>
</html>
Key elements:
<p>: Paragraphs
3. What is CSS?
CSS controls how HTML elements look. It allows you to set colors, fonts, spacing,
layout, and more. CSS can be inline, internal, or external.
Example:
<style>
body {
background-color: #f2f2f2;
font-family: Arial;
}
h1 {
color: navy;
}
</style>
CSS Syntax:
selector {
property: value;
}
Example:
p {
color: gray;
font-size: 16px;
}
4. Putting It Together
When you combine HTML and CSS, you get a fully styled web page. Here's a simple
example:
<!DOCTYPE html>
<html>
<head>
<title>Styled Page</title>
<style>
body {
background-color: #fff8dc;
font-family: Verdana;
}
h1 {
color: #333;
}
p {
color: #666;
}
</style>
</head>
<body>
<h1>Welcome to My Website</h1>
<p>This page is built with HTML and styled with CSS.</p>
</body>
</html>
Use free tools like CodePen, JSFiddle, or your browser’s Developer Tools.
Practice by recreating simple websites you like.
Save your files with .html or .css extensions and open them in a browser to see
results.
6. Next Steps
Conclusion
Learning HTML and CSS is the first step to becoming a web developer. With practice
and curiosity, anyone can build beautiful, functional websites. Mastering the
basics opens the door to more advanced technologies and creative possibilities on
the web.
References