Scanner class Methods in Java

Elements in HTML

HTML Elements

If we try to break HTML document in small parts.The small meaningful parts of it are called Elements.So, HTML document is made up of elements. There are various elements in html like paragraphs,lists,break,marquee,div and many more.

An HTML element is written using a Start Tag and ends with a End Tag, and with the Content in between.

HTML documents consist of nested HTML elements. In the example below, the body element includes the <ptags, the <br /> tag and the content,"This is a paragraph.".

Example:

<html>
<head>
<title>First page</title>
</head>
<body>
<p>This is a paragraph.</p>
</body>
</html>

Output:

First HTML Program


Some HTML elements are quite small.You can't put contents within a break tagand you don't have an opening and closing break tag.It's a separate single element. HTML document contains elements within elements.

Example:
<html>
<head>
<title>First Page</title>
</head>
<body>
<p>This is a Paragraph.</p>
<p>This is a<br /> Line break.</p>
</body>
</html>

Output:

First HTML Program


Above programs show, the paragraph and break element.There are many elements in html. We will be learning about them also.









Comments