HTML
HTML
HTML
to
HTML
What is HTML
• With HTML you can create your own Web site.
HTML XML
HTML Elements and Tags
• HTML tags normally come in pairs like <HTML> and </HTML> i.e.
Start tag = <HTML> End tag =</HTML>
• Start and end tags are also called opening tags and closing tags
HTML
• Write html code in notepad.
• Save the file with (.Html)/(.Htm) extension.
• View the page in any web browser viz. INTERNET EXPLORER,
NETSCAPE NAVIGATOR etc.
• The purpose of a web browser (like internet explorer or firefox) is to
read html documents and display them as web pages.
First code with HTML
<!DOCTYPE html>
<HTML>
<HEAD>
<TITLE>
MY FIRST PAGE
</TITLE>
</HEAD>
<BODY>
Hello World
</BODY>
First code with HTML explain
The attribute bgcolor is used for changing the back ground color
of the page.
<body bgcolor=“Green” >
ext is use to change the color of the enclosed text.
<body text=“White”>
Text Alignment Tag
It is use to alignment of the text.
1.Left alignment <align=“left”>
2.Right alignment <align=“right”>
3.Center alignment <align=“center”>
Hyperlink Tag
• The HTML anchor tag defines a hyperlink that links one page to
another page. It can create hyperlink to other web page as well as
files, location, or any URL. The "href" attribute is the most important
attribute of the HTML a tag. and which links to destination page or
URL.
• HTML comments are placed in between <!-- ... --> tags. So, any
content placed with-in <!-- ... --> tags will be treated as comment
and will be completely ignored by the browser.
<!DOCTYPE html>
<html
<head>
<title>Valid Comment Example</title>
</head>
<body>
<!-- This is valid comment -->
<p>Document content goes here.....</p>
</body>
</html>
HTML - Images
• You can set image width and height based on your requirement using width
and height attributes. You can specify width and height of the image in terms
of either pixels or percentage of its actual size.
• It is not difficult to put an HTML email link on your webpage but it can cause
unnecessary spamming problem for your email account. There are people,
who can run programs to harvest these types of emails and later use them
for spamming in various ways.
• You can define an inline frame with HTML tag <iframe>. The <iframe> tag is
not somehow related to <frameset> tag, instead, it can appear anywhere in
your document. The <iframe> tag defines a rectangular region within the
document in which the browser can display a separate document, including
scrollbars and borders. An inline frame is used to embed another document
within the current HTML document.
• The background attribute can also be used to control the background of an HTML
element, specifically page body and table backgrounds. You can specify an image to set
background of your HTML page or table.
• Note − The background attribute deprecated in HTML5. Do not use this attribute.
• Note − All the browsers does not support rgb() property of color so it
is recommended not to use it.
HTML - Forms
• 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 such as CGI, ASP Script or PHP script etc. The
back-end application will perform required processing on the passed
data based on defined business logic inside the application.
HTML – Forms contd..
</form>
Checkbox Controls
<form>
<input type = "checkbox" name = "maths" value = "on"> Maths
<input type = "checkbox" name = "physics" value = "on"> Physics
</form>
• Sometimes you need to add music or video into your web page. The easiest
way to add video or sound to your web site is to include the special HTML
tag called <embed>. This tag causes the browser itself to include controls for
the multimedia automatically provided browser supports <embed> tag and
given media type.
• You can also include a <noembed> tag for the browsers which don't
recognize the <embed> tag. You could, for example, use <embed> to display
a movie of your choice, and <noembed> to display a single JPG image if
browser does not support <embed> tag.
HTML - Marquees
• Note − The <marquee> tag deprecated in HTML5. Do not use this element,
instead you can use JavaScript and CSS to create such effects.
</style>
</head>
<body>
</body>
</html>
HTML - JavaScript
• A script is a small piece of program that can add interactivity to your website. For
example, a script could generate a pop-up alert box message, or provide a dropdown
menu. This script could be written using JavaScript or VBScript.
• You can write various small functions, called event handlers using any of the scripting
language and then you can trigger those functions using HTML attributes.
• Now-a-days, only JavaScript and associated frameworks are being used by most of the
web developers, VBScript is not even supported by various major browsers.
<!DOCTYPE html>
<html>
<head>
<title>Javascript External Script</title>
<script src = "/js/script.js" type = "text/javascript"/></script>
</head>
<body>
</body>
</html>