Now today i am going to tell you about html elements:
All html documents are made up of html elements.Elements Of Html:
Html is written with start tag,end tag and some content written between them.<tagname>some content</tagname>
e.g;
<h1>My heading</h1>
<p>My paragraph</p>
Html Nested Element:
Html elements can be nested it means that html element can contain some content between them.In following example there are four nested html elements:
In above example nested elements are <html></html>,<body></body>,<h1></h1> and <p></p> because all these contain some content between them.
Explanation Of Html Examples:
The <html> tag describes whole document.It starts with <html> tag and ends with</html>.
The <body> tags describes document body.
It starts with <body> tag and ends with </body>.
It also contain two more tags i.e.<h1> and <p>.
The <h1> tags describes about html heading.
It starts with <h1> tag and ends with </h1>.
The content that i have written is:My Heading.
The tag <p> describes about html paragraphs.
It starts with <p> tag and ends with </p>.
Content that i have written is:My Paragraph.
Never Forget End Tags:
Never forget to write end tags,end tags can be ignored in some cases but in some cases if you will not put end tags then unexpected result or error may occur and your hardwork will be ruined.So be careful.Empty Html Elements:
Html elements that are with no content written between are known as empty element.<br> tag is an empty element because it contains no content written.<br> tag is used to break line.
These empty elements are closed as <br/>.
No comments:
Post a Comment