Web Design (HTML) Part-1
Web Design (HTML) Part-1
HTML Frames
P clhck and s e e , p
notrames
Snotrames Ibouy
</frameset
htm
/htm>
irame menul.html
frame menul.html aehaS6 <htm
htmb
cbody bgcolor= "yellow>
<body bgcoloryellow Sa href http://www.google.com target="main _page
a href "http://www.google.com target mmain_ page Google a
Google a
<br
br /P
Colcge
<a hret"http://www.mscw.ac.in
target sell
a hrelhtp://www.mscw.ac.in arget man page
a
College body
<body> Ihtmi
<htmb 7S
Jt Lill epam
A document which can be displayed in a web browser -to help illustrate important topics. spp
such as Firefox, Google Chrome, Opera, Microsoft -as a method to sell products or services to
Website Website
is hosted on one or more servers and can be
Aset of related web pages located under a single domain Website
accessed by visiting its homepage using lnternetcomputer
niame.
web pages.
T h e first page of a website is called nome page
access a website.
need to enter in your browser to
Static Website
Website
fixed tor cach page so the information
The codes are
W e b s i t e s are separated into two different types: change and it looks like a
contained in the page does not
Static websites
- Basic, simple, easy to create
-are ones
-display the
that are fixed and
same c o n t e n t
written exclusively
for
in HTML.
every user, usually
Server
- Clent/roer
Dynamic Website Dynamic Website
collection of dynamic web pages
whose content changes It accesses content from database or Content
more functional
Dynamic website uses client-side scripting or server-sid
content
scripting, or both to generate dynamic
require more work that static websitee
Dynamic Website
Databasels)
Dzne Websil
Stulic Wekle
Aud) d eernger
raquet a r grez dheret HTL fr
e ety Be sne reportbreey
shd ilos e svrs
sonee pbies and The page cortns enersd ade
he cortert a oniy danged ten
spdites the flia (aerds tta ene
abartag
d fC t s
rtt Varagenet 5yten (6) atenan
Ferbity s he man adurtige
SeReA
Most areas where you can input Forms allow us to automate sending and receiving data
information into web
created HTML from a web page.
pages are using forms: entering text or
numbers into a text box, ticking a check box, choosing a
Useful for:
radio button, or selecting an option from a list. Auuehah
website and forum logins;
The form is then usually submitted to the website and the - wseidetailed
-
HTML Forms
HTML Forms
HTML Forms
data.
information
<form name="formExamplel" action= "formaction.php"
methode p o s t .
9/15/2022
3
Input Field form>
Name: input type="text" value"ABC"
<input
-
cb
Email: sinput
-Used to create a
simple text-entry field for form type "text name= "email2" value=
<input type"text" name" name" value="Jon Doe"> Comments: <br
textarea name "comments" cols"25 rows39 textarca
name"-Unique name for the input to be used by the action
SbrP
Script input type submit valuesubmit"
value "-Initial value or data displayed in the input field when form
password, checkbox, radio, file, image, & hidden are among the
submit
most cOmmon
submt
Q2. Create a form with 3 text inputs and
. a n input field takes only S character as input
10
2. Input text with size-3, maxlength
Main Elements
<Input befines a onee pas
passod
Seiec Defnes a submt Bufton to ubmit the fom to senver
textarea
<button set
Del nes a r e e D u a
n p u t ype submit
Inpu ype pas5OWrd Defees to Beect the fleon
bog
cbro User 10
Email: sinput type= "text" name="email" value=" name"user-id" value"user>
SInput type"text
<bp Password:
Comments: <brp input type password namepass" value pass>
textarea name "comments" cols"25" rows"3"> textarea
<bp /lorm
input type"submit" value "hello"
</form>
Name: PasSwoerdom
Email
Comments: as
The characters in a password field are masked (shown
asterisks or circles).
submit
To define a button: m o dh
<input type "submit" value"login
login Reset <input typebutton" value
onclick"alert(you are learming HTML)">
"Click me
"
reset
defines a reset button that Will
sinput type="reset">
all form values to their defaulit values. Click me
the "Reset
values and then click
It you change the input
values
form-data will be reset to the default
button, the This page says
o u are leaming HME
<input type checkbox> defines a
checkbox.
Checkboxes let a user select
ZERO or MORE
limited number of choices. options of a
Input Type Color
Kindly Select your favorite color input type "color> is used for input fields that should
contain a color.
<input type" checkbox " name color
input type"
eheckb0x "
value="red'> Red Depending on browser support, a color picker can
name-"color" value="blue"> blue show up in the input field.
Input type checkb0x namecolor"
value"green>green
<input type=" checkbox "
name"color" value="pink">pink input type="color" name="colorl" value="#fFO000">
Kindly Select your favorite color input type color name "color2" value "Hff0Off°>
Red
blue
green
pink
date picker can -Depending on browser support, the e-mail address can
Depending on browser support, a be automatically validated when submitted.
show up in the input field.
bmail 38aa
Date: mm/dd/yyyy
Please incude an '@in the email address a22 is missing an
Number in nuge of 27 U
than or sgual to 2
a l e m u t be greater
Drop Down LAst Drop Down List
drop-down list, also referred to as a combo-box,
allowing a selection to be made Irom a list of Selection List- <select select
iterms.
muliple attribute - Allows a user to select multiple ftems
pleasecnooecn
India
An option tag 1s necdcd 1or cach item mn the ist and, tmust appear
Africa within the select tags. The tex to be shown lor the option must
html examples
appear between the option tags.
contact me
[please choose one w selected aftribute Sets the detault option that is
10. File
easecnoose one 11. Number
India
Afnica Q2. Create a Drop-down List in the form.
html examples
contactn
UPlease Choose onej
CSS CSS
Cascading Style Sheets The style sheets define the colour, size and position of text and
Preferred way for setting the look and feel of a website other HTML tags
The cascading means that a style applied to a parent element while the HTML files define the content and hOw it
is
will also apply to all children elements within the
parent. organised.
F o r example, setting the colour of body text will mean all Separaling hem alows you to change the colour scherme
headings and paragraphs within the body will also be the same without having to rewrite your entire web site.
colour. CSS
saves a lot of work t can control the layout of multiple
cO pages allat once
1
9/15/2022
Inline-style attribute
The style attribute is just like any other
<style> tag
HTML attribute.
t <p
goes inside the elements beginning tag. right after the style color:bluetont-size:abpx A Dlue
paragraph.
tag
name. p
The attribute starts with style, followed The inline styie above is almost like
by the following CSS rule:
an
equals sign, , p
and then
finally uses double quotes, which contain the
color: blue;
value of the attribute.
font-size: 46px;
style attribute use Css property-value pairs:property:
value YOu can have as
many property value pairs fhe
want.
a5 you rule above works the same
way as our inline style does,
except for one thing- This rule will affect every p on the
whereas trhe
page,
Don't inine styie will affect
forget to include the semicolon; after each pair! only the sp> its written in.
chead> styles:
- HTMLe-mall
'<Style type="text/css"
h1{color: red;} -older websites
</style> -
CMS content (e.g. Word Press, Drupal)
</heads - Dynamic content (i.e. HTML created or changed by
JavaScript
External CSS file External CSS file
Like HTML files, CSS fles are aiso plain text, and nave File style.css can then be inciuded using the <link . tag in
a.css file extension. the HTMLheader
h1(color: red; }
CSs @import directive color: red; Element Colour - e.g. red 1 #FFOO00
<style>
background-color: white; Background Colour of element
@import url('styles.css;
/styles background-Image: uriimage-9if; Background image Ot
This statement tels the browser to fetch a style sheet with the
element
name styies.cs. tne
@import command is quite flexible in that you can create border-color: yellow; Border Colour of element
style sheets that themselves pull in other style sheets, and so
border: 1pxsolid blue; Width, style and colour of border
n.
You need to just make sure that there are no <style> or defined together
s/style tagS in any of your external style sheets, or they will
t work
Font Size or Helght - eg 12pt | 15px margin-top: 1px; Top Margin. Also try -bottom: left: or -right
font-size: 16pt;
padding:5px Padding-distance between an elements
font-weight:bold;
Font Weight (Boldness)- eg, bold
contents and its border
normal | 200
DOM
Docunment Object Model- In the
webpages are reterred to as documents.
world of web, all HTML DOM
The Document
Object Model represents each of these web It defines the logical structure of documents and
pages ih a
tree-like structure to make it
easier to access and mana8e the elements.
The way a document is accessed and manipulated.
HTML DOM is an
Object Model for HTML. It defines:
with the DOM, programmers can create and build
-
Methods for all HTML elements Anything found in an HTML or XML document can be
-
Events for all HTML elements accessed, changed, deleted, or added using the DOM, with a
The nodes present at the bottom are called "leaves and are
Text hader
usually filled with elements attributes, values and events
DOM The Document Object Model represents this table like this:
</TABLE
Sere
JavaScript
JavaScript
Today, JavaScript can execute not only in the browser, but also
Javoscript was created to make web pares alive on the server, or actualy on any deviIce that has a special
When Javascript was created, it initially had another name: program called the Javaacript engine.
an embedded engine sometimes called a
"Liveacripf The browser has
would help. -
It does not
Modern Javaacript is a "safe programming language.
because it was
1. Full integration with HTML/CSS.
low-ievel access to memory or CPu,
provide
browsers which do not require it. 2. Simple things are done simply.
initialy created for
default.
In-browser Javaacript is able to: 3. Support by all major browsers and enabled by
HTML to the page, change the existing content
-
Add new
messages
Remember the data on the ciientside focal storoEe
JavaScript Syntax
JavaScript
a
set of rules that define
The syntax of Javascript is the
scripts.
in this language are called program.
T h e programs correctily structured Javaacript
run
written right in a web page's HTML and statements that are placed
They can be A Javaacript consists of Javaacript
in a web page, or
the loads. HTML tags
automatically as page within the escripb/scriptb
plain text. They don't extension.
are provided
and executed as within the external Javaacript file having Js
Scripts
to run.
preparation or compilation
need special
another
different from
Javaacript is very
In this aspect,
x=5
a rry= 10;
var sum x + Y :
amulti-line comment begins with a slash and an asterisk U) Variables are fundamental to all programming languages.
and ends with an asterisk and slash (") Variables are used to store data, like string of text, numbers,
<script
The data or value stored in the variables can be set, updated,
This is my
and retrieved whenever needed.
tirst program
I n general, varíables are symbolic names for values.
in Javascript
document.write("Hello Worldl")
/scriptp
JavaScript Variable
create a
variable with the var keyword,
Declaring Multiple Variables at
can also
Once
whereas the assignment operator ()is used to assign value to declare multiple variables and set their initial
a variable, in a single statement. values
like this: var varName =value; Each variable should be separated by commas
var name =
"Peter Parker";
var age;
Data Types
Data Types
Specify what kind of data can be stored and
manipulated
within a program. Primitive data
types can hold only one value at a
time,
There are six basic data whereas composite data
types in Javascript which can be types can hold collections of values
divided into three main categories: and more
complex enuties.
primitive (or primary)-String. Number, and Boolean string data type is Used to
represent textual data (.e.
sequences of characters).
composite (or reference)
Strings are created usin8 Singie
Object, Array, and Function (which are all types of Of double quotes
Surrounding one or more characters
objects)
special data types- Undefined and Null -var a=Hellot; //using singie quotes
-var b= Welcome";/using double quotes
9/15/2022
Cotials
Data Types Data Types
alert(15/0:l/Output: Infinity
Number Data Type
alert(-16/0: //Output: -Infinity
-var a= 25;I/ integer
text" 7 2: //Output: NaN
- var b 80.5;// floating8-point number alertt some
values: true o r fais.
Boolean data type can hold only two
v a r cw 4.25e+6;// exponential notation, same as 4.25e6 or
fn a
as a result of comparisons
B o o l e a n values also come
4250000
same as
prograrm.
var d 4.25e-6; I exponential notation,
vara 2, b=5,cml0
0.00000425 true
values which
alert[b > a) / Output:
* N u m b e r data type also includes some special
alertb> c/output: false
are: Intinity, -infinity and NaN
string () or 0, it is simply
t is not equlvalent to an empty
nothing
s e f(daycorweek e 0)
var cities = ['London", Paris", "New York"J;
alertl Have anice
(alertHave a nilce Sunday7
alert(colors0l)}; // Output: Red
else (alert("Have a nice
alert[cities[2); // Output: New York duay