Chapter 1 Introduction to HTML
Chapter 1 Introduction to HTML
C.NagaRaju
B.Tech(CSE),M.Tech(CSE),PhD(CSE),MIEEE,MCSI,MISTE
Professor
Department of CSE
YSR Engineering College of YVU
Proddatur
Contents
I
• What is Web?
• Types of websites
• How to access the Web?
• How to Addressing the Web
• Domain Name Addressing
• Uniform Resource Locators(URL)
• Domains and protocols
• Structure of HTTP Protocol
•Static website
•Static website is the basic type of website that is easy to create.
•You don't need the knowledge of web programming and database
design to create a static website.
•Its web pages are coded in HTML.
•The codes are fixed for each page so the information contained in
the page does not change and it looks like a printed page.
27/02/2025 Prof.C.NagaRaju YSREC phone: 9949218570
Dynamic
website
• Once you have your Internet connection, then you need special software called a
browser called client to access the Web.
• Web browsers are used to connect you to remote computers, open and transfer
files, display text and images.
• Web browsers are specialized programs.
• Examples of Web browser: Netscape Navigator, chrome, mozillafirefox and
Internet
27/02/2025Explorer. Prof.C.NagaRaju YSREC phone: 9949218570
How to Addressing the Web: IP Address
• Each computer on the internet does have a unique identification number, called
an IP (Internet Protocol) address.
• The internet IP addressing system currently using a four-part number.
• Each part of the address is a number ranging from 0 to 255, and each part is
separated by period / Dot
• For example, 106.29.242.17
• The combination of the four IP address parts provides 4.2 billion possible
addresses (256 x 256 x 256 x 256).
• The IP address and the domain name each identify a particular computer on the Internet.
• However, they do not indicate where a Web pages are residing on that computer.
• To identify a Web page’s exact location, Web browsers rely on Uniform Resource Locator (URL).
• URL is a four-part addressing scheme that tells the Web browser that:
What transfer protocol to use for transporting the file
The domain name of the computer on which the file resides
The pathname of the folder or directory on the computer on which the file resides
The name of the file
pathname
protocol
http://www.chicagosymphony.org/civicconcerts/index.htm
27/02/2025 Prof.C.NagaRaju YSREC phone: 9949218570
Domain name filename
Domain (s)
• On the Internet, a domain is basically a registration category identifying geographic
or purpose commonality.
• There are seven top-level domains currently in use:
• com - A commercial organization. The largest domain extension currently used.
• edu - An educational establishment such as a school or university.
• gov - A branch of the U.S government that is strictly reserved for that purpose.
• int - An international organization such as the United Nations.
• net - A network organization.
• org - A non-profit organization.
• mil - A branch of the U.S military that is strictly reserved for that
purpose.
• In other parts of the world the final part of the domain name represents the
country in which the server is located like my for Malaysia, bb for Barbados,
ca for Canada and uk for Great
27/02/2025 Britain.
Prof.C.NagaRaju YSREC phone: 9949218570
PROTOCALS GOVERING THE WEB
• HTTP (hyper text transfer protocol)
• TCP (transfer control protocol)
• IP (internet protocol)
• UDP (user data gram protocol)
• FTP ( file transfer protocol)
• Telnet (telecommunication network)
• IMAP (internet message access protocol)
• NNTP (network news transfer protocol)
• NTP (network time protocol)
• SMTP (simple mail transfer protocol)
• Ssh (secure shell)
• Rsh (remote shell )
• , Rlogin (remote login)
27/02/2025 Prof.C.NagaRaju YSREC phone: 9949218570
Hyper Text Markup
Language
UNIT-I
Brief History of HTML
• Tim Berners-Lee is known as father of HTML.
• The first available description of HTML was called "HTML Tags" proposed by Tim
in late 1991.
• HTML stands for Hyper Text Markup Language.
• HTML is the standard markup language for creating Web pages and web
applications.
• We can create static website by HTML only.
• HTML describes the structure of Web pages
• HTML elements are represented by tags
• Hyper Text is a way to link two or more web pages (HTML documents) with
each other.
• Markup language: A markup language is a computer language that represents
specified layout and format of a text document.
• Markup language uses tags for markup and makes text more interactive and
dynamic.
27/02/2025 Prof.C.NagaRaju YSREC phone: 9949218570
HTML Versions
• HTML 1.0: The first version of HTML was 1.0, which was released in1991.
• HTML 2.0: This was released in 1995, and it was standard language version for website design. HTML 2.0 supports extra
features such as form-based file upload, form elements such as text box, option button, etc.
• HTML 3.2: HTML 3.2 version was published by W3C in early 1997. This version was capable of creating tables and provides
support for extra options for form elements. It also supports a web page with complex mathematical equations. It became
an official standard for any browser till January 1997. Today it is practically supported by most of the browsers.
• HTML 4.01: HTML 4.01 version was released on December 1999, and it is a very stable version of HTML language. This
version is the current official standard, and it provides added support for stylesheets (CSS) and scripting ability for various
multimedia elements.
• HTML5 : HTML5 is the newest version of Hypertext Markup language, announced in January 2008. There are two major
organizations one is W3C (World Wide Web Consortium), and another one is WHATWG( Web Hypertext Application
Technology Working Group) which are involved in the development of HTML 5 version, and still, it is under development.
27/02/2025 Prof.C.NagaRaju YSREC phone: 9949218570
Features of HTML
• It is a very easy and simple language. It can be easily understood and modified.
• It is very easy to make effective presentation with HTML because it has a lot of formatting tags.
• It is semi Structured
• It contains predefined tags only. Every tag must be opened and closed properly.
• It is a markup language so it provides a flexible way to design web pages along with the text.
• It facilitates programmers to add link on the web pages (by html anchor tag) , so it enhances the interest of browsing of the
user.
• It is platform-independent because it can be displayed on any platform like Windows, Linux and Macintosh etc.
• It facilitates the programmer to add Graphics, Videos, and Sound to the web pages which makes it more attractive and
interactive.
• HTML is not case-insensitive language, which means we can use tags either in lower-case or upper-case.
</html>
27/02/2025 Prof.C.NagaRaju YSREC phone: 9949218570
Description of HTML Example
• <!DOCTYPE>: It defines the document type or it instruct the browser about the version of HTML.
• <html> :This tag inform the browser that it is an HTML document. Text between html tag describes the
web document. It is a container for all other elements of HTML except <!DOCTYPE>
• <head> : It's should be the first element inside the <html> element, which contains the metadata
(information about the document). It must be closed before the body tag opens.
• <title> : As its name suggested, it is used to add title of that HTML page which appears at the top of
the browser window. It must be placed inside the head tag and should close immediately. (Optional)
• <body> : Text between body tag describes the body content of the page that is visible to the end user
This tag contains the main content of the HTML document.
• <h1> : Text between <h1> tag describes the first level heading of the webpage.
• <p> : Text between <p> tag describes the paragraph of the webpage.
27/02/2025 Prof.C.NagaRaju YSREC phone: 9949218570
HTML text Editors
• An HTML file is a text file, so to create an HTML file we can use any text
editors.
• Text editors are the programs which allow editing in a written text, hence to
create a web page we need to write our code in some text editor.
• Step 1: Open Notepad (Windows)
• Step 2: Write code in HTML
• Step 3: Save the HTML file with .htm or .html extension
• Step 4: Open the HTML page in your web browser (Output)
• The HTML <title> tag is used for specifying the title of the HTML document. Following is an
• <!DOCTYPE html>
• <html>
• <head>
• <title>HTML Title Tag Example</title>
• </head>
• <body>
• <p>Hello, World!</p>
• </body>
• </html>
27/02/2025 Prof.C.NagaRaju YSREC phone: 9949218570
The HTML <meta> Tag
• The HTML <meta> tag is used to provide metadata about the HTML document which
includes information about page expiry, page author, list of keywords, page description
etc.
• <meta name = "keywords" content = "C, C++, Java, PHP, Perl, Python">
• <!-- Provide description of the page -->
• <meta name = "description" content = “Easy Learning ">
• <!-- Author information -->
• <meta name = "author" content = “raja">
• <!-- Page content type -->
• 27/02/2025
<meta http-equiv = "content-type" content = "text/html; charset = UTF-8">
Prof.C.NagaRaju YSREC phone: 9949218570
The HTML <base> Tag
• The HTML <base> tag is used for specifying the base URL for all relative
URLs in a page, which means all the other URLs will be concatenated into
base URL while locating for the given item.
• Ex:
• <a href = "/html/index.htm" title = "HTML Tutorial"/>HTML Tutorial</a>
• The HTML <link> tag is used to specify relationships between the current
document and external resource.
• Following is an example to link an external style sheet file available
in css sub-directory within web root.
• <link rel = "stylesheet" type = "text/css" href = "/css/style.css">
• The HTML <script> tag is used to include either external script file or to define
internal script for the HTML document.
• Following is an example where we are using JavaScript to define a simple JavaScript
function −
• <script type = "text/JavaScript">
• function Hello()
• {
• alert("Hello, World");
• }
27/02/2025 Prof.C.NagaRaju YSREC phone: 9949218570
• </script>
Body tag and attributes
<BODY>...</BODY> Contains the viewed portion of the document
The HTML <pre> tag is used for indicating preformatted text. The code tag surrounds the code being marked up. Browsers
normally render pre text in a fixed-pitched font, with whitespace intact, and without word wrap.
Example
<!DOCTYPE html>
<html>
<head>
<title>HTML pre Tag</title>
</head>
<body>
<pre>
This text is
Output:
in a fixed-pitch This text is
width This specifies the width of the marquee. This can be a value like 10 or 20%
1 etc.
height This specifies the height of the marquee. This can be a value like 10 or
2 20% etc.
direction This specifies the direction in which marquee should scroll. This can be a
3 value like up, down, left or right.
behavior This specifies the type of scrolling of the marquee. This can have a value
4 like scroll, slide and alternate.
scrolldelay This specifies how long to delay between each jump. This will have a value
5 like 10 etc.
scrollamount This specifies the speed of marquee text. This can have a value like 10 etc.
6
loop This specifies how many times to loop. The default value is INFINITE,
7 which means that the marquee loops endlessly.
bgcolor This specifies background color in terms of color name or color hex value.
8
hspace This specifies horizontal space around the marquee. This can be a value
9 like 10 or 20% etc.
vspace This specifies vertical space around the marquee. This can be a value like
10 10 or 20% etc.
27/02/2025 Prof.C.NagaRaju YSREC phone: 9949218570
• TEXT EDIT ELEMENTS
• <Del> is used to delete the word or text from the document
• <ins> is used to insert word or text in the document
• <html>
• <body>
This is my <del>python</del> program
This is <ins> not </ins> my program
</body>
</html>
This is my pythonprogram
• Output : this is my program
• Output : this is not my program
27/02/2025 Prof.C.NagaRaju YSREC phone: 9949218570
Phrase elements
1).<em>
2) .<strong>
3). <blockquote>
4.<cite>
5. <q>
6.<abbr>
7. <acronym>
8. <dfn>
9. <code>
10. <kbd>
11. <samp>
12. <var>
13. <address>
27/02/2025 Prof.C.NagaRaju YSREC phone: 9949218570
1)Emphasized Text tag: <em>...</em> :Anything that appears within
<em>...</em> element is displayed as emphasized text in italic form.
Example:
<!DOCTYPE html>
<html>
<body>
The following word uses a <em>emphasized</em> typeface.
</body>
</html>
This will produce the following result:
The following word uses an emphasized typeface.
Output:
The HTML cite element defines the title of a work.
Browsers usually display cite elements in italic.
The27/02/2025
Scream by Edvard Munch. Painted inProf.C.NagaRaju
1893. YSREC phone: 9949218570
Short Quotations tag: <q>...</q>
The <q>...</q> element is used when you want to add a double quote within a sentence.
Example
<!DOCTYPE html>
<html>
<head>
<title>HTML blockquote Tag</title>
</head>
<body>
<q>Welcome to html </q>
</body>
</html>
output
“Welcome to html”
Output:
The WHO was founded in 1948.
Tip: This tag is not deprecated. However, it is possible to achieve richer effect by using CSS.
<!DOCTYPE html>
<html>
<body>
<h1>The samp element</h1>
<p>Message from my computer:</p>
<p> <samp>File not found.<br>Press F1 to continue</samp> </p>
</body>
</html>
The samp element
Message from my computer:
File not found.
Press F1 to continue
27/02/2025 Prof.C.NagaRaju YSREC phone: 9949218570
<address> :The HTML <address> tag defines the contact information for the author/owner of a document or an
article.
The contact information can be an email address, URL, physical address, phone number, social media handle, etc.
The text in the <address> element usually renders in italic, and browsers will always add a line break before and after the
<address> element.
Example
<address>
Written by John Doe.<br>
Visit us at:<br> Output:
Example.com<br> The HTML address element defines contact information
(author/owner) of a document or article.
Box 564, Disneyland<br> Written by John Doe.
USA Visit us at:
</address> Example.com
Box 564, Disneyland
USA
Section Divisions
<div> ... </div> Division or Section of Page Content
<span> ... </span>
27/02/2025 Section of text within other content
Prof.C.NagaRaju YSREC phone: 9949218570
Font tag and attributes
<FONT>...</FONT> Changes font attributes for text within the tags
<FONT size=”value”>...</FONT> Sets the font to a size from 1 to 7, with 1 the smallest
and 7 the largest
Optional Attributes
<A HREF=”?” rev=”?”>...</A> Sets up a reverse relationship between the current page and the
linked-to document
27/02/2025 Prof.C.NagaRaju YSREC phone: 9949218570
<HTML> <BODY>
Text link<BR>
<A HREF="http://www.yahoo.com">Click here to visit Yahoo</A> <BR>
<BR>Click on below image to visit my homepage:<BR><BR>
<A HREF="http://www.gmail.com/"><IMG SRC="cnr.jpg" width=50 height=50 border=2></A>
<BR> <BR> Click on below link to send an email to me <BR>
<A HREF="mailto:nagaraju.c@yogivemanauniversity.ac.in">Email Me</A>
<BR> Click on below link to send us your comments. <BR>
<A HREF="mailto:webmaster@learnem.com?subject:comments about your site">Email Me</A>
where to open link _self , _blank,_parent, _top
<a href="https://www.w3schools.com/" target="_blank">Visit W3Schools!</a>
<h2>Relative URLs</h2>
<p><a href=“aa.html">HTML Images</a></p>
<p><a href="/css/default.asp">CSS Tutorial</a></p>
<button onclick="document.location=https://www.w3schools.com/html/html_links.asp»>
HTML Tutorial </button>
<A HREF=“Tel:9949218570"> call me </A>
<a href=“javascript:alert(“helloworld”);">
27/02/2025
java scripts </a>
Prof.C.NagaRaju YSREC phone: 9949218570
Image tag and attributes
<IMG> Embeds an image in the document at the location of the tag
<IMG src=”url” alt=”text” align=”direction”> Aligns an image to the left, right, center, bottom, or top
<IMG src=”url” alt=”text” border=”number”> Sets the size of the border around an image
<IMG src=”url” alt=”text” hspace=”pixels”> Sets a horizontal margin to be placed around an image
<IMG src=”url” alt=”text” vspace=”pixels”> Sets a vertical margin to be placed around an image
• Audio
• <audio controls>
• <source src="sound.ogg" type="audio/ogg">
• <source src="sound.mp3" type="audio/mpeg">
• No audio support.
• </audio>
27/02/2025 Prof.C.NagaRaju YSREC phone: 9949218570
• <IFRAME> tag for accessing YOUTUBE VIDEO
• <html>
• <body>
• hello
• <iframe width="420" height="315"
• src="https://www.youtube.com/embed/tgbNymZ7vqY">
• </iframe>
• </body>
• </html>
There are few drawbacks with using frames, so it's never recommended to use frames in your
webpages −
• Some smaller devices cannot cope with frames often because their screen is not big enough
to be divided up.
• Sometimes your page will be displayed differently on different computers due to different
screen resolution.
• The browser's back button might not work as the user hopes.
• There are still few browsers that do not support frame technology.
• HTML and XHTML support a list style which is called definition lists where entries are
name/value list.
• Definition List makes use of following three tags.
• <dt> - A term
<dl>
<dt><b>HTML</b></dt>
<dd>This stands for Hyper Text Markup Language</dd>
<dt><b>HTTP</b></dt>
<dd>This stands for Hyper Text Transfer Protocol</dd>
</dl>
</body>
</html>
27/02/2025 Prof.C.NagaRaju YSREC phone: 9949218570
• Lists
• <ol> ... </ol>Ordered List
• <ul> ... </ul>Un-ordered List
• <li> ... </li> List Item (within ordered or unordered)
• <ol type="?"> Ordered list type: A, a, I, i, 1
• <ol start="??"> Ordered list starting value
• <ul type="?"> Unordered list bullet type: disc, circle, square
• <li value="??"> List Item Value (changes current and subsequent items)
• <li type="??"> List Item Type (changes only current item)
• <dl> ... </dl>Definition List
• <dt> ... </dt> Term or phrase being defined
• <dd> ... </dd> Detailed Definition of term
27/02/2025 Prof.C.NagaRaju YSREC phone: 9949218570
HTML TABLES
• The HTML tables allow web authors to arrange data like text, images, links,
• The HTML tables are created using the <table> tag in which the <tr> tag is
used to create table rows and <td> tag is used to create data cells
• HTML Forms are required, when you want to collect some data from the site
visitor.
• For example, during user registration you would like to collect information
such as name, email address, credit card, etc.
• A form will take input from the site visitor and then will post it to a back-end
application
• The back-end application will perform required processing on the passed
data based on defined business logic inside the application.
• There are various form elements available like text fields, textarea fields,
drop-down menus, radio buttons, checkboxes, etc.
• This control is used for items that require only one line of user input, such as
search boxes or names. They are created using HTML <input> tag.
First name: <input type = "text" name = "first_name" />
Last name: <input type = "text" name = "last_name" />
• This is also a single-line text input but it masks the character as soon as a
user enters it. They are also created using HTML <input>tag but type
attribute is set to password.
Syntax:
Password: <input type = "password" name = "password" />
• This is used when the user is required to give details that may be
longer than a single sentence. Multi-line input controls are
created using HTML <textarea> tag.
Syntax:
<textarea rows = "5" cols = "50" name = "description">
Enter description here...
</textarea>
1 name
Used to give a name to the control which is sent
to the server to be recognized and get the value.
rows Indicates the number of rows of text area box.
2
cols Indicates the number of columns of text area box
3
1 type
Indicates the type of input control and for
checkbox input control it will be set
to checkbox..
2 name
Used to give a name to the control which is
sent to the server to be recognized and get
the value.
3 value
The value that will be used if the checkbox
is selected.
4 checked
Set to checked if you want to select it by
default.
1 name
Used to give a name to the control which is sent
to the server to be recognized and get the value.
3 multiple
If set to "multiple" then allows a user to select
multiple items from the menu.
1 value
The value that will be used if an option
in the select box is selected.
2 selected
Specifies that this option should be the
initially selected value when the page
loads.
3 label
An alternative way of labeling options
1 name
Used to give a name to the control which is
sent to the server to be recognized and get the
value.
2 accept
Specifies the types of files that the server
accepts.
• Hidden form controls are used to hide data inside the page which
later on can be pushed to the server.
• This control hides inside the code and does not appear on the
actual page.
• For example, following hidden form is being used to keep current
page number.
• When a user will click next page then the value of hidden control
will be sent to the web server and there it will decide which page
will be displayed next based on the passed current page.