SlideShare a Scribd company logo
Introduction to We b Te chnologie s
pre s e nte d
by

Ve nka t pina ga di
S ha me le s s P lug
Owne r, Hype rTra in dot Com
S a n Die go ba s e d, but do mos tly ons ite
work plus confe re nce s
Tra in & cons ult on He lp Authoring
Tools a nd re la te d te chnologie s :
J a va S cript, HTML, CS S , DHTML,
Inte ra ctivity, We b-ba s e d He lp, e tc.
Uncle Da ve 's motto: "Ca ll me
a nytime ."
888-722-0700, dga s h@hype rtra in.com
P re s e nta tion Ove rvie w
Look a t ma in te chnologica l
compone nts tha t ma ke up mode rn
We b pa ge s
HTML – Hype rTe xt Ma rkup La ngua ge
CS S – Ca s ca ding S tyle S he e ts
J a va S cript – um, J a va S cript

For e a ch compone nt
Wha t it is /is n't, ca n/ca n't do
Wha t kinds of cons tructs it compris e s
How to us e it in We b pa ge s
How it inte ra cts with othe r compone nts
HTML Compone nts
Docume nts
Docume nt = pa ge = HTM file = topic
Conte nt (te xt, ima ge s )
Ta gs (dis pla y comma nds )

Othe r te rms
Window: brows e r dis pla y window
URL: Uniform Re s ource Loca tor
Hype rlink: hype rte xt jump to a re s ource
Re s ource : URL, ima ge , ma ilto, e xte rna l
file
HTML P a ge s
HTML pa ge s a re ta g-ba s e d
docume nts
Re a lly pla in AS CII te xt file s
Don't look like docume nts the y re pre s e nt
Ta gs indica te how proce s s ing progra m
s hould dis pla y te xt a nd gra phics
De s igne d to de s cribe hype rte xt, not pa pe r
P roce s s e d by brows e rs "on the fly"
Ta gs us ua lly a ppe a r in pa irs
Mos t ha ve re a s ona ble na me s or
mne monics

Tha t's How This ...
<HTML>
<HEAD>
<BODY background="slate.gif">
<H1>Welcome</H1>
<IMG SRC="DOUGLAS.GIF" WIDTH="80" HEIGHT="107"
ALT="Our Founder" BORDER="0">
<H2>A Message from the President </H2>
<P><font color=red>Good evening! Thank you for
working late!</font></P>
<P>Hello and welcome to DougCo, Incorporated! I'm
<b>Douglas S. Michaels,</b> President and Founder,
<a href="acronyms.htm">COB, CEO, COO, and
BBBWAIC</a>. Let me take this opportunity to
congratulate you on obtaining employment here at
DougCo; I want you to know that you've chosen to
spend your career in one of the most worthwhile and
rewarding endeavors possible --making me richer!</P>
. . .
...Turns Into This
S ome HTML Ta g Exa mple s
S
TAR TAG
T

<HTML>
<HEAD>
<TITLE>
<BODY>
<H1>, <H2>, ...
<IMG ...>
<A ...>
<P>
<BR>
<OL>
<UL>
<LI>

E TAG
ND

</HTML>
</HEAD>
</TITLE>
</BODY>
</H1>, </H2>, ...
</IMG> (optional)
</A>
</P>
(optional)
(none; "empty" tag)
</OL>
</UL>
</LI> (optional)
HTML Docume nt La yout
Exa mple of ba s ic ta g pos itioning
<html>
<head>
<title>Title bar text</title>
</head>
<body>
<p>Look, I'm a paragraph!</p>
</body>
</html>

Alwa ys think c o nta ine rs !
Ta g pa irs tha t e nclos e conte nt
S ome Common Te xt Ta gs
He a ding le ve ls
h1 – h6, numbe rs inve rs e to te xt s ize
<h1>Heading One</h1>
<h2>Heading One</h2>

P a ra gra ph
P roba bly the mos t common ta g
<p>Yada yada yada...</p>

Line bre a k (a n e mpty ta g)
Us e d whe n <p>'s white s pa ce not wa nte d
This line will break<br>right there

Note white s pa ce or la ck the re of in
HTML s ource does not m
atter!
Orde re d & Unorde re d Lis ts
Orde re d (numbe re d)
Us e <ol>...</ol> ta gs

Unorde re d (bulle te d)
Us e <ul>...</ul> ta gs

Lis t Ite ms ma ke up both lis ts
Us e s a me <li>...</li> ta gs

Lis ts ca n conta in a lmos t a nything
Te xt, ima ge s , pa ra gra phs , links
Eve n othe r (ne s te d) lis ts , s a me type or
not
Attribute s a nd Va lue s
P rope rtie s , tra its , or cha ra cte ris tics tha t
modify the wa y a ta g looks or a cts
Us ua lly in pa irs : <body bgcolor="teal">
S ome time s not: <dl compact>

Mos t HTML ta gs ca n ta ke a ttribute s
Forma t of va lue de pe nds on a ttribute
 width="150" ... href="page3.htm" no t
width="page3.htm" ... href="150"
The Anchor Ta g

(1)

The ta g tha t puts the HT in HTML
<a > ... </a > (us e le s s by its e lf)
Mus t ha ve a ttribute s to be us e ful

HREF (Hype rte xt REFe re nce ) a ttribute
Ma ke s a jump to s ome pla ce (URL)
<a href="mypage.htm">My Page</a>
<a href="www.google.com">Google</a>

Link te xt is unde rs core d by de fa ult

W
hatever is be twe e n <a > a nd </a >
is hot (clicka ble )
Clicking ma ke s the link go s ome whe re
or do s ome thing
The Anchor Ta g

(2)

S ome link e xa mple s

te xt only
ima ge only
both
Ima ge s

(1)

Us e d in pa ge s for va rious re a s ons
Cla rifica tion, na viga tion, pe riphe ra l
tra ining

Ima ge s not in pa ge ; re fe re nc e d by
pa ge
Gra phics a re s e pa ra te , re quire d file s
Us ua lly GIFs or J P Gs , s ome time s othe rs
Ca n be a nywhe re in docume nt body: in
pa ra gra phs , he a dings , lis ts , a nchors , e tc.

P la ce ima ge with <img> ta g
Like <a >, <img> is us e le s s by its e lf
Ima ge s

(2)

Ma in a ttribute : S RC
Te lls pa ge whe re to find the ima ge
File na me ca n be loca l, re la tive , or full
Ca s e s e ns itivity de pe nds on s e rve r
Anima te d GIFs a dde d s a me a s s ta tic
<img src="smiley.gif">
<img src="./pix/mypic.jpg">
<img src="http://www.myweb.com/mail.gif">
Ta ble s

(1)

P owe rful, fle xible informa tion de live ry
Us e d to re fle ct or impa rt s tructure

A ta ble is a conta ine r
<table> ... </table>

Tha t conta ins othe r conta ine rs (rows )
<tr> ... </tr>

Tha t conta in othe r conta ine rs (ce lls )
<td> ... </td> (data cells)
<th> ... </th> (heading cells)

Tha t conta in da ta – or othe r conta ine rs
Te xt, gra phics , lis ts , e ve n othe r ta ble s !
Ta ble s

(2)

Ba s ic ta ble ma rkup
<table border="1">
<tr>
<td>Row 1, Cell 1</td>
<td>Row 1, Cell 2</td>
</tr>
<tr>
<td>Row 2, Cell 1</td>
<td>Row 2, Cell 2</td>
</tr>
Row 1, Cell 1 Row 1, Cell 2
</table>
Row 2, Cell 1 Row 2, Cell 2
CS S Conce pts
S tyle s a re na me d s e ts of forma tting
comma nds
[18pt, Aria l, le ft a ligne d] "S e ction he a d"
[Bold, ita lic, blue ] "Glos s a ry te rm"
[Norma l, 10pt, Ve rda na ] "Body te xt"
[Ita lic, ora nge , s ma ll ca ps ] "Bob"

S tyle s he e ts a re control docume nts
tha t a re re fe re nce d by conte nt
docume nts
MS Word, othe r e ditors & de s ktop
publis hing progra ms ha ve done it for ye a rs
Why Us e CS S ?
HTML forma tting is a wkwa rd a nd
impre cis e
Origina lly inte nde d to de live r we ll
orga nize d te xt (a ime d a t s tructure , not
forma tting)
Ove r time , forma tting e le me nts we re
a dde d tha t s olve d s ome proble ms , but
cre a te d ma ny more

W3C propos e d Ca s ca ding S tyle
S he e ts
S e pa ra te forma t from conte nt
Enforce cons is te ncy
Wha t's "Ca s ca ding" All About?
Thre e pla ce s to put s tyle comma nds
 Exte rna l: Affe cts a ll docume nts it's a tta che d
to
 Inte rna l: Affe cts only docume nt it a ppe a rs in
 Inline : Affe cts only te xt it's a pplie d to

Ca s ca ding me a ns s tyle s ' "pe cking
orde r"
 P re ce de nce is : Inline > Inte rna l > Exte rna l
 S e e ms ba ckwa rd, but it couldn't work a ny
othe r wa y; for e xa mple …
 P icture a docume nt whos e s tyle s he e t
s pe cifie s Ve rda na a s the font, with one
Wha t Ca n CS S Control?
Almos t e ve rything
 P a ge ba ckground, colors , ima ge s , fonts a nd
te xt, ma rgins a nd s pa cing, he a dings ,
pos itioning, links , lis ts , ta ble s , curs ors , e tc.

W3C inte nds CS S to "…re lie ve HTML
of the re s pons ibility of pre s e nta tion."
 Tra ns la tion: "Don't bug us for ne w ta gs ;
cha nge e xis ting ta gs & ma ke your own us ing
CS S ."

Ide a is to put a ll forma tting in CS S
 To tha t e nd, ma ny ta gs a re "de pre ca te d" by
CS S : <font>, <ba s e font>, <ce nte r>,
Coding CS S Rule s
Rule s ha ve ve ry s pe cific pa rts a nd s ynta x
 Rule s ha ve two ba s ic pa rts : s e le ctor a nd de cla ra tion
 De cla ra tion a ls o ha s two pa rts : prope rty a nd va lue
rule
h2 { font-style : italic ; }
property
selector

value

declaration

 S e le ctor te lls the rule wha t to modify
 De cla ra tion te lls the rule how to modify it
CS S Rule P la ce me nt
In a s e pa ra te .CS S file
Affe cts a ll pa ge s to which it is linke d
.CS S re fe re nce d by pa ge s with <link> ta g

In the <he a d> of a n .HTM pa ge
Affe cts only pa ge in which it a ppe a rs
Rule s a re code d in <s tyle ></s tyle >
conta ine r

In a n HTML ta g in pa ge <body>
Affe cts only te xt to which it is a tta che d
De cla ra tions a re code d a s a ttribute =
" v a lue " pa irs , e .g., s tyle ="color: blue ;"
Linking To An Exte rna l CS S
Do not put <s tyle ></s tyle > ta gs in
the .CS S file ; this will pre ve nt it from
working
Add CS S rule s a s ne e de d; bre a k line s
whe re ne ce s s a ry; forma t a s de s ire d
S a ve a s file na m e .cs s
Re fe re nce .CS S in <he a d> of .HTM(s )
<head>
<link rel="stylesheet" type="text/css"
href="mystyles.css">
</head>
Adding S tyle s To A S ingle P a ge
Within docume nt's <he a d>, ins e rt a
<s tyle ></s tyle > conta ine r
Code rule s e xa ctly a s you would in a n
e xte rna l .CS S
<head>
<style>
h2 { font-style: italic; color: red; }
p { font-family: "Verdana, Arial, sansserif"; font-size: 12pt;
color: blue; }
</style>
</head>
Adding S tyle s To An HTML Ta g
Within a ta g's < >, code a n
a ttribute = " va lue " pa ir de fining s tyle
cha ra cte ris tics
Tip: Wa tch out for ne s te d quote s
<h1 style = "font: small-caps bold
italic; font-family: 'Verdana, Arial,
sans-serif'; color: #008080; textalign: center;">Gettysburg Address
(First Draft)</h1>
<p style = "font-family: Times;
color: #800000; font-weight: bold;">
Four score and seven beers ago…</p>
J a va S cript Intro
Wha t J a va S cript is n’t
 J a va (obje ct-orie nte d progra mming la ngua ge )
 A "progra mme rs -only" la ngua ge

Wha t J a va S cript is
 Exte ns ion to HTML (s upport de pe nds on
brows e r)
 An a cce s s ible , obje ct-ba s e d s cripting
la ngua ge

Wha t J a va S cript is for
 Inte ra ctivity with the us e r:
* input (us e r provide s da ta to a pplica tion)
* proce s s ing (a pplica tion ma nipula te s da ta )
* output (a pplica tion provide s re s ults to us e r)
Imple me nting J a va S cript (1)
Dire ct ins e rtion into pa ge (imme dia te )
 In <s cript></s cript> conta ine r within
docume nt he a d or body

Dire ct ins e rtion into pa ge (de fe rre d)
 In <s cript></s cript> conta ine r a nd ins ide
function { … } de finition within docume nt
he a d or body

Through e xte rna l re fe re nce s
 In e xte rna l .js file s (imme dia te /de fe rre d)
 Much like CS S e xte rna l re fe re nce

Embe dde d inline
 Within othe r ta gs (a s a ttribute va lue s )
Imple me nting J a va S cript (2a )
Dire ct ins e rtion into pa ge (imme dia te )
 <body><p>Today is
<script>document.write( Date() );
</script></p>

Dire ct ins e rtion into pa ge (de fe rre d)
 <head><script>
function dwd()
{
document.write( Date() );
}
</script></head>
. . .
<body><p>Today is <script>dwd();
</script></p>
Imple me nting J a va S cript (2b)
Through e xte rna l re fe re nce s
(imme dia te /de fe rre d de pe nds on s cript
file 's conte nts )
 <script src="swapimgs.js"></script>

Embe dde d inline a s a ttribute va lue s
 <img id="pic1" src="somepic.jpg"
onmouseover="swapin('pic1')"
onmouseout="swapout('pic1')">
. . .
<input type="button" value="Buy Now"
onclick="placeOrder('ordform')"
</input>
Ke y La ngua ge Compone nts
Obje cts
 Things on a pa ge ; think no un

Attribute s
 P rope rtie s of obje cts ; think a d je c tiv e

Me thods
 Actions ta ke n by obje cts ; think v e rb

S ta te me nts
 Line s of a s s e mble d compone nts ; think
s e nte nc e

Functions
 Na me d groups of s ta te me nts ; think p a ra g ra p h
P rogra mming Cons tructs
Va ria ble s
 Na me d e le me nts tha t ca n cha nge va lue

Da ta type s
 Inte ge r, floa ting-point, Boole a n, s tring

Ope ra tors
 As s ignme nt, compa ris on, a rithme tic,
Boole a n, s tring, s pe cia l

Control s ta te me nts
 Conditions , loops

Ke ywords
 Re s e rve d words with s pe cia l me a ning
A Fe w J S Exa mple s

(1)

S ome ba s ic J a va S cripts
 To ge t the da y of the month
var day = new Date().getDate();

 To do s ome thing te n time s
for (var x=0; x<10; x++)
{
document.write( x * x );
}

 To ma ke a de cis ion a nd a ct on it
if (username == "Bob")
{ userisknown = true;
displayWelcomeBack(username); }
else
{ userisknown = false;
displayFirstLogin(username); }
A Fe w J S Exa mple s

(2)

S ome more ba s ic J a va S cripts
 To write s ome thing into the pa ge
document.write("<b>Welcome, " +
uname + "</b>");

 To ma ke a ca lcula tion
pcent = score / 100;

 To s how the us e r a me s s a ge box
alert("Score: " + pcent + "%");

 To put s ome te xt on the Windows clipboa rd
mycb = "daveg~armadillo";
clipboardData.setData("Text",mycb);

To force a jump to a nothe r pa ge
window.location="anotherpage.htm";
S umma ry
Mos t We b pa ge s – re mote or loca l –
a re a combina tion of thos e te chnologie s
Ra w conte nt, pla ce d ins ide …
HTML ta gs , forma tte d with…
CS S rule s , inte ra ctivity produce d by…
J a va S cript s cripts

Ne we r te chnologie s like DHTML,
XHTML, a nd XML a re ba s e d on the s e
A little knowle dge now ca n pre pa re you for
ne w te chnologie s a nd he lp you ke e p up
with your pe e rs , your bos s … a nd your kids !


More Related Content

What's hot

An Overview on PROV-AQ: Provenance Access and Query
An Overview on PROV-AQ: Provenance Access and QueryAn Overview on PROV-AQ: Provenance Access and Query
An Overview on PROV-AQ: Provenance Access and Query
Olaf Hartig
 
SEO report for phone-sex-chat.com
SEO report for phone-sex-chat.comSEO report for phone-sex-chat.com
SEO report for phone-sex-chat.com
Soula Menegaki
 
Css 1
Css 1Css 1
Css 1
H K
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
tutorialsruby
 
Makanan halal-haram-2970785
Makanan halal-haram-2970785Makanan halal-haram-2970785
Makanan halal-haram-2970785
khairulamar
 
Eclampsia 4-real-presentation
Eclampsia 4-real-presentationEclampsia 4-real-presentation
Eclampsia 4-real-presentation
Adventist Medical Center-Iligan
 
Bryce Jordan Center E-mail Conf
Bryce Jordan Center E-mail ConfBryce Jordan Center E-mail Conf
Bryce Jordan Center E-mail Conf
Jose L. Rosario Vargas
 
Ocul emergency-presentation
Ocul emergency-presentationOcul emergency-presentation
Ocul emergency-presentation
Mohammed Alabdali
 
Jogos
JogosJogos
Jogos
lionleoo
 
El Tiempo Nos Ensea 214392
El Tiempo Nos Ensea 214392El Tiempo Nos Ensea 214392
El Tiempo Nos Ensea 214392
guestc65f09
 
Los Estados De La Materia
Los Estados De La MateriaLos Estados De La Materia
Los Estados De La Materia
Mayritalinda
 
HTML by Telerik Akademy
HTML by Telerik AkademyHTML by Telerik Akademy
HTML by Telerik Akademy
Ognyan Penkov
 
LEARN HTML IN A DAY
LEARN HTML IN A DAYLEARN HTML IN A DAY
LEARN HTML IN A DAY
AWK Internet Technologies
 
HTTP Strict Transport Security (HSTS), English version
HTTP Strict Transport Security (HSTS), English versionHTTP Strict Transport Security (HSTS), English version
HTTP Strict Transport Security (HSTS), English version
Michal Špaček
 
.htaccess for SEOs - A presentation by Roxana Stingu
.htaccess for SEOs - A presentation by Roxana Stingu.htaccess for SEOs - A presentation by Roxana Stingu
.htaccess for SEOs - A presentation by Roxana Stingu
Roxana Stingu
 
The internet for SEOs by Roxana Stingu
The internet for SEOs by Roxana StinguThe internet for SEOs by Roxana Stingu
The internet for SEOs by Roxana Stingu
Roxana Stingu
 
Web tech html css js
Web tech html css jsWeb tech html css js
Web tech html css js
Chetan Kothari
 
Seo cheat sheet 2013
Seo cheat sheet 2013Seo cheat sheet 2013
Seo cheat sheet 2013
SEOM
 

What's hot (18)

An Overview on PROV-AQ: Provenance Access and Query
An Overview on PROV-AQ: Provenance Access and QueryAn Overview on PROV-AQ: Provenance Access and Query
An Overview on PROV-AQ: Provenance Access and Query
 
SEO report for phone-sex-chat.com
SEO report for phone-sex-chat.comSEO report for phone-sex-chat.com
SEO report for phone-sex-chat.com
 
Css 1
Css 1Css 1
Css 1
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
 
Makanan halal-haram-2970785
Makanan halal-haram-2970785Makanan halal-haram-2970785
Makanan halal-haram-2970785
 
Eclampsia 4-real-presentation
Eclampsia 4-real-presentationEclampsia 4-real-presentation
Eclampsia 4-real-presentation
 
Bryce Jordan Center E-mail Conf
Bryce Jordan Center E-mail ConfBryce Jordan Center E-mail Conf
Bryce Jordan Center E-mail Conf
 
Ocul emergency-presentation
Ocul emergency-presentationOcul emergency-presentation
Ocul emergency-presentation
 
Jogos
JogosJogos
Jogos
 
El Tiempo Nos Ensea 214392
El Tiempo Nos Ensea 214392El Tiempo Nos Ensea 214392
El Tiempo Nos Ensea 214392
 
Los Estados De La Materia
Los Estados De La MateriaLos Estados De La Materia
Los Estados De La Materia
 
HTML by Telerik Akademy
HTML by Telerik AkademyHTML by Telerik Akademy
HTML by Telerik Akademy
 
LEARN HTML IN A DAY
LEARN HTML IN A DAYLEARN HTML IN A DAY
LEARN HTML IN A DAY
 
HTTP Strict Transport Security (HSTS), English version
HTTP Strict Transport Security (HSTS), English versionHTTP Strict Transport Security (HSTS), English version
HTTP Strict Transport Security (HSTS), English version
 
.htaccess for SEOs - A presentation by Roxana Stingu
.htaccess for SEOs - A presentation by Roxana Stingu.htaccess for SEOs - A presentation by Roxana Stingu
.htaccess for SEOs - A presentation by Roxana Stingu
 
The internet for SEOs by Roxana Stingu
The internet for SEOs by Roxana StinguThe internet for SEOs by Roxana Stingu
The internet for SEOs by Roxana Stingu
 
Web tech html css js
Web tech html css jsWeb tech html css js
Web tech html css js
 
Seo cheat sheet 2013
Seo cheat sheet 2013Seo cheat sheet 2013
Seo cheat sheet 2013
 

Viewers also liked

To set enviroment variable
To set enviroment variableTo set enviroment variable
To set enviroment variable
Venkat Pinagadi
 
Introduction to ajax
Introduction to ajaxIntroduction to ajax
Introduction to ajax
Venkat Pinagadi
 
Three tier application
Three tier applicationThree tier application
Three tier application
Venkat Pinagadi
 
Neighborhood Watch mobile app (usability testing documentation)
Neighborhood Watch mobile app (usability testing documentation)Neighborhood Watch mobile app (usability testing documentation)
Neighborhood Watch mobile app (usability testing documentation)
JosephHowerton
 
Patrimonio (1)
Patrimonio (1)Patrimonio (1)
Patrimonio (1)
AnaBarrer
 
Pinoy trivia
Pinoy triviaPinoy trivia
Pinoy trivia
Guia Elena Trazo
 
GDI
GDIGDI
Architecture in an Agile World
Architecture in an Agile WorldArchitecture in an Agile World
Architecture in an Agile World
Don McGreal
 
Park and Seek Mobile app (usability testing documentation)
Park and Seek Mobile app (usability testing documentation)Park and Seek Mobile app (usability testing documentation)
Park and Seek Mobile app (usability testing documentation)
JosephHowerton
 
Tomcat
TomcatTomcat

Viewers also liked (10)

To set enviroment variable
To set enviroment variableTo set enviroment variable
To set enviroment variable
 
Introduction to ajax
Introduction to ajaxIntroduction to ajax
Introduction to ajax
 
Three tier application
Three tier applicationThree tier application
Three tier application
 
Neighborhood Watch mobile app (usability testing documentation)
Neighborhood Watch mobile app (usability testing documentation)Neighborhood Watch mobile app (usability testing documentation)
Neighborhood Watch mobile app (usability testing documentation)
 
Patrimonio (1)
Patrimonio (1)Patrimonio (1)
Patrimonio (1)
 
Pinoy trivia
Pinoy triviaPinoy trivia
Pinoy trivia
 
GDI
GDIGDI
GDI
 
Architecture in an Agile World
Architecture in an Agile WorldArchitecture in an Agile World
Architecture in an Agile World
 
Park and Seek Mobile app (usability testing documentation)
Park and Seek Mobile app (usability testing documentation)Park and Seek Mobile app (usability testing documentation)
Park and Seek Mobile app (usability testing documentation)
 
Tomcat
TomcatTomcat
Tomcat
 

Similar to Basic html tags

css_and_html_coding_today-ted_ulle.ppt
css_and_html_coding_today-ted_ulle.pptcss_and_html_coding_today-ted_ulle.ppt
css_and_html_coding_today-ted_ulle.ppt
zachbrowne
 
PHP HTML CSS Notes
PHP HTML CSS  NotesPHP HTML CSS  Notes
PHP HTML CSS Notes
Tushar Rajput
 
Html 5
Html 5Html 5
HTML Tutorials
HTML TutorialsHTML Tutorials
HTML Tutorials
Arvind Kumar
 
Intro webtechstc
Intro webtechstcIntro webtechstc
Intro webtechstc
cmcsubho
 
The Ulta-Handy HTML Guide
The Ulta-Handy HTML GuideThe Ulta-Handy HTML Guide
The Ulta-Handy HTML Guide
jsved
 
HTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.pptHTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.ppt
raghavanp4
 
css.ppt
css.pptcss.ppt
css.ppt
css.pptcss.ppt
css.ppt
Sana903754
 
Doing More with LESS for CSS
Doing More with LESS for CSSDoing More with LESS for CSS
Doing More with LESS for CSS
Todd Anglin
 
Web Design for Literary Theorists II: Overview of CSS (v 1.0)
Web Design for Literary Theorists II: Overview of CSS (v 1.0)Web Design for Literary Theorists II: Overview of CSS (v 1.0)
Web Design for Literary Theorists II: Overview of CSS (v 1.0)
Patrick Mooney
 
Class 1 handout (2) html exercises
Class 1 handout (2) html exercisesClass 1 handout (2) html exercises
Class 1 handout (2) html exercises
Erin M. Kidwell
 
An Seo’s Intro to Web Dev, HTML, CSS and JavaScript
An Seo’s Intro to Web Dev, HTML, CSS and JavaScriptAn Seo’s Intro to Web Dev, HTML, CSS and JavaScript
An Seo’s Intro to Web Dev, HTML, CSS and JavaScript
Troyfawkes
 
introduction to web technology
introduction to web technologyintroduction to web technology
introduction to web technology
vikram singh
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTML
Ajay Khatri
 
Html Workshop
Html WorkshopHtml Workshop
Html Workshop
vardanyan99
 
Class 1: Introductions
Class 1: IntroductionsClass 1: Introductions
Class 1: Introductions
Erika Tarte
 
Lecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
Lecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
Lecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
ZahouAmel1
 
Building A Website
Building A WebsiteBuilding A Website
Building A Website
marabeas
 
Punch it Up with HTML and CSS
Punch it Up with HTML and CSSPunch it Up with HTML and CSS
Punch it Up with HTML and CSS
mtlgirlgeeks
 

Similar to Basic html tags (20)

css_and_html_coding_today-ted_ulle.ppt
css_and_html_coding_today-ted_ulle.pptcss_and_html_coding_today-ted_ulle.ppt
css_and_html_coding_today-ted_ulle.ppt
 
PHP HTML CSS Notes
PHP HTML CSS  NotesPHP HTML CSS  Notes
PHP HTML CSS Notes
 
Html 5
Html 5Html 5
Html 5
 
HTML Tutorials
HTML TutorialsHTML Tutorials
HTML Tutorials
 
Intro webtechstc
Intro webtechstcIntro webtechstc
Intro webtechstc
 
The Ulta-Handy HTML Guide
The Ulta-Handy HTML GuideThe Ulta-Handy HTML Guide
The Ulta-Handy HTML Guide
 
HTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.pptHTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.ppt
 
css.ppt
css.pptcss.ppt
css.ppt
 
css.ppt
css.pptcss.ppt
css.ppt
 
Doing More with LESS for CSS
Doing More with LESS for CSSDoing More with LESS for CSS
Doing More with LESS for CSS
 
Web Design for Literary Theorists II: Overview of CSS (v 1.0)
Web Design for Literary Theorists II: Overview of CSS (v 1.0)Web Design for Literary Theorists II: Overview of CSS (v 1.0)
Web Design for Literary Theorists II: Overview of CSS (v 1.0)
 
Class 1 handout (2) html exercises
Class 1 handout (2) html exercisesClass 1 handout (2) html exercises
Class 1 handout (2) html exercises
 
An Seo’s Intro to Web Dev, HTML, CSS and JavaScript
An Seo’s Intro to Web Dev, HTML, CSS and JavaScriptAn Seo’s Intro to Web Dev, HTML, CSS and JavaScript
An Seo’s Intro to Web Dev, HTML, CSS and JavaScript
 
introduction to web technology
introduction to web technologyintroduction to web technology
introduction to web technology
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTML
 
Html Workshop
Html WorkshopHtml Workshop
Html Workshop
 
Class 1: Introductions
Class 1: IntroductionsClass 1: Introductions
Class 1: Introductions
 
Lecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
Lecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
Lecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
 
Building A Website
Building A WebsiteBuilding A Website
Building A Website
 
Punch it Up with HTML and CSS
Punch it Up with HTML and CSSPunch it Up with HTML and CSS
Punch it Up with HTML and CSS
 

Recently uploaded

20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 

Recently uploaded (20)

20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 

Basic html tags

  • 1. Introduction to We b Te chnologie s pre s e nte d by Ve nka t pina ga di
  • 2. S ha me le s s P lug Owne r, Hype rTra in dot Com S a n Die go ba s e d, but do mos tly ons ite work plus confe re nce s Tra in & cons ult on He lp Authoring Tools a nd re la te d te chnologie s : J a va S cript, HTML, CS S , DHTML, Inte ra ctivity, We b-ba s e d He lp, e tc. Uncle Da ve 's motto: "Ca ll me a nytime ." 888-722-0700, dga s h@hype rtra in.com
  • 3. P re s e nta tion Ove rvie w Look a t ma in te chnologica l compone nts tha t ma ke up mode rn We b pa ge s HTML – Hype rTe xt Ma rkup La ngua ge CS S – Ca s ca ding S tyle S he e ts J a va S cript – um, J a va S cript For e a ch compone nt Wha t it is /is n't, ca n/ca n't do Wha t kinds of cons tructs it compris e s How to us e it in We b pa ge s How it inte ra cts with othe r compone nts
  • 4. HTML Compone nts Docume nts Docume nt = pa ge = HTM file = topic Conte nt (te xt, ima ge s ) Ta gs (dis pla y comma nds ) Othe r te rms Window: brows e r dis pla y window URL: Uniform Re s ource Loca tor Hype rlink: hype rte xt jump to a re s ource Re s ource : URL, ima ge , ma ilto, e xte rna l file
  • 5. HTML P a ge s HTML pa ge s a re ta g-ba s e d docume nts Re a lly pla in AS CII te xt file s Don't look like docume nts the y re pre s e nt Ta gs indica te how proce s s ing progra m s hould dis pla y te xt a nd gra phics De s igne d to de s cribe hype rte xt, not pa pe r P roce s s e d by brows e rs "on the fly" Ta gs us ua lly a ppe a r in pa irs Mos t ha ve re a s ona ble na me s or mne monics 
  • 6. Tha t's How This ... <HTML> <HEAD> <BODY background="slate.gif"> <H1>Welcome</H1> <IMG SRC="DOUGLAS.GIF" WIDTH="80" HEIGHT="107" ALT="Our Founder" BORDER="0"> <H2>A Message from the President </H2> <P><font color=red>Good evening! Thank you for working late!</font></P> <P>Hello and welcome to DougCo, Incorporated! I'm <b>Douglas S. Michaels,</b> President and Founder, <a href="acronyms.htm">COB, CEO, COO, and BBBWAIC</a>. Let me take this opportunity to congratulate you on obtaining employment here at DougCo; I want you to know that you've chosen to spend your career in one of the most worthwhile and rewarding endeavors possible --making me richer!</P> . . .
  • 8. S ome HTML Ta g Exa mple s S TAR TAG T <HTML> <HEAD> <TITLE> <BODY> <H1>, <H2>, ... <IMG ...> <A ...> <P> <BR> <OL> <UL> <LI> E TAG ND </HTML> </HEAD> </TITLE> </BODY> </H1>, </H2>, ... </IMG> (optional) </A> </P> (optional) (none; "empty" tag) </OL> </UL> </LI> (optional)
  • 9. HTML Docume nt La yout Exa mple of ba s ic ta g pos itioning <html> <head> <title>Title bar text</title> </head> <body> <p>Look, I'm a paragraph!</p> </body> </html> Alwa ys think c o nta ine rs ! Ta g pa irs tha t e nclos e conte nt
  • 10. S ome Common Te xt Ta gs He a ding le ve ls h1 – h6, numbe rs inve rs e to te xt s ize <h1>Heading One</h1> <h2>Heading One</h2> P a ra gra ph P roba bly the mos t common ta g <p>Yada yada yada...</p> Line bre a k (a n e mpty ta g) Us e d whe n <p>'s white s pa ce not wa nte d This line will break<br>right there Note white s pa ce or la ck the re of in HTML s ource does not m atter!
  • 11. Orde re d & Unorde re d Lis ts Orde re d (numbe re d) Us e <ol>...</ol> ta gs Unorde re d (bulle te d) Us e <ul>...</ul> ta gs Lis t Ite ms ma ke up both lis ts Us e s a me <li>...</li> ta gs Lis ts ca n conta in a lmos t a nything Te xt, ima ge s , pa ra gra phs , links Eve n othe r (ne s te d) lis ts , s a me type or not
  • 12. Attribute s a nd Va lue s P rope rtie s , tra its , or cha ra cte ris tics tha t modify the wa y a ta g looks or a cts Us ua lly in pa irs : <body bgcolor="teal"> S ome time s not: <dl compact> Mos t HTML ta gs ca n ta ke a ttribute s Forma t of va lue de pe nds on a ttribute  width="150" ... href="page3.htm" no t width="page3.htm" ... href="150"
  • 13. The Anchor Ta g (1) The ta g tha t puts the HT in HTML <a > ... </a > (us e le s s by its e lf) Mus t ha ve a ttribute s to be us e ful HREF (Hype rte xt REFe re nce ) a ttribute Ma ke s a jump to s ome pla ce (URL) <a href="mypage.htm">My Page</a> <a href="www.google.com">Google</a> Link te xt is unde rs core d by de fa ult W hatever is be twe e n <a > a nd </a > is hot (clicka ble ) Clicking ma ke s the link go s ome whe re or do s ome thing
  • 14. The Anchor Ta g (2) S ome link e xa mple s te xt only ima ge only both
  • 15. Ima ge s (1) Us e d in pa ge s for va rious re a s ons Cla rifica tion, na viga tion, pe riphe ra l tra ining Ima ge s not in pa ge ; re fe re nc e d by pa ge Gra phics a re s e pa ra te , re quire d file s Us ua lly GIFs or J P Gs , s ome time s othe rs Ca n be a nywhe re in docume nt body: in pa ra gra phs , he a dings , lis ts , a nchors , e tc. P la ce ima ge with <img> ta g Like <a >, <img> is us e le s s by its e lf
  • 16. Ima ge s (2) Ma in a ttribute : S RC Te lls pa ge whe re to find the ima ge File na me ca n be loca l, re la tive , or full Ca s e s e ns itivity de pe nds on s e rve r Anima te d GIFs a dde d s a me a s s ta tic <img src="smiley.gif"> <img src="./pix/mypic.jpg"> <img src="http://www.myweb.com/mail.gif">
  • 17. Ta ble s (1) P owe rful, fle xible informa tion de live ry Us e d to re fle ct or impa rt s tructure A ta ble is a conta ine r <table> ... </table> Tha t conta ins othe r conta ine rs (rows ) <tr> ... </tr> Tha t conta in othe r conta ine rs (ce lls ) <td> ... </td> (data cells) <th> ... </th> (heading cells) Tha t conta in da ta – or othe r conta ine rs Te xt, gra phics , lis ts , e ve n othe r ta ble s !
  • 18. Ta ble s (2) Ba s ic ta ble ma rkup <table border="1"> <tr> <td>Row 1, Cell 1</td> <td>Row 1, Cell 2</td> </tr> <tr> <td>Row 2, Cell 1</td> <td>Row 2, Cell 2</td> </tr> Row 1, Cell 1 Row 1, Cell 2 </table> Row 2, Cell 1 Row 2, Cell 2
  • 19. CS S Conce pts S tyle s a re na me d s e ts of forma tting comma nds [18pt, Aria l, le ft a ligne d] "S e ction he a d" [Bold, ita lic, blue ] "Glos s a ry te rm" [Norma l, 10pt, Ve rda na ] "Body te xt" [Ita lic, ora nge , s ma ll ca ps ] "Bob" S tyle s he e ts a re control docume nts tha t a re re fe re nce d by conte nt docume nts MS Word, othe r e ditors & de s ktop publis hing progra ms ha ve done it for ye a rs
  • 20. Why Us e CS S ? HTML forma tting is a wkwa rd a nd impre cis e Origina lly inte nde d to de live r we ll orga nize d te xt (a ime d a t s tructure , not forma tting) Ove r time , forma tting e le me nts we re a dde d tha t s olve d s ome proble ms , but cre a te d ma ny more W3C propos e d Ca s ca ding S tyle S he e ts S e pa ra te forma t from conte nt Enforce cons is te ncy
  • 21. Wha t's "Ca s ca ding" All About? Thre e pla ce s to put s tyle comma nds  Exte rna l: Affe cts a ll docume nts it's a tta che d to  Inte rna l: Affe cts only docume nt it a ppe a rs in  Inline : Affe cts only te xt it's a pplie d to Ca s ca ding me a ns s tyle s ' "pe cking orde r"  P re ce de nce is : Inline > Inte rna l > Exte rna l  S e e ms ba ckwa rd, but it couldn't work a ny othe r wa y; for e xa mple …  P icture a docume nt whos e s tyle s he e t s pe cifie s Ve rda na a s the font, with one
  • 22. Wha t Ca n CS S Control? Almos t e ve rything  P a ge ba ckground, colors , ima ge s , fonts a nd te xt, ma rgins a nd s pa cing, he a dings , pos itioning, links , lis ts , ta ble s , curs ors , e tc. W3C inte nds CS S to "…re lie ve HTML of the re s pons ibility of pre s e nta tion."  Tra ns la tion: "Don't bug us for ne w ta gs ; cha nge e xis ting ta gs & ma ke your own us ing CS S ." Ide a is to put a ll forma tting in CS S  To tha t e nd, ma ny ta gs a re "de pre ca te d" by CS S : <font>, <ba s e font>, <ce nte r>,
  • 23. Coding CS S Rule s Rule s ha ve ve ry s pe cific pa rts a nd s ynta x  Rule s ha ve two ba s ic pa rts : s e le ctor a nd de cla ra tion  De cla ra tion a ls o ha s two pa rts : prope rty a nd va lue rule h2 { font-style : italic ; } property selector value declaration  S e le ctor te lls the rule wha t to modify  De cla ra tion te lls the rule how to modify it
  • 24. CS S Rule P la ce me nt In a s e pa ra te .CS S file Affe cts a ll pa ge s to which it is linke d .CS S re fe re nce d by pa ge s with <link> ta g In the <he a d> of a n .HTM pa ge Affe cts only pa ge in which it a ppe a rs Rule s a re code d in <s tyle ></s tyle > conta ine r In a n HTML ta g in pa ge <body> Affe cts only te xt to which it is a tta che d De cla ra tions a re code d a s a ttribute = " v a lue " pa irs , e .g., s tyle ="color: blue ;"
  • 25. Linking To An Exte rna l CS S Do not put <s tyle ></s tyle > ta gs in the .CS S file ; this will pre ve nt it from working Add CS S rule s a s ne e de d; bre a k line s whe re ne ce s s a ry; forma t a s de s ire d S a ve a s file na m e .cs s Re fe re nce .CS S in <he a d> of .HTM(s ) <head> <link rel="stylesheet" type="text/css" href="mystyles.css"> </head>
  • 26. Adding S tyle s To A S ingle P a ge Within docume nt's <he a d>, ins e rt a <s tyle ></s tyle > conta ine r Code rule s e xa ctly a s you would in a n e xte rna l .CS S <head> <style> h2 { font-style: italic; color: red; } p { font-family: "Verdana, Arial, sansserif"; font-size: 12pt; color: blue; } </style> </head>
  • 27. Adding S tyle s To An HTML Ta g Within a ta g's < >, code a n a ttribute = " va lue " pa ir de fining s tyle cha ra cte ris tics Tip: Wa tch out for ne s te d quote s <h1 style = "font: small-caps bold italic; font-family: 'Verdana, Arial, sans-serif'; color: #008080; textalign: center;">Gettysburg Address (First Draft)</h1> <p style = "font-family: Times; color: #800000; font-weight: bold;"> Four score and seven beers ago…</p>
  • 28. J a va S cript Intro Wha t J a va S cript is n’t  J a va (obje ct-orie nte d progra mming la ngua ge )  A "progra mme rs -only" la ngua ge Wha t J a va S cript is  Exte ns ion to HTML (s upport de pe nds on brows e r)  An a cce s s ible , obje ct-ba s e d s cripting la ngua ge Wha t J a va S cript is for  Inte ra ctivity with the us e r: * input (us e r provide s da ta to a pplica tion) * proce s s ing (a pplica tion ma nipula te s da ta ) * output (a pplica tion provide s re s ults to us e r)
  • 29. Imple me nting J a va S cript (1) Dire ct ins e rtion into pa ge (imme dia te )  In <s cript></s cript> conta ine r within docume nt he a d or body Dire ct ins e rtion into pa ge (de fe rre d)  In <s cript></s cript> conta ine r a nd ins ide function { … } de finition within docume nt he a d or body Through e xte rna l re fe re nce s  In e xte rna l .js file s (imme dia te /de fe rre d)  Much like CS S e xte rna l re fe re nce Embe dde d inline  Within othe r ta gs (a s a ttribute va lue s )
  • 30. Imple me nting J a va S cript (2a ) Dire ct ins e rtion into pa ge (imme dia te )  <body><p>Today is <script>document.write( Date() ); </script></p> Dire ct ins e rtion into pa ge (de fe rre d)  <head><script> function dwd() { document.write( Date() ); } </script></head> . . . <body><p>Today is <script>dwd(); </script></p>
  • 31. Imple me nting J a va S cript (2b) Through e xte rna l re fe re nce s (imme dia te /de fe rre d de pe nds on s cript file 's conte nts )  <script src="swapimgs.js"></script> Embe dde d inline a s a ttribute va lue s  <img id="pic1" src="somepic.jpg" onmouseover="swapin('pic1')" onmouseout="swapout('pic1')"> . . . <input type="button" value="Buy Now" onclick="placeOrder('ordform')" </input>
  • 32. Ke y La ngua ge Compone nts Obje cts  Things on a pa ge ; think no un Attribute s  P rope rtie s of obje cts ; think a d je c tiv e Me thods  Actions ta ke n by obje cts ; think v e rb S ta te me nts  Line s of a s s e mble d compone nts ; think s e nte nc e Functions  Na me d groups of s ta te me nts ; think p a ra g ra p h
  • 33. P rogra mming Cons tructs Va ria ble s  Na me d e le me nts tha t ca n cha nge va lue Da ta type s  Inte ge r, floa ting-point, Boole a n, s tring Ope ra tors  As s ignme nt, compa ris on, a rithme tic, Boole a n, s tring, s pe cia l Control s ta te me nts  Conditions , loops Ke ywords  Re s e rve d words with s pe cia l me a ning
  • 34. A Fe w J S Exa mple s (1) S ome ba s ic J a va S cripts  To ge t the da y of the month var day = new Date().getDate();  To do s ome thing te n time s for (var x=0; x<10; x++) { document.write( x * x ); }  To ma ke a de cis ion a nd a ct on it if (username == "Bob") { userisknown = true; displayWelcomeBack(username); } else { userisknown = false; displayFirstLogin(username); }
  • 35. A Fe w J S Exa mple s (2) S ome more ba s ic J a va S cripts  To write s ome thing into the pa ge document.write("<b>Welcome, " + uname + "</b>");  To ma ke a ca lcula tion pcent = score / 100;  To s how the us e r a me s s a ge box alert("Score: " + pcent + "%");  To put s ome te xt on the Windows clipboa rd mycb = "daveg~armadillo"; clipboardData.setData("Text",mycb); To force a jump to a nothe r pa ge window.location="anotherpage.htm";
  • 36. S umma ry Mos t We b pa ge s – re mote or loca l – a re a combina tion of thos e te chnologie s Ra w conte nt, pla ce d ins ide … HTML ta gs , forma tte d with… CS S rule s , inte ra ctivity produce d by… J a va S cript s cripts Ne we r te chnologie s like DHTML, XHTML, a nd XML a re ba s e d on the s e A little knowle dge now ca n pre pa re you for ne w te chnologie s a nd he lp you ke e p up with your pe e rs , your bos s … a nd your kids ! 