An HTML Consists of a “Start Tag”, “Element content” and “End Tag”.
Syntax:
<p>My Name is John<p>
Here<p>is start tag. My Name is John is the element content. <p> is the end tag.
The Element which have no content is called as empty element.
<br> is an empty element without a closing tag (the <br> tag used to defines a line break in HTML).
<!DOCTYPE html>
<html>
<body>
<p>My Name is John</p>
<br>
<p>He is a good boy. </p>
</body>
</html>
In some cases that an HTML element can contain one or more element.
Let’s see the below example for the better understanding.
<html>
<body>
<p><strong>This is a paragraph</strong></p>
</body>
</html>
HTML is not case sensitive. If you write
instead of
it gives the same output.Let’s see an example for better understanding.
<!DOCTYPE html>
<html>
<body>
<p>My Name is John</p>
<P>My Name is John</P>
</body>
</html>
The <link> element is generally used to load the css file for both internal and external file.
<!DOCTYPE html>
<html>
<head>
<title>Hyperlink Example</title>
</head>
<body>
<a href="//www.studentstutorial.com">Visit our HTML tutorial</a>
</body>
</html>
The HTML <base> element is used to specify a base URL for all relative links contained in the document, e.g. you can set the base URL once at the top of your page.
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<base href="https://www.studentstutorial.com/">
</head>
<body>
<p>Hello World!</p>
</body>
</html>
The <script> element is used to specify client-side script, such as JavaScript in HTML documents.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Page Title</title>
<script>
document.write("<p>Hello World!</p>")
</script>
</head>
<body>
<p>Script element example</p>
</body>
</html>