Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
HTML Document Structure | Building the Blog Website
course content

Course Content

AI Powered Coding

HTML Document StructureHTML Document Structure

Goal

First, let's create the basic document structure of our website. We would like to have three articles. In each article, we would like to specify the article heading, some article content, and an image.

You can use the prompts that we provide or modify them as needed. There isn't just one way to achieve the goal. ChatGPT is flexible and can assist in various ways.

Possible Prompt

Create an HTML document structure for a blog website that allows for the publication of 3 articles. Each article should consist of:

  • A title (heading);
  • Several paragraphs of text;
  • An image;
  • A topic or category.

The HTML structure should be organized clearly and logically, using HTML tags and semantic meaning properly.

Result

html

index.html

css

index.css

js

index.js

If you are interested in delving deep into the code and understanding its functionality, please use the Code Description button below. If you are okay with it, skip this step and move on to the next chapter.

Code Description

index.html

Line 1: This line declares the document type and version of HTML (HTML5 in this case).
Line 2:
  • The <html> tag encloses the entire HTML document.
  • The lang="en" attribute specifies that the language of the document is English.
Lines 3-7:
  • The <head> section contains metadata and other information for the document.
  • <meta charset="UTF-8" />: Specifies the character encoding for the document.
  • <meta name="viewport" content="width=device-width, initial-scale=1.0" />: Ensures proper scaling and rendering on different devices.
  • <title>My Blog</title>: Sets the title of the webpage, which appears in the browser tab.
Lines 8, 52: The <body> tag encloses the content of the HTML document that is visible to users.
Lines 9-11:
  • The <header> tag contains introductory content.
  • <h1>: A heading that serves as the main title for the blog.
Lines 13, 47: The <main> tag represents the dominant content of the document.
Lines 14-24, 26-35, 37-46:
  • The <article> tag encloses a self-contained composition.
  • <h2>: A subheading for the article.
  • <p>: Paragraph containing article content.
  • <img src="..." alt="..." />: An image related to the article with a description.
  • A final <p> tag indicating the category of the article.

Lines 49-51:
  • The <footer> tag contains footer information.
  • <p>: Paragraph with a copyright notice.

Website State

Video Tutorial

Everything was clear?

Section 4. Chapter 2
course content

Course Content

AI Powered Coding

HTML Document StructureHTML Document Structure

Goal

First, let's create the basic document structure of our website. We would like to have three articles. In each article, we would like to specify the article heading, some article content, and an image.

You can use the prompts that we provide or modify them as needed. There isn't just one way to achieve the goal. ChatGPT is flexible and can assist in various ways.

Possible Prompt

Create an HTML document structure for a blog website that allows for the publication of 3 articles. Each article should consist of:

  • A title (heading);
  • Several paragraphs of text;
  • An image;
  • A topic or category.

The HTML structure should be organized clearly and logically, using HTML tags and semantic meaning properly.

Result

html

index.html

css

index.css

js

index.js

If you are interested in delving deep into the code and understanding its functionality, please use the Code Description button below. If you are okay with it, skip this step and move on to the next chapter.

Code Description

index.html

Line 1: This line declares the document type and version of HTML (HTML5 in this case).
Line 2:
  • The <html> tag encloses the entire HTML document.
  • The lang="en" attribute specifies that the language of the document is English.
Lines 3-7:
  • The <head> section contains metadata and other information for the document.
  • <meta charset="UTF-8" />: Specifies the character encoding for the document.
  • <meta name="viewport" content="width=device-width, initial-scale=1.0" />: Ensures proper scaling and rendering on different devices.
  • <title>My Blog</title>: Sets the title of the webpage, which appears in the browser tab.
Lines 8, 52: The <body> tag encloses the content of the HTML document that is visible to users.
Lines 9-11:
  • The <header> tag contains introductory content.
  • <h1>: A heading that serves as the main title for the blog.
Lines 13, 47: The <main> tag represents the dominant content of the document.
Lines 14-24, 26-35, 37-46:
  • The <article> tag encloses a self-contained composition.
  • <h2>: A subheading for the article.
  • <p>: Paragraph containing article content.
  • <img src="..." alt="..." />: An image related to the article with a description.
  • A final <p> tag indicating the category of the article.

Lines 49-51:
  • The <footer> tag contains footer information.
  • <p>: Paragraph with a copyright notice.

Website State

Video Tutorial

Everything was clear?

Section 4. Chapter 2
some-alt