Basics of Internet
Nested Lists and Tables
File Path in HTML
HTML Forms
HTML Media
Chapter - 2
HTML - What You Need to Know
What is HTML?
- HTML means HyperText Markup Language.
- You use it to make the content and structure of web pages.
- HyperText: Lets you make clickable links to jump around pages.
- Markup Language: You add special "tags" to plain text to show what each part means (like a title, paragraph, or link).
How Do You Write and Run HTML?
- Write HTML code in files that end with .html (like index.html).
- Use any text editor (like Visual Studio Code - a free code editor).
- To view your work, just open the file in a web browser.
Core Building Blocks
-
Headings <h1> to <h6>
- Like chapter titles and sub-titles in a book.
- <h1> is the main heading (biggest and most important), <h2> is a section heading under that, and so on down to <h6> (smallest).
- Use these to give your page clear structure (helps humans and search engines).
-
Paragraphs <p>
- Use <p> for regular text - just like normal paragraphs in a book.
- Browsers automatically add some space before and after each paragraph.
-
Horizontal Rule <hr>
- Creates a clear line across the page to show a separation between sections.
- Think of this as drawing a divider between topics.
-
Line Break <br>
- Tells the browser to go to a new line (like pressing “Enter” just once).
- Use for things like addresses or poems where you want single lines to break.
-
Lists: <ul>,<ol>and<li>
- Unordered List (<ul>): Bulleted list.
- Ordered List (<ol>): Numbered list,Capital Alphabats and small alphabets are also used as a type.
- Each item goes inside an <li> tag.
-
Links (Anchor Tag <a>)
- The tag that makes hypertext - clickable links to other websites, files, or pages.
- Needs an href attribute (the link destination).
- Optionally, use target="_blank" to open in a new tab.
- Example:
-
Images <img>
- Use p for regular text - just like normal paragraphs in a book.
- Needs a src (where the image is) and alt (text description for screen readers or if the image fails to load).
- Example:
Important Concepts
- Tags = Keywords inside angle brackets (<tag>). Most tags need both opening (<p>) and closing (</p>) pairs, but some (like hr and img) don't.
- Nesting - Putting tags inside other tags (like list items inside a list).
How HTML Works in the Browser
- Browser reads your HTML file and uses the tags to know what each part is (titles, paragraphs, images, links, etc.).
- The browser ignores extra spaces and line breaks in the code, unless told otherwise with tags like <br> and <pre>.
More References: