Unit I - Nme Notes - F
Unit I - Nme Notes - F
HTML
HTML was created by Sir Tim Berners-Lee in late 1991 but was not released officially,
which was published in 1995 as HTML 2.0. HTML 4.01 was published in late 1999 and was a
major version of HTML.
HTML is a markup language and has evolved with various versions updating. Each version has
allowed its user to create web pages in the much easier and prettier way and make sites very
efficient.
1. HTML 1.0 was released in 1993 with the intention of sharing information which can be
readable and accessible via web browsers. But not much of the developers were
involved in creating websites. So the language was also not growing.
2. Then comes the HTML 2.0, published in 1995; which contains all the features of HTML
1.0 along with that few additional features; which remained as the standard markup
language for designing and creating websites until January 1997 and refined various
core features of HTML.
3. Then comes the HTML 3.0, where Dave Raggett who introduced a fresh paper or draft
on HTML. It included improved new features of HTML, giving more powerful
characteristics for webmasters in designing web pages. But these powerful features of
new HTML slowed down the browser in applying further improvements.
4. Then comes the HTML 4.01 which is widely used and was a successful version of
HTML before HTML 5.0, which is currently released and used worldwide. HTML 5
can be said for as an extended version of HTML 4.01 which was published in the
year 2012.
HTML DOCUMENTS:
Head part- The title and metadata of a web document are contained in the head
element.
Body part- The body element includes the information that you wish to display on a
web page. To make your web pages HTML 4 compatible, include a document type
declaration (DTD) before the HTML element.
Basic Structure of HTML
<!DOCTYPE>
<html>
<head>
<title>
<body>
<!DOCTYPE>
It is referred as the document type declaration (DTD).
It is an instruction to the browser regarding the document type.
It is a null element that does not have a closing tag and must not contain any content.
<html>
The <html> tag informs the browser that this is an HTML document.
The <html> tag requires a beginning and ending tag.
Syntax of the <html> Tag
<!DOCTYPE html>
<html>
...
</html>
<head>
The <head> tag in HTML is used to contain metadata (data about data).
It is used between the<html> and <body> tags.
It only contains HTML document metadata, which specifies information about the
HTML document.
Depending on our needs, an HTML head might contain a lot of metadata information
or can have very little or no metadata information.
However, the head section of an HTML document plays an essential role in the
creation of a website.
<title>
<style>
<meta>
<link>
<script>
<base>
</html>
<title>
This <title> tag in HTML displays the title of a web page
It can help in higher rankings in search results if appropriate keywords are included.
It gives a relevant title to the full HTML content.
It appears at the top of the browser window
Syntax of the <title> Tag
<!DOCTYPE html>
<html>
<head>
<title> ... </title>
</head>
</html>
<body>
The <body> tag in HTML specifies the main content of an HTML document that
appears on the browser.
It can contain headings, text, paragraphs, photos, tables, links, videos, etc.
The <body> tag must come after the <head> tag, or it must be inserted between
the </head> and </html> tags.
This tag is essential for all HTML documents and should only be used once
throughout the document .
</body>
</html>
HTML Heading Tags (<h1> to <h6> )
A HTML heading or HTML h tag can be defined as a title or a subtitle which you
want to display on the webpage.
When you place the text within the heading tags <h1>.........</h1>, it is displayed on
the browser in the bold format and size of the text depends on the number of heading.
There are six different HTML headings which are defined with the <h1> to <h6> tags,
from highest level h1 (main heading) to the least level h6 (least important heading).
h1 is the largest heading tag and h6 is the smallest one. So h1 is used for most
important heading and h6 is used for least important.
<! DOCTYPE html>
<html>
<head>
<title>Heading Tags</title>
</head>
<body>
<h1>Heading no. 1</h1>
<h2>Heading no. 2</h2>
<h3>Heading no. 3</h3>
<h4>Heading no. 4</h4>
<h5>Heading no. 5</h5>
<h6>Heading no. 6</h6>
</body>
</html>
HTML Head Section:
The <head> tag in HTML is used to contain metadata (data about data).
It is used between the<html> and <body> tags.
It only contains HTML document metadata, which specifies information about
the HTML document.
Depending on our needs, an HTML head might contain a lot of metadata information
or can have very little or no metadata information.
However, the head section of an HTML document plays an essential role in the
creation of a website.
<title>
<style>
<meta>
<link>
<script>
<base>
</html>
</html>
Note:
Every page on the website is unique and the title tags should reflect that.
Title should accurately describe what’s on that specific page.
A clear and accurate title is more useful to anyone who sees the page in the search
listings.
2. Pay attention to length.
Google and other search engines will display 50-60 characters of a title tag in the
search results.
If the user like to include your brand name in every title tag (which can be a good idea
for recognizable brands), put it at the end, behind the words that describe what’s on
the specific page.
2. Use target keyword (but don’t overdo it).
Every page on the website should answer a question or provide valuable information
someone will be searching for.
Google’s algorithm uses the title tag as one of the main ways to determine what a
page is about, it’s a good opportunity to include the main keyword or keywords
targeting for that page.
That makes it clear to Google that this page is relevant for anyone searching for that
specific term. Just make sure not to fall for keyword stuffing.
The title tag should provide an accurate description of what people will see when they
choose to visit the web page.
When people’s expectations match what they see on the page, it means a lower
bounce rate and a longer time spent on the site – metrics that signal to Google your
page is valuable and should keep ranking high.
HTML Links
If you set the target attribute to "_blank", the link will open in a new browser window or tab.
<!DOCTYPE html>
<html>
<head>
<title>Hyperlink Example</title>
<base href = "https://www.tutorialspoint.com/">
</head>
<body>
<p>Click any of the following links</p>
<a href = "/html/index.htm" target = "_blank">Opens in New</a> |
<a href = "/html/index.htm" target = "_self">Opens in self</a> |
<a href = "/html/index.htm" target = "_parent">Opens in Parent</a> |
<a href = "/html/index.htm" target = "_top">Opens in Body</a>
</body>
</html>
HTML - Colors
Colors are very important to give a good look and feel to your website. You can specify
colors on page level using <body> tag or you can set colors for individual tags
using bgcolor attribute.
The <body> tag has following attributes which can be used to set different colors −
bgcolor − sets a color for the background of the page.
text − sets a color for the body text.
alink − sets a color for active links or selected links.
link − sets a color for linked text.
vlink − sets a color for visited links − that is, for linked text that you have already
clicked on.
Standard 16 Colors
<!DOCTYPE html>
<html>
<head>
<title>HTML Colors by Name</title>
</head>
<body text = "blue" bgcolor = "green">
<p>Use different color names for for body and table and see
the result.</p>
</body>
</html>
HTML Comments
Single-line Comment
Multi-line Comment
Using comment tag
Single-line Comment
The single-line comment is given inside the ( <!– comment –> ) tag.
Syntax
<!-- comment -->
Example:
<!DOCTYPE html>
<html>
<body>
<!--This is single line comment,It wont be displayed by the browser -->
<h2>Hello World</h2>
</body>
</html>
Multi-line Comment
Multiple lines can be given by the syntax (<!– –>), Basically it’s the same as we used in
single line comment, difference is half part of the comment (” –> “), is appended where the
intended comment line ends.
Syntax
<!-- Multi
Line
Comment -->
Example:
<!DOCTYPE html>
<html>
<body>
<!-- This is
multi-line
comment -->
<h2> Hello World </h2>
</body>
</html>