Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Structuring the HTML Document | Building the Blog Website
AI Powered Web Development Essentials

book
Structuring the HTML Document

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.

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

copy
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>My Blog</title>
</head>
<body>
<header>
<h1>Welcome to My Blog</h1>
</header>

<main>
<article>
<h2>Article 1: Exploring Nature</h2>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed euismod, tortor non
ullamcorper commodo, justo libero maximus purus, vel pulvinar turpis quam vitae mi. Nullam
auctor, tortor id sagittis fermentum, leo lacus venenatis tortor, at tristique leo magna
in lorem.
</p>
<img src="nature.jpg" alt="Nature Image" />
<p>Category: Nature</p>
</article>

<article>
<h2>Article 2: Cooking Adventures</h2>
<p>
Phasellus rutrum tincidunt sapien, sed vestibulum velit vehicula nec. Sed pharetra dui in
fermentum sodales. Pellentesque habitant morbi tristique senectus et netus et malesuada
fames ac turpis egestas.
</p>
<img src="cooking.jpg" alt="Cooking Image" />
<p>Category: Cooking</p>
</article>

<article>
<h2>Article 3: Traveling Around the World</h2>
<p>
Nullam efficitur lacus nec urna fringilla, ut venenatis tortor lacinia. Duis vitae mauris
sed mi semper aliquet. Aenean vestibulum libero eget nibh malesuada, id luctus libero
pharetra. Fusce auctor mauris sed tristique efficitur.
</p>
<img src="travel.jpg" alt="Travel Image" />
<p>Category: Travel</p>
</article>
</main>

<footer>
<p>&copy; 2024 My Blog. All rights reserved.</p>
</footer>
</body>
</html>

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.

Website State

Video Tutorial

Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 4. Chapter 2

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

We use cookies to make your experience better!
some-alt