In this tutorial, we will cover the basics of HTML and CSS. We will be using a text editor to create our files.
HTML
HTML is the language used to create web pages. It stands for HyperText Markup Language. HTML is a markup language, which means that it uses tags to identify different elements on a page.
Tags are surrounded by angle brackets, like this:
The most basic HTML document looks like this:
Hello, world!
The declaration is required at the beginning of every HTML document. It tells the browser which version of HTML the document is written in.
The tag marks the beginning of the document. Everything between the and tags is the document’s body.
The
tag contains information about the document, like the title.The
tag contains the actual content of the page.HTML tags are not case sensitive. The
tag is the same as the
tag.
CSS
CSS is the language used to style web pages. It stands for Cascading Style Sheets. CSS is used to style all of the elements on a page, including the text, headings, and paragraphs.
CSS is written in a style sheet, which is a text file with the .css extension. A style sheet contains a list of rules that tell the browser how to style the different elements on a page.
The most basic CSS document looks like this:
h1 {
font-size: 24px;
font-weight: bold;
}
p {
font-size: 16px;
}
The h1 { } rule sets the font size for all h1 headings to 24px and makes them bold.
The p { } rule sets the font size for all paragraphs to 16px.
CSS is not case sensitive. The h1 { } rule is the same as the H1 { } rule.
In the next tutorial,