WT UNIT-I
WT UNIT-I
HTML:
HYPER TEXT MARKUP LANGUAGE
•Primary scripting language for
developing web pages.
• HTML allows to write instructions
for web pages & web browser
interpret the instructions and render
the web page on the screen.
• HTML documents are written using tags.
Tag is written within angular brackets (< >).
<tag> - opening tag
</tag> - closing tag
Types:
1. Embedded tag – has both opening & closing
tags.
2. Standalone tags – which do not have
corresponding closing tags.
Ex:
1. This is an example for <i>Embedded tag</i>
2. <hr> - inserts horizontal rule.
3. <br>
Element
Attributes: Tags may have properties that can be
optionally assigned to change the behavior of
tags…these are called as Attributes.
• Attributes are place within starting tag.
name= “value”
<html>
<head>
<title>First Program</title>
</head>
<body>
<b>WELCOME to Full Stack
Development-I </b>
</body>
</html>
HTML Comments:
<!-- comment text here -->
HTML background:
Color: <body bgcolor=“yellow”>
Image: <body background=“mypic.jpg”>
TAG DESCRIPTION
<q>…</q> Qutations
<dt>HTTP</dt>
<dd>Hyper Text Transfer Protocol</dd>
<dt>SMTP</dt>
<dd>Simple Mail Tranfer Protocol</dd>
</dl>
Nested Lists:
<ul>
<li>III-I</li>
<ol>
<li>OOAD
LAB</li>
<li>OS LAB</li>
</ol>
<li>III-II</li>
<ol>
<li>WIT LAB</li>
<li>DWDM
LAB</li>
</ol>
<li> I</li>
<ol>
<li>C LAB</li>
<li>ITW LAB</li>
</ol>
EMOJIS IN HTML:
•Emojis look like images, or icons, but they are not.
•They are letters (characters) from the UTF-8 (Unicode)
character set.
• A web browser must know the character set used in
the page.
<meta charset="UTF-8">
Ex:
Select a File:
<input type=“file” name=“f1”><br>
<input type=“submit” value=“upload”>
Button:
-Buttons can be created using <input> tag using
type attribute set to “button”.
-Ex:
-<input type=“button” value=“LOGOUT”>
-Or
-<button> LOGOUT</button>
Action Buttons:
-2 types of buttons used in all forms: submit
reset
•Submit: is used to send information to the
server script whose URL is specified the action
attribute of form tag.
<input type=“submit” value=“SEND”>
•Reset :when clicked form fields are assigned to
their default values.
Layout:
The Orientation and relative size of frames
specified using rows and cols attributes of
frame element.
cols - used to create frames vertically.
rows - used to create frames
horizontally.
Main.html
<frameset rows=“40%,60%”>
<frame name=“top” src=“top.html”>
<frameset cols=“40%,60%”>
<frame name=“left” src=“left.html”>
<frame name=“right” src=“right.html”>
</frameset>
</frameset>
Target Attribute:
-The value of target attribute refers to the frame where the
document is to be loaded.
-<head>
- <title>top frame program</title>
-</head>
-<body bgcolor="blue">
-<center><h1>SANTHIRAM ENGINEERING COLLEGE
</H1></center>
-<marquee>Welcomes U to Dept of CSE......</marquee>
-</body>
-</html>
<html>
Left.html
<head>
<title>left frame</title>
</head>
<body>
<a href="http://www.google.com" target="right">
GOOGLE</a> <br>
<br>
<a href="http://www.gmail.com" target="right">GMAIL</a>
</body>
</html>
<html>
RIGHT.HTML
<head>
<title>right frame</title>
</head>
<body>
<br>
<br>
<center><h2 style="color:red"> WELCOME TO
SREC </h2></center>
</body>
</html>
Inline frames or iframes or
Floating frames:
• Inline frames allows us to insert a frame even
with in a block of text.
•May contain other web pages, images.
•Iframes are created by using <iframe> tag.
•If not supported by browser …
than…
<iframe>
Your Browser not supports this ifrmaes
</iframe>
Ex:
<iframe src=“sample.html” width=“100”
height=“200”>
Try in another browser
</iframe>
<iframe src=“aa.png”>
Try in another browser
</iframe>
CSS
(CASCADING STYLE SHEET)
• to improve and change the appearance of
web pages.
•If we write style information in web
pages…….complexity increases.
A Style sheet is a document that contain style
information about one or more documents.
Advantages:
• easy to develop
• written once and used for multiple documents.
Document
Content Style
Types:
<html>
<head>
<title>right frame</title>
<link rel="stylesheet" type="text/css” href="mystyle.css"/>
</head>
<body>
<h1> WEB & INTERNET TECHNOLOGIES</h1>
</body>
</html>
body { mystyle.css
background-color: red;
}
h1 {
color: navy;
margin-left: 20px;
}
color:red;
text-align:center;
text-decoration:underline;
text-transform:lowercase;
text-indent:50px;
font-style:oblique;
font-size:30px;
margin-top:100px;
2. Embedded Style Sheet:
Ex:
<style>
p{
color:green;
}
</style>
Example:
<html>
<head>
<title>Example2</title>
<style>
p
{ color:green;}
</style>
</head>
<body>
<p>SREC</p>
</body>
</html>
3. Imported Style sheet:
importing a style sheet is to use @import statement.
It allows importing a style sheet from another style
sheet.
Import statement should be written with in <style>
tags in HTML Document.
Ex: <style>
@import url(“style1.css”);
</style>
4. Inline Style sheets:
Ex:
< p style=“color:red”> SREC, Nandyal</p>
To resolve conflicts…….
body { background-color:red; }
selelctor Declaration
Specifies which HTML elements Specifies what the effect will be.
are affected by this style rule. Property:value ;
Selectors
Equivalent to …..
h1,h2,h3 { color:red;}
2. Type Selector:
Ex: p { color:green ;}
3. Universal Selectors:
CSS has special selector * , matches every single
element in the document.
Ex:
* {color:red; }
4. Descendant Selectors:
also called contextual selectors.
It Selects only those elements that are descendants of a
specified element.
These consists of more than 1 simple selector separated
by white space.
Ex: p b {color:blue;}
p i b {color:red;}
5. Child Selectors:
Ex:
<p>This <b> is</b> a <i> <b>Paragraph </b></i> </p>
p > b { color:red; }
……….selects only first <b> element.
but descendent selector matches both……….
Ex:
Format:
selector:pseudo class{declaration }
:first-child - selects all elements that are the
children of ant element.
:last-child
:only-child
Ex:
<ul>
<li>CSE</li>
<li>ECE</li>
<li>EEE</li>
</ul>
li:first-child {color:red;}
Links:
we can apply styles to links.
<a> - anchor tag
:link
:visited
:hover
:active
:focus
Ex:
a:hover { color:red;}
a:focus { color:yellow;}
<a href=“https://www.google.com”>
GOOGLE</a>
Pseudo Elements:
:first-line
:first-letter
Ex:
P:first-line{text-decoration:underline;}
P:first-letter{font-sixe:200%;float:left;}
Background image:
body {
background-image: url(“aa.png");
}
XHTML
XHTML stands for Extensible Hypertext Mark-up
Language .
XHTML is almost identical to HTML
XHTML is stricter than HTML
XHTML is HTML defined as an XML application
XHTML is supported by all major browsers
The XHTML 1.0 is the first document type in the
XHTML family.
XHTML combines strength of HTML and XML.
What is XML?
---To communicate with a web server, web clients need to specify the
socket address of the web server.
URL and its Anatomy:
A Resource on the web is identified by an address called Uniform
Resource Locator(URL).
URIs (Uniform Resource Identifiers) identify resources on the
Internet.
URIs that start with http:// are called URLs (Uniform Resource
Locators).
If you know the URL of a publicly available resource anywhere
on the web, you can enter that URL into a web browser‘s address
field and the browser can access that resource.
•A URL contains information that directs a browser to the
resource that the user wishes to access.
•Web servers make such resources available to web clients
Host:
•This is the Fully Qualified Domain Name(FQDN) or the IP
address of the computer where web server runs.
• The Domain name is assigned to a host according to DNS.
• A FQDN consists of a series of domain levels seperated by
dots.
Ex: Case insensitive
www.google.com
Path:
• This is location of a file or a program.
Params:
• It contains parameters to be passed to web applications.
• The path and params are seprated by ?
• the params consists of name=value pair separated
by &.
Ex: login=ukr&sid=15465&page=ibox
Anchor:
• this part indicates a specific location in the web
page.
Ex: #appendix ….specifies appendix section
of webpage.
The location is created using <a>.
Ex:
http://www.it.jusl.ac.in:8080/report.jsp?
type=student&sort=byName
Message Format:
6. MOVE:
• It is similar to COPY method except that it deletes the
source file.
7. DELETE:
8. LINK:
9. UNLINK:
Safe and unsafe methods
GET,HEAD,OPTIONS,TRACE
DELETE,MOVE,UNLINK
HTTP version:
- Specifies the version of HTTP protocol being used.
- HTTP/1.0
- HTTP/1.1
RESPONSE MESSAGE:
- Response message is sent by a server to the client.
Parts:
• A Status line
• A Header
• An Empty Line
• Optional body
1. Status Line:
Consists of 3 parts
HTTP version
Status code
Status Phrase
HTTP version : specifies the version of HTTP protocol
being used by the server.
Current version is: HTTP/1.1
Status Code:
- It is a 3 digit code that indicates the status of the
response.
Status are classified in to 5 groups:
/test/demo_form.php?name1=value1&name2=value2
POST:
Usage:
It is used for designing the animated and interactive web pages that
are developed in real-time.
DHTML helps users by animating the text and images in their
documents.
Components of Dynamic HTML:
DHTML consists of the following four components
or languages:
HTML 4.0
CSS
JavaScript
DOM.
Features of DHTML
Its simplest and main feature is that we can create the web page
dynamically.
Dynamic Style is a feature, that allows the users to alter the font,
size, color, and content of a web page.
It provides the facility for using the events, methods, and
properties. And, also provides the feature of code reusability.
It also provides the feature in browsers for data binding.
Using DHTML, users can easily create dynamic fonts for their web
sites or web pages.
With the help of DHTML, users can easily change the tags and their
properties.
Meta tag:
The <meta> tag defines metadata about an HTML document.
Metadata is data (information) about data.
<meta> tags always go inside the <head> element, and are
typically used to specify character set, page description,
keywords, author of the document, and viewport settings.
Metadata will not be displayed on the page, but is machine
parsable.
Metadata is used by browsers (how to display content or reload
page), search engines (keywords), and other web services.
The CSS Box Model
In CSS, the term "box model" is used when talking about
design and layout.
The CSS box model is essentially a box that wraps around
every HTML element.
It consists of: margins, borders, padding, and the actual
content.
<p>The CSS box model is essentially a box that wraps around every HTML
element. It consists of: borders, padding, margins, and the actual content.</p>
<div>content here……...</div>
</body>
</html>