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
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 )
Opera News is a free to use platform and the views and opinions expressed herein are solely those of the author and do not represent, reflect or express the views of Opera News. Any/all written content and images displayed are provided by the blogger/author, appear herein as submitted by the blogger/author and are unedited by Opera News. Opera News does not consent to nor does it condone the posting of any content that violates the rights (including the copyrights) of any third party, nor content that may malign, inter alia, any religion, ethnic group, organization, gender, company, or individual. Opera News furthermore does not condone the use of our platform for the purposes encouraging/endorsing hate speech, violation of human rights and/or utterances of a defamatory nature. If the content contained herein violates any of your rights, including those of copyright, and/or violates any the above mentioned factors, you are requested to immediately notify us using via the following email address operanews-external(at)opera.com and/or report the article using the available reporting functionality built into our Platform See More