HTML Basics: Your First Web Page
HTML is a language that describes the structure of web pages. Using tags we create a heading, paragraphs and lists and build a simple web page.
All topics (9 of 11)
Chapter 1. Computer networks
Chapter 2. Information security
Chapter 3. Creating web pages
HTML (HyperText Markup Language) is not a programming language but a markup language that describes the structure of a page. The browser reads an HTML file and draws the page on the screen. The file is written in a plain text editor (Notepad, VS Code) and saved with the .html extension, for example index.html; it can be opened in a browser by double-clicking.
HTML consists of tags. A tag is written in angle brackets, and many tags have an opening and a closing (</...>) tag: <p>Salom</p>. The part between the opening and closing tag is called an element. Tags can be nested, but they must be closed in the right order. An opening tag can carry an attribute: <html lang="uz">.
Every page has the same structure: <!DOCTYPE html> states the document type, <html> wraps the whole page, <head> holds service information about the page (<title> is the name on the browser tab, <meta charset="utf-8"> is the encoding), and <body> holds everything the user sees.
The main tags for text are: <h1> to <h6> for headings (h1 is the largest), <p> for a paragraph, <br> for a line break, <b> for bold and <i> for italic text. For lists use <ul> (bulleted) or <ol> (numbered), with each item written in <li>. A comment looks like <!-- comment --> and is not visible on the page. After making changes, refresh the page in the browser (F5).
Key takeaways
- HTML is a markup language that describes the structure of a page.
- A document consists of
<html>,<head>and<body>. - Tags open and close:
<p>…</p>; an attribute is written in the opening tag. - Headings are
<h1>–<h6>, a paragraph is<p>, lists use<ul>/<ol>and<li>.
Practice tasks
- Create the file
index.html: page title “Mening sahifam”, your name in<h1>and two sentences about yourself in<p>; open it in a browser. - Add a list of your favourite subjects with
<ul>and a weekly timetable with<ol>to the page. - Leave one tag unclosed on purpose and see how the page changes; then fix the mistake.
Review questions
Test yourself: think first, then reveal the answer.
1How do the `<head>` and `<body>` parts differ?Show answerHide answer
`<head>` holds service information about the page (title, encoding), while `<body>` holds the content the user sees.2What is an attribute? Give an example.Show answerHide answer
An attribute is a part of an opening tag that gives extra information, for example `lang` in `<html lang="uz">`.
0 of 11 topics completed
Sign in to mark