Iron Man Logo Lecture 1 Thumbnail Lecture 2 Thumbnail

Lecture 3 Thumbnail Lecture 4 Thumbnail Lecture 5 Thumbnail Lecture 6 Thumbnail html logo

INTRO TO HTML



HTML 5

The Problem of Creating a Web Page

We know a server sends files to a client, but what is the fundamental nature of these files? How do we write a document that a web browser can understand, not just as plain text, but as a structured page with links, headings, and paragraphs?


The Problem of a Place to Write Code

Messy, Frustrating Code

The Building Blocks of a Web Page: Core HTML Tags

HTML provides a set of tags to solve the most common structural problems when creating a document. An HTML Element refers to the complete structure, from the opening tag to the closing tag, including the content inside.

1. The Heading (<h1> to <h6>)

Headings in  HTML

The Problem: How do we define the main title and sub-topics of our page to create a clear, logical hierarchy for users and search engines?.

The Solution: We use heading tags from <h1> to <h6>.

A Note on Importance vs. Size: The primary purpose of heading tags is to define semantic importance, not just to control font size. <h1> tells a search engine what your page is about, which is crucial for SEO (Search Engine Optimization). The visual size is a default style that can be changed later.

<h1>This is the most important heading.</h1>

2. The Paragraph (<p>)

HTML Paragraph

The Problem: How do we group and display standard blocks of text?.

The Solution: The <p> tag is used to define a distinct paragraph of text. Browsers automatically add space before and after a <p> element.

<p>This is a paragraph containing several sentences of text.</p>

3. Separators (<hr> and <br>)

HR and BR Tags

The Problem: How can we create a visual, thematic separation between sections, or force a line break within a block of text?.

The Solution:

<p>First topic.</p> <hr /> <p>Second topic starts here.<br>This is a new line.</p>

4. List Elements (<ul>, <ol>, <li>)

HTML Lists

The Problem: How do we present a series of related items, like ingredients for a recipe or steps in a guide?.

The Solution: We use list tags to structure this information.

<ul><li>Milk</li><li>Sugar</li></ul>

5. The Anchor Tag (<a>)

HTML Hyperlinks

The Problem: How do we create the clickable hyperlinks that allow users to navigate between pages?.

The Solution: The <a> (Anchor) tag creates a hyperlink.

<a href="https://www.coderarmy.in/" target="_blank">Visit Coder Army</a>

6. The Image Tag (<img>)

Image Tag

The Problem: How do we display a visual image on our webpage?.

The Solution: The <img> tag is used to embed an image. This is a self-closing tag.

<img src="dog.jpg" height="200" width="200" alt="A photo of a cute dog">


Sources: Internet. All copyrights © reserved #DarkProgrammer, Let's connect.