Sign in
Download Opera News App

Digital Technology

 

Gaming

 

HTML Coding For Beginners - Understanding HTML Tags - Part 2

As earlier stated in my previous article, HTML makes use of various tags to format the content and these tags are enclosed within angle braces <Tag Name>. Most tags have their corresponding closing tags except a few, which are called open tags.

For instance, <p> is starting tag of a paragraph and </p> is closing tag of the same paragraph but <p>This is paragraph</p> is a paragraph element.

We shall be learning about more tags and elements that can be used in HTML to build your website below.

Understanding HTML tags and elements

An HTML element is defined by a starting tag. If the element contains other content, it ends with a closing tag.

- Center tag

You can use the <center> tag to put any content in the center of the page or any table cell.

- Preserve Formatting tag

If you want your text to follow the exact format of how it is written in the HTML document, you can use the preformatted tag <pre>.

Any text between the opening <pre> tag and the closing </pre> tag will preserve the formatting of the source document.

Nested HTML Elements

This is when a tag is placed in between another tag. You are allowed to keep one HTML element inside another HTML element

HTML Attribute

An HTML attribute is used to define the characteristics of an HTML element and is placed inside the element's opening tag. Note that all attributes are made up of two parts − a name and a value

- The name is the property you want to set. For example, the paragraph <p> element in the example below carries an attribute whose name is aligned, which you can use to indicate the alignment of the paragraph on the page.

- The value is what you want the value of the property to be set and always put within quotations. The below example shows three possible values of align attribute: left, center and right.

Follow for more as we will be discussing HTML core attributes and formatting in the next article.

Content created and supplied by: ChocolateMe (via Opera News )

HTML

COMMENTS

Load app to read more comments