HTML: Basics Part-I
In this post,
we will go through all the basic stuff of HTML coding. There are various tags
that we must consider and include while starting to code in HTML. These tags
help in organizing the basic formatting of elements in our script or web pages.
These step by step procedures will guide you through the process of writing
HTML.
Before
mentioning the basics of HTML, you must familiar with the term HTML elements. Let’s
understand this first:
HTML Element
An HTML Element usually consists
of a start tag and end tag, with the content inserted in between:
<tagname> Content goes here… </tagname>
The HTML element is everything
from the start tag to the end tag:
<p> This is a paragraph. </p>
HTML element with no content are called Empty elements. Empty elements do not have an end tag such as the <br> element (which indicates a line break).
Do Not Forget the End Tag
Some
HTML elements will display correctly, even if you forget the end tag:
<html>
<body>
<p> This is a paragraph.
<p> This is a paragraph.
</body>
</html>
The
example above works in all browsers, because the closing tag is considered
optional.
Never
rely on this. It might produce unexpected results and/or errors if you forget
the end tag.
Empty HTML Elements
HTML
elements with no content are called empty elements.
<br> is an empty
element without a closing tag (the <br> tag defines a line break):
<p>
This is a <br> paragraph with a line
break. </p>
Empty
elements can be "closed" in the opening tag like this: <br
/>.
HTML5 does not require empty elements to be closed. But if you
want stricter validation, or if you need to make your document readable by XML
parsers, you must close all HTML elements properly.
Use Lowercase Tags
HTML tags are not case sensitive: <P> means the same
as <p>.
The HTML5 standard does not require lowercase tags, but I would recommend
using lowercase tags in HTML.
For better understand-ability of the
topic HTML: Basics, I have divided this in three important posts. The next two
posts will be up to you in upcoming days. Sorry for your inconvenience, pleas e go through them too.
No comments:
Post a Comment