Html Basic-Introduction

The first step in learning any new language is to learn the basics. HTML (Hyper Text Markup Language) is actually a very simple and easy to learn language.
HTML is made up of tags. There are two kinds of tags; opening and closing tags. Opening tags are pieces of text contained in “<>” and looks like the following: <tag>.On the other hand the closing tags have a structure like the following with a </tag>.
The whole structure of the tags are like the following:

<opening tag>
</closing tag>

The information put in between the opening and the closing tags are applied the functionality of the tag.

For example:
The use of the <body> tag for the body of the web page

<body>
Your web page body text will be placed here
</body>

Structure of HTML Page

Below is the structure for the HTML page.

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”&gt;
<html xmlns=”http://www.w3.org/1999/xhtml&#8221; >
<head>
<title>Titled for the page</title>
</head>
<body>

</body>
</html>


<!DOCTYPE> tag

This tag is the first thing in a HTML document. This is not a HTML tag exactly, but it tells the web browser what version of the markup language the web page is written in. 
Doctype also refers to a Document Type Definition (DTD). Document Type Definition (DTD) specifies the rules for the markup language to make sure that the content is rendered properly by the browser. 


<html xmlns></html> tag

The <html> tag indicates the browser that this is the beginning of a HTML document, and the </html> tag indicates the browser that this is the end of the HTML document.
The xmlns attribute within the starting <html xmlns> tag specifies the xml namespace for a document. This attribute is compulsory in XHTML but is invalid in HTML. However the HTML validator at w3.org does not mind if this attribute is missing in the XHTML document. The reason is because the attribute is added to the tag automatically and set to the following by default. “xmlns=http://www.w3.org/1999/xhtml”


<head></head> tag

This tag contains the head elements of the web page. The head elements within the tags can include configuration options like scripts, instruction to the browser to find and load Style Sheets, meta information, etc. Some of these tags include:
<base></base> 
<link></link> 
<meta></meta> 
<script></script> 
<style></style> 
<title></title>

<base></base> tag

The HTML <base> tag is used to specify a base URI, or URL, for relative links.

For example, you can set the base URL once at the top of your page in header section, then all subsequent relative links will use that URL as a starting point.

<link></link> tag

The HTML Link Element (<link>) specifies relationships between the current document and an external resource. This Element is most used to link to style sheets.

<meta></meta> tag

Metadata is data (information) about data.
The <meta> tag provides metadata about the HTML document. Metadata will not be displayed on the page.
Meta elements are typically used to specify page description, keywords, author of the document, last modified, and other metadata.
The metadata can be used by browsers (how to display content or reload page), search engines (keywords), or other web services.

<script></script> tag

The <script> tag is used to define a client-side script, such as a JavaScript.
The <script> element either contains scripting statements, or it points to an external script file through the src attribute.

<style></style> tag

The <style> tag is used to define style information for an HTML document.
Inside the <style> element you specify how HTML elements should render in a browser.
Each HTML document can contain multiple <style> tags.

<title></title> tag

This tag defines the title of the HTML document. The <title></title> tag is required in all HTML/XHTML documents. This element defines a title to the browser toolbar, provide a title for a web page when it is added to the favorites and displays a title for the page in search-engine results.


<body></body> tag
This tag defines the body of the web page. The <body></body> tag contains all the contents of a HTML web page like text, hyperlinks, images, tables, lists, etc. This is the most important tag of the web/HTML document.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s