HTML elements form the building blocks of all websites.
Everything that comes in-between and includes the tag is defined as element of that particular tag.
<HTML> Element – Contains element of the whole document.
<HEAD> Element –Contains the title of the document
You will see that ProgrammingTute will appear on the title bar of the window.
Also it contains some of the elements like
i) <base> tag-used to create base url for all links on the page.
ii) <script> tag-used to include java script inside the document.
iii) <object> tag-used to include image, mp3 files etc.
v) <meta> tag-it’s like giving information about data(metadata information)
vi) <style> tag-used to include stylesheet inside the document.
<BODY> Element- Contains the content of the document. It may contain anything like paragraph, forms and tables.
Tags can also have attributes, which provide additional information about an element.
Attributes should appear inside the opening tag and their value is always be enclosed in quotes.
<a href="http://www.programmingtute.com">This is a link</a>
Some of the main attributes which gets repeated are class, id, style, title and dir.
Class – It is used to Specify the class name of particular element inorder to associate with a with a style sheet. You no need to worry about this until you start learning CSS.
Id– To differentiate between two elements with same name and to specify unique id for an element, we can use this attribute.
Style – We can specify CSS style for an element by using this style attribute.
For example, “style=’height:200px;width:300px”
Title– The title for the element has to be given in this attribute. Also it can be used as tooltip text for a particular element.
Dir– It tells the browser the direction in which the text should flow inside the content.
<p dir="ltr">Write this text left-to-right!</p>
Auto– browser choice based on the content displayed (if nothing is given).
Lang– It specifies the language of the element’s content.
If it is included inside the <html> tag, it specifies the language used within the document.
If it is included inside the other tags, then it specifies the language used within those tags.
<p lang="en">This page is using English language</p>