Building a web page with HTML tags


Building a web page with HTML tags : Now you can write HTML tags, let’s look at how we can use them to code a more complex web page.

As you’ve just seen earlier, if you write text between the opening and closing p tag as illustrated below:

<p>This text is between the opening and closing p tag. It will get displayed on screen.</p>

Text between p tag will appear on-screen. But just having one block of text on our web page won’t look very exciting.

If we want to make new lines or paragraphs we have to learn new tags.

We need to put these new tags between our opening and closing body tag as illustrated below:

<!–– This comment is between our opening and closing body tag. ––>

Putting tags inside other tags is called nesting.

Nesting tags allow us to create more exciting page layouts.

Let’s look at an example of nesting with the < body > and the < p > paragraph tag:

 <p>Hello World!</p>

The < p > tag is used inside the < body > tag, this is an HTML element  nesting example.

White space around your HTML doesn’t matter.

However, programmers like to indent their code every time they open a new tag.

It helps them keep track of when they’ve opened and closed a tag and makes the code block easier to read.

To indent, press Tab every time you open a new tag.

Let’s learn about the tags you need to make paragraphs and line breaks.

The code in the tags is very simple. It’s just a shorter way of saying “paragraph” and “break”.

All our tags are written using lowercase and there are no spaces between the tags and text!

We add the spaces in the post for readability. The code snippets follow proper programming syntax.

Related Posts:

HTML paragraph tag: p

Paginate Your WordPress Site Without Plugins

The color CSS property

What is a Shortcode in WordPress?

Tips and Tricks for WRITING JAVASCRIPT code

Alignment CSS properties


Connected through code, Choose Your Platform!

About the Author: Bernard Aybout

In the land of bytes and bits, a father of three sits, With a heart for tech and coding kits, in IT he never quits. At Magna's door, he took his stance, in Canada's wide expanse, At Karmax Heavy Stamping - Cosma's dance, he gave his career a chance. With a passion deep for teaching code, to the young minds he showed, The path where digital seeds are sowed, in critical thinking mode. But alas, not all was bright and fair, at Magna's lair, oh despair, Harassment, intimidation, a chilling air, made the workplace hard to bear. Management's maze and morale's dip, made our hero's spirit flip, In a demoralizing grip, his well-being began to slip. So he bid adieu to Magna's scene, from the division not so serene, Yet in tech, his interest keen, continues to inspire and convene.