Elements Vs Tags Vs Attributes
Tags:- Tags are something which tells the browser what to display for example if we want to display the paragraph in the webpage we must use <p> tag . Tags starts with "<" symbol and ends with ">" symbol and Tags are of two types
a). Container Tags:- these tags requires its closing once started for eg we must write paragraph in a website in this manner <p> Lorem ipsum dolar amet </p> ,
notice i have closed the paragraph tag with "Forward slash" .
b). Empty Tags:- These tags do not require their closing once started for eg . <img > tag browser itself closes this tag while rendering the website .
Now i have stated browser rendering yes each time we runs a html code this html code is run by browser in the system
Elements:- Elements consists of tags and content inside tags for eg
" <p> Lorem ipsum dolar amet </p> " in this code snippet the output will be
"Lorem ipsum dolar amet" . now the tag used in this code snippet is P (paragraph tag) and the content inside this tag is Lorem ipsum dolar amet , together they are called as Elements
Attributes:-They add extra functionalities to the tag for example For example, attributes can be used to change the color, size, or functionality of HTML elements
That's all , Positive criticism is always welcomed. Thanks