Professional Documents
Culture Documents
HTTP
The machine where the Web site actually resides is called a Web
server.
The web pages and related resources are stored into the central computer
and these files to be read over TCP/IP is called web server.
The server computer runs special software called web server that do:
Website Management
Receive Clients Requests and Respond to a client’s request by
providing the page.
When we send a request for a Web page by entering a Web site address,
this request is sent to a Web Server. The Web server then sends the Web
page to your browser.
In the case of the Internet, the web server and browser are usually on
two different machines, possibly many miles apart. However, in a more
local situation, we might set up a machine that runs the web server
software, and then use a browser on the same machine to look at its web
pages.
Computers that offer the facility to read information stored in the web
pages are called Web Clients.
Advantages Disadvantages
Easy- It is super easy to learn and Complexity- A lot of code can be
use. complex to handle
Independent- It is a platform- Security- It is not secure on its own.
independent language which means it You need third-party services to
can work across all devices. provide more security.
Industry Standard- Accepted by all Limitations- Alone HTML does not
modern browsers like Chrome, Safari, have many capabilities. Html alone
Opera, etc can create basic web pages.
Not Centralized- Each page should be
Simplicity – The coding structure is
programmed separately. It is one of
very simple to understand
the biggest disadvantages.
HTML is simple to edit as is plain Dynamic Pages- Creating dynamic
text. pages is hard. By default all HTML
pages are static.
Write Code- You have to write code
Embed Media- Easily embed audio,
for the simplest web pages. It can be
video, photos, and other types of
a problem if a website has a lot of
media files.
pages.
Structure of HTML
<!DOCTYPE html>
<html>
<head>
<title>
</title>
</head>
<body>
</body>
</html>
What is Tag?
A tag is said to be a paired tag if they have both Opening Tag and the Closing
Tag. Paired tags are also known as Container Tags.
Example#
<b>Hi i am Shyam </b>
2. Unpaired Tags
An unpaired tag does not have a companion tag. Unpaired tags are also known
as Singular or Stand-Alone Tags.
Example#
<br> , <hr>
What is Element?
An element in HTML usually consist of a start tag <tag name>, close tag </tag
name> and content inserted between them.
Such as:
<title>WebPage</title>
Comment Tag:-
You can add comments to your HTML source by using the following syntax:
<p>This is a paragraph.</p>
<!DOCTYPE> Declaration
<HTML> Tag
USE: HTML tag represents the root of html document, holding all the
content of an HTML document, and it also tells the browser that
you're using HTML.
<head> tag
Metadata is the data about the HTML document. Metadata is not displayed.
Metadata is typically define the document title, character set, style, scripts
and other meta information.
<title>
<style>
<base>
<link>
<meta>
<script>
<noscript>
1) Title Example:
<!DOCTYPE html>
<html>
<head>
<title>Welcome to HTML</title>
</head>
<body>
</body>
</html>
<title> tag
USE: The <title> tag defines the title of the document. The title must be
text only and it is shown in browser’s title bar.
You can have more than one <title> element in HTML document.
2)<Style >
The <style> tag in HTML helps us to modify our text, viewed in the page. This
modification includes changing font size, font family, font color etc. Not only
the texts but also we can change the style of a body ar part of a page. Now
let’s look at various attributes of style and what else the tag supports.
Syntax:
<tagname style="property:value;">
The tagname includes <p>, <body>, from <h1> to <h6> etc.
The property is borrowed from CSS like color, font-size, font-family
etc.
The value is also borrowed from CSS.
1)HTML Font Family: The font family changes the font style of a text and can
be used in any text writing tag like <p> or heading tag.
<html>
<head>
<title>Font Family</title>
</head>
<body>
<h1 style="font-family:commanders;">Welcome to HTML.</h1>
<h2 style="font-family:Chaparral Pro Light;"> Welcome to HTML.</h2>
<h3 style="font-family:algerian;"> Welcome to HTML.</h3>
<p style="font-family:Castellar;"> Welcome to HTML.</p>
</body>
</html>
2)HTML Font Size: The font size changes the size of a text and this can also
be used in any text writing tag like <p> or heading tag. The units can be given
in “%” or pixels or other units can also be included.
Example:
<html>
<head>
<title>Font Size</title>
</head>
<body>
<h1 style="font-size:80%;"> Welcome to HTML..</h1>
<h2 style="font-size:150%;"> Welcome to HTML..</h2>
<h3 style="font-size:20px;"> Welcome to HTML..</h3>
<p style="font-size:30px;"> Welcome to HTML..</p>
</body>
</html>
3)HTML Font Color: The font color tag changes the color of a text and can be
used in any text writing tag like <p> or heading tag. We can use both name of
the colors or also the color codes that is mainly used in Photoshop. For various
color codes or to pick from various color ranges refer HTML Color Codes .
Example:
<html>
<head>
<title>Font Color</title>
</head>
<body>
</html>
4)HTML Text Align: The text alignment tag is used to change the alignment
of a text including centre, left or right alignment.
Example:
<html>
<head>
<title>Text Align</title>
</head>
<body>
<h1 style="text-align:left;"> Welcome to HTML.</h1>
<h2 style="text-align:center;"> Welcome to HTML.</h2>
<p style="text-align:right;"> Welcome to HTML.</p>
</body>
</html>
<html>
<head>
<title>Background Color</title>
</head>
<body style="background-color:#616A6B;">
<h1 style="font-family:commanders;
background-color:yellow;">Hello GeeksforGeeks.</h1>
<h2 style="font-family:algerian;
background-color:cyan;">Hello GeeksforGeeks.</h2>
<p style="font-family:Castellar;
background-color:green;">Hello GeeksforGeeks.</p>
</body>
</html>
3)Base:-
The <base> tag specifies the base URL and/or target for all relative URLs in a
document.
Syntax:
<base href = "SAMPLE_URL">
Example:-
Specify a default URL and a default target for all links on a page:
<head>
</head>
<body>
</body>
4)Link
A hyperlink (or link) is a word, group of words, or image that you can click on to
jump to another document.
When you move the cursor over a link in a Web page, the arrow will turn into a
little hand.
The most important attribute of the <a> element is the href attribute, which
indicates the link’s destination.
Absolute path contains parent folders and directory information. It needs to define whole
path for hyper link in the HREF attribute
RELATIVE
With Image
<a href="url"><img src=’path’></a>
Example:
<!DOCTYPE html>
<html>
<body>
<h1>The a href attribute</h1>
</body>
</html>
By default, the linked page will be displayed in the current browser window. To
change this, you must specify another target for the link.
Example:
<!DOCTYPE html>
<html>
<body>
<p>If target="_blank", the link will open in a new browser window or tab.</p>
</body>
</html>
5)Meta:-
HTML <meta> tag is used to represent the metadata about the HTML document.
It specifies page description, keywords, copyright, language, author of the
documents, etc.
The metadata does not display on the webpage, but it is used by search engines,
browsers and other web services which scan the site or webpage to know about
the webpage.
With the help of meta tag, you can experiment and preview that how your
webpage will render on the browser.
The <meta> tag is placed within the <head> tag, and it can be used more than
one times in a document.
Example:-
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
</body>
</html>
Common uses for JavaScript are image manipulation, form validation, and
dynamic changes of content.
Example:-
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1> JavaScript Tutorials</h1>
<script>
//write JavaScript code here..
alert('Hello, how are you?')
</script>
</body>
</html>
<body> tag
USE: The <body> tag defines the document’s body. The <body> element
contains all the contents of HTML document such as headings,
paragraphs, images, hyperlinks, tables, lists etc.
Syntax:
<body> Body Contents... </body>
What is Attributes:
Syntax:
<element attribute_name="value">content</element>
Example:
1. <!DOCTYPE html>
2. <html>
3. <head>
4. </head>
5. <body>
6. <h1> This is Style attribute</h1>
7. <p style="height: 50px; color: blue">hello welcome to html </p>
8. <p style="color: red">It will change the color of content</p>
9. </body>
10. </html>
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
</body>
</html>
Or
<!DOCTYPE html>
<html>
<body>
<h1 style="background-color:Red;">red</h1>
<h1 style="background-color:pink;">pink</h1>
</body>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<h2>Background Image</h2>
</body>
</html>
Introduction to HTML 5
HTML 5 is the fifth and current version of HTML. HTML5 is not only a new
version of HTML language enriched with new elements and attributes, but a set
of technologies for building more powerful and diverse web sites and
applications, that support multimedia, interact with software interfaces, etc.
Advnatage of HTML5:-
DisAdvantage of HTML5:
It supported only by modern browsers.
You must write long code which is time-consuming.
Structure of HTML 5
<body>
<header>...</header>
<nav>...</nav>
<article>
<section>
...
</section>
</article>
<aside>...</aside>
<footer>...</footer>
</body>
<section>
We can think section is like group in which particular information will display.
Example #
<section id="about_us_info">
<h1> heading </h1>
<p> some data </p>
</section>
<section id="contact_info">
<h1> heading </h1>
<p> some data </p>
</section>
<article>
If under an article we have comments, we can use an article tag for the main
post and have inside of it an article tag for each comment.
Example#
<article class="article">
<p>article, some text</p>
<article class="comment"><p>comment 1</p></article>
<article class="comment"><p>comment 2</p></article>
<article class="comment"><p>comment 3</p></article>
<article>
<aside>
We can show content related to that article but not part of the main flow.
Example#
<section id="main_content_info">
<h1> heading </h1>
<p> some data </p>
</section>
<aside id="top_5songs_list">
some data
</aside>
<header> <footer>
<header> as the name suggest ,The <header> tag can be used to group header
information, of a whole document or an article, inside a document. <footer> tag
typically contains the author of the document, copyright information, links to
terms of use, contact information, etc.
We can have multiple header and footer tags in one page, of different section.
Each article could have it's own header.
Example#
<section id="page">
<header>the page header content</header>
<article>
<header>the article header</header>
<footer>the article footer</footer>
</article>
</section>
<footer>the page footer content</footer>
<nav>
As the name suggess ,the nav section tag is used to delimiter a navigation area of
your document.
Example#
<body>
<header>
<nav>
<ul>
<li>navigation button 1</li>
<li>navigation button 2</li>
<li>navigation button 3</li>
</ul>
</nav>
</header>
</body>
Example 2:
<html>
<head>
<title>Nav Tag</title>
<style>
a{
text-decoration: none;
color: green;
font-size: 20px;
padding: 8px;
a:hover{
color: blue;
}
h1{
text-align: center;
</style>
</head>
<body>
<nav>
<a href="#">Home</a> |
<a href="#">Courses</a> |
<a href="#">About-us</a> |
<a href="#">Contact-us</a> |
</nav>
</body>
</html>