Introduction To HTML
Introduction To HTML
XHTML 2000
HTML 5 2014
Elements and Tag: HTML uses predefined tags and elements which tells the browser about
content display property. If a tag is not closed then browser applies that effect till end of
page.
An HTML element is defined by a starting tag. If the element contains other content, it ends
with a closing tag, where the element name is preceded by a forward slash as shown below
with few tags −
So here <p>....</p> is an HTML element, <h1>...</h1> is another HTML element. There are
some HTML elements which don't need to be closed, such as <img.../>, <hr /> and <br />
elements. These are known as void elements.
HTML page structure: The Basic structure of HTML page is given below. It contain some
elements like head, title, body, … etc. These elements are used to build the blocks of web
pages.
<DOCTYPE! html>: This tag is used to tells the HTML version. This currently tells that the
version is HTML 5.
<html>: This is called HTML root element and used to wrap all the code.
<head>: Head tag contains metadata, title, page CSS etc. All the HTML elements that can be
used inside the <head> element are:
<style>
<title>
<base>
<noscript>
<script>
<meta>
<title>
<body>: Body tag is used to enclosed all the data which a web page has from texts to links.
All of the content that you see rendered in the browser is contained within this element.