Tuesday, May 13, 2014

HTML Elements

// // Leave a Comment

An HTML element is everything from the start tag to end tag. Tags tend not to do much more than mark the beginning and end of an element. Elements are the bits that make up web pages. You would say, for example, that everything that is in between (and includes) the <body> and </body> tags is the body element. As another example, whereas “<title>” and “</title>” are tags, “<title> Rumple Stiltskin </title>” is a title element.
Start tag(opening tag)*
Element Content
End tag(closing tag)*
&lt;p&gt;
This is a paragraph
&lt;/p&gt;
&lt;a href=”default.html”&gt;
Click here
&lt;/a&gt;
&lt;br&gt;



  Example:
<!DOCTYPE html>
<html>

<body>
<p>This is my first paragraph.</p>
</body>

</html>
The <p> element defines a paragraph in the HTML document.
The <body> element defines the body of the HTML document.
The <html> element defines the whole HTML document.
Note: Don’t forget the closing tag(</tagname>).

Empty HTML Elements

HTML elements with no contents are called empty elements.
<br> is an empty element without a closing tag(<br> tag defines a line break)
<br /> you are also written a <br> tag(<br /> its define br tag with closing).




0 comments:

Post a Comment