HTML 2 : HTML Elements Tags Attributes and Enclosed Text

 

HTML for Selenium (Part 2) – 

HTML Elements Tags Attributes and Enclosed Text

In the previous post, we have understood “What is HTML?

Now, let’s understand the different things which are used in HTML language to make our learning of HTML easier.

The following are the different things in HTML, I am going to explain in this article:

  • > HTML Tags (Start and End Tags)
  • > HTML Attribute Names and their values
  • > Enclosed Text
  • > HTML Elements

Let’s get started.

HTML Tags

Follow the below steps for understanding the HTML Tags:

1) Open the Website http://compendiumdev.co.uk/selenium/basic_web_page.html in any browser say Chrome Browser:

HTML Components Web Page

2) Right click on the “A paragraph of text” and select ‘Inspect’ option as shown below:

HTML Components - Web Page - Inspect Elements

 

 

 

 

 

 

 

 

3) Observe that the HTML code for “A paragraph of text” is displayed as shown below:

HTML Components - HTML Source Code

From the above image,  observe that “A paragraph of text” text is enclosed by <p> and </p> HTML tags.

<p> before the enclosed text is the start tag and </p> after the enclosed text is the end tag (As shown below)

HTML Components - Start and End TagsHTML Attributes Names and their values

Inside the Start Tag of any HTML element, we can see zero or more attribute names and their values as shown below:

 

 

 

 

 

 

 

 

Enclosed Text

In between the start tag and end tag, we can see the enrolled text as shown below:

HTML Components - Enclosed Text

 

 

 

 

 

 

 

 

 

HTML Elements

The complete Start tag, Attribute Name & Value, Enclosed Text, and End Tag together form the HTML Element as shown below:

HTML Components - HTML Elements

 

 

 

 

 

 

 

 


I will explain more HTML concepts that are required for learning Selenium in the upcoming posts.

Comments

Popular posts from this blog

10 automation test cases for https://www.saucedemo.com/ (Sauce Demo)

Java Roadmap for SDET Superstars!

Mastering XPath in Selenium 4 🚀 – Supported Functions & Axes Explained