Вы находитесь на странице: 1из 24

Internet Programming

UNIT-1 XHTML

Introduction to XHTML
XHTML stands for EXtensible HyperText Markup Language XHTML is almost identical to HTML 4.01 XHTML is a stricter and cleaner ersion of HTML XHTML is HTML defined as an XML application XHTML is a !"# $ecommendation

XHTML - Why?
XHTML is a combination of HTML and XML %Extensible Markup Language&. XHTML consists of all t'e elements in HTML( combined )it' t'e strict syntax of XML. Many pages on t'e internet contain *bad* HTML.

T'e follo)ing HTML code )ill )ork +ust fine if you ie) it in a bro)ser %e en if it does ,-T follo) t'e HTML rules&. /'tml0 /'ead0 /title0T'is is bad HTML/1title0 /body0 /'102ad HTML /p0T'is is a paragrap' /1body0 XML is a markup language )'ere e eryt'ing must be marked up correctly( )'ic' results in *)ell3formed* documents. 4o in XHTML 3 XML is designed to describe data( and HTML is designed to display data. T'erefore 3 by combining t'e strengt's of HTML and XML( !"# recommended a markup language t'at is useful no) and in t'e future 3 XHTML.

Differences et!een XHTML and HTML


The Most Im"ortant Differences are#
1$ XHTML e%ements must e "ro"er%y nested &$ XHTML e%ements must a%!ays e c%osed '$ XHTML e%ements must e in %o!ercase ($ XHTML documents must ha)e one root e%ement

5repared 2y. 6eepak 7umar 5ra+apat Lecturer. #418T 6epartment 9#ET( 2undi

Internet Programming
UNIT-1 XHTML

<

XHTML *%ements Must +e Pro"er%y Nested


8n HTML( some elements can be improperly nested )it'in eac' ot'er( like t'is. /b0/i0T'is text is bold and italic/1b0/1i0 8n XHTML( all elements must be properly nested )it'in eac' ot'er( like t'is. /b0/i0T'is text is bold and italic/1i0/1b0 ,ote. : common mistake )it' nested lists( is to forget t'at t'e inside list must be )it'in /li0 and /1li0 tags. T'is is )rong. /ul0 /li0#offee/1li0 /li0Tea /ul0 /li02lack tea/1li0 /li0;reen tea/1li0 /1ul0 /li0Milk/1li0 /1ul0 T'is is correct. /ul0 /li0#offee/1li0 /li0Tea /ul0 /li02lack tea/1li0 /li0;reen tea/1li0 /1ul0 /1li0 /li0Milk/1li0 /1ul0 ,otice t'at )e 'a e inserted a /1li0 tag after t'e /1ul0 tag in t'e *correct* code example. XHTML Elements Must :l)ays 2e #losed ,on3empty elements must 'a e a closing tag. T'is is )rong. /p0T'is is a paragrap' /p0T'is is anot'er paragrap' T'is is correct. /p0T'is is a paragrap'/1p0 /p0T'is is anot'er paragrap'/1p0

*m"ty *%ements Must ,%so +e -%osed


5repared 2y. 6eepak 7umar 5ra+apat Lecturer. #418T 6epartment 9#ET( 2undi

Internet Programming
UNIT-1 XHTML
Empty elements must also be closed. T'is is )rong. : break. /br0 : 'ori=ontal rule. /'r0 :n image. /img src>*'appy.gif* alt>*Happy face*0 T'is is correct. : break. /br 10 : 'ori=ontal rule. /'r 10 :n image. /img src>*'appy.gif* alt>*Happy face* 10

"

XHTML *%ements Must +e In Lo!er -ase


Tag names and attributes must be in lo)er case. T'is is )rong. /2-6?0 /50T'is is a paragrap'/150 /12-6?0 T'is is correct. /body0 /p0T'is is a paragrap'/1p0 /1body0

XHTML Documents Must Ha)e .ne /oot *%ement


:ll XHTML elements must be nested )it'in t'e /'tml0 root element. #'ild elements must be in pairs and correctly nested )it'in t'eir parent element. T'e basic document structure is. /'tml0 /'ead0 ... /1'ead0 /body0 ... /1body0 /1'tml0

XHTML 0ynta1
More XHTML 0ynta1 /u%es
:ttribute names must be in lo)er case :ttribute alues must be 2uoted :ttribute minimi=ation is for idden T'e XHTML 6T6 defines mandatory elements

,ttri ute Names Must +e In Lo!er -ase


T'is is )rong. /table !86TH>*100@*0 T'is is correct.

5repared 2y. 6eepak 7umar 5ra+apat Lecturer. #418T 6epartment 9#ET( 2undi

Internet Programming
UNIT-1 XHTML
/table )idt'>*100@*0

,ttri ute 3a%ues Must +e 4uoted


T'is is )rong. /table )idt'>100@0 T'is is correct. /table )idt'>*100@*0

,ttri ute Minimi5ation Is 6or idden


T'is is )rong. /input c'ecked0 /input readonly0 /input disabled0 /option selected0 /frame noresi=e0 T'is is correct. /input c'ecked>*c'ecked* 10 /input readonly>*readonly* 10 /input disabled>*disabled* 10 /option selected>*selected* 10 /frame noresi=e>*noresi=e* 10 Here is a list of t'e minimi=ed attributes in HTML and 'o) t'ey s'ould be )ritten in XHTML. HTML compact c'ecked declare readonly disabled selected defer ismap no'ref nos'ade no)rap multiple noresi=e XHTML compact>*compact* c'ecked>*c'ecked* declare>*declare* readonly>*readonly* disabled>*disabled* selected>*selected* defer>*defer* ismap>*ismap* no'ref>*no'ref* nos'ade>*nos'ade* no)rap>*no)rap* multiple>*multiple* noresi=e>*noresi=e*

The Lang ,ttri ute


T'e lang attribute applies to almost e ery XHTML element. 8t specifies t'e language of t'e content )it'in an element. 8f you use t'e lang attribute in an element( you must also add t'e xml.lang attribute( like t'is. /di lang>*it* xml.lang>*it*0#iao bellaA/1di 0

5repared 2y. 6eepak 7umar 5ra+apat Lecturer. #418T 6epartment 9#ET( 2undi

Internet Programming
UNIT-1 XHTML

XHTML Docty"es
78D.-T9P*: Is Mandatory
:n XHTML document consists of t'ree main parts. t'e 6-#T?5E declaration t'e /'ead0 section t'e /body0 section T'e basic document structure is. /A6-#T?5E ...0 /'tml0 /'ead0 /title0... /1title0 /1'ead0 /body0 ... /1body0 /1'tml0 Note# T'e /A6-#T?5E0 declaration refers to a 6ocument Type 6efinition %6T6&. : 6T6 specifies t'e rules for t'e markup language( so t'at t'e bro)sers render t'e content correctly.

,n XHTML *1am"%e
T'e example belo) s'o)s an XHTML document )it' a minimum of reBuired tags. /A6-#T?5E 'tml 5C2L8# *311!"#116T6 XHTML 1.0 Transitional11E,* *'ttp.11))).)".org1T$1x'tml116T61x'tml13transitional.dtd*0 /'tml xmlns>*'ttp.11))).)".org11DDD1x'tml*0 /'ead0 /title0Title of document/1title0 /1'ead0 /body0 /1body0 /1'tml0 Note# T'e xmlns attribute in /'tml0( specifies t'e xml namespace for a document( and is reBuired in XHTML documents.

5repared 2y. 6eepak 7umar 5ra+apat Lecturer. #418T 6epartment 9#ET( 2undi

Internet Programming
UNIT-1 XHTML

XHTML Different Docty"es


T'e /A6-#T?5E0 declaration is t'e ery first t'ing in an XHTML document( before t'e /'tml0 tag. T'e /A6-#T?5E0 declaration is not an XHTML tagF it is an instruction to t'e )eb bro)ser about )'at ersion of t'e markup language t'e page is )ritten in. T'e /A6-#T?5E0 declaration refers to a 6ocument Type 6efinition %6T6&. T'e 6T6 specifies t'e rules for t'e markup language( so t'at t'e bro)sers render t'e content correctly.

XHTML 1.0 Strict


T'is 6T6 contains all HTML elements and attributes( but does ,-T 8,#LC6E presentational or deprecated elements %like font&. Gramesets are not allo)ed. T'e markup must also be )ritten as )ell3 formed XML. /A6-#T?5E 'tml 5C2L8# *311!"#116T6 XHTML 1.0 4trict11E,* *'ttp.11))).)".org1T$1x'tml116T61x'tml13strict.dtd*0

XHTML 1.0 Transitional


T'is 6T6 contains all HTML elements and attributes( 8,#LC68,; presentational and deprecated elements %like font&. Gramesets are not allo)ed. T'e markup must also be )ritten as )ell3formed XML. /A6-#T?5E 'tml 5C2L8# *311!"#116T6 XHTML 1.0 Transitional11E,* *'ttp.11))).)".org1T$1x'tml116T61x'tml13transitional.dtd*0

XHTML 1.0 Frameset


T'is 6T6 is eBual to XHTML 1.0 Transitional( but allo)s t'e use of frameset content. /A6-#T?5E 'tml 5C2L8# *311!"#116T6 XHTML 1.0 Grameset11E,* *'ttp.11))).)".org1T$1x'tml116T61x'tml13frameset.dtd*0

XHTML 1.1
T'is 6T6 is eBual to XHTML 1.0 4trict( but allo)s you to add modules %for example to pro ide ruby support for East3:sian languages&. /A6-#T?5E 'tml 5C2L8# *311!"#116T6 XHTML 1.111E,* *'ttp.11))).)".org1T$1x'tml1116T61x'tml11.dtd*0

5repared 2y. 6eepak 7umar 5ra+apat Lecturer. #418T 6epartment 9#ET( 2undi

Internet Programming
UNIT-1 XHTML

XHTML 3a%idation
5rogramming )ebI based application can be complex( and XHTML documents must be )ritten correctly to ensure t'at bro)sers process t'em properly. To promote correctly )ritten documents( t'e !"# pro ides a alidation ser ice % alidator.)".org& for c'ecking a documentJs syntax. 6ocument can be alidate by pro iding a C$L t'at specifies t'e file location( by uploading a file to )a%idator$!'$org;fi%e-u"%oad$htm% or y "asting code direct%y into a te1t area$ Cploading a file copies t'e file from t'e userJs computer to anot'er computer on t'e internet. T'is ser ice is called Markup alidation ser ice and it is able to alidate t'e syntax of XHTML documents. :n XHTML document can be alidated )it' !"#Ks alidator.

3a%idate ,n XHTML Document


2efore an XHTML file can be alidated( a correct 6T6 must be added as t'e first line of t'e file.

3a%idate 9our XHTML With The W'- 3a%idator


Top of Gorm 8nput a )eb address in t'e box belo).
http://validator.w 3.org/

Validate the page

Headings
4ome text in an XHTML document may be more important t'an ot'er text. XHTML pro ides six 'eadings( called 'eading elements for specifying t'e relati e importance of information. Heading starts from '1 and up to 'H. '1 is most significant 'eading and )it' largest font si=e.

'H is least significant 'eading )it' smallest font si=e.

*1am"%e 1# Dis"%ay different ty"e of Heading


5repared 2y. 6eepak 7umar 5ra+apat Lecturer. #418T 6epartment 9#ET( 2undi

Internet Programming
UNIT-1 XHTML

,ote. Line D M 14 s'o)s different types of Heading on XHTML document. .ut"ut#

5repared 2y. 6eepak 7umar 5ra+apat Lecturer. #418T 6epartment 9#ET( 2undi

Internet Programming
UNIT-1 XHTML

Lin<ing
-ne of t'e most important XHTML features is t'e 'yperlink( )'ic' references ot'er resources( suc' as XHTML documents and images. !'en a user clicks a 'yperlink( t'e bro)ser tries to execute an action associated )it' it. 8n XHTML( bot' text and 8mages can act as a 'yperlink. !eb bro)ser typically underlines text 'yperlinks and colors t'eir text blue by default( so t'at users can distinguis' 'yperlinks from plain text. Links are created using t'e anc'or %a& element. :ttribute 'ref specifies t'e location of linked resource( suc' as a )ebpage( a file or an e3mail address. !'en a C$L does not indicate a specific document on t'e )ebsite( t'e )eb ser er returns a default )eb page. T'is page is often called inde1$htm% or defau%t$htm% 8f t'e )eb ser er cannot locate a reBuested document( it returns an error indication to t'e )eb bro)ser and t'e bro)ser displays a error message to t'e user. Hy"er%in<ing to a !e site /a 'ref>'ttp.11))).google.co.in0 ;oogle/1a0 Hy"er%in<ing to a e-mai% address / 'ref>Omailto.dkpra+apatN0Pgmail.comO0 My E3Mail :ddress /1a0 *1am"%e &#

5repared 2y. 6eepak 7umar 5ra+apat Lecturer. #418T 6epartment 9#ET( 2undi

Internet Programming
UNIT-1 XHTML
Note# 1. Line 1H31D s'o)s t'e code for creating text 'yperlinks. <. Line <"3<E s'o)s t'e code for creating 8mage Hyperlink. ". Line <H3<L s'o)s t'e code for Hyper linking to an E3Mail :ddress. .ut"ut#

10

Images
Most )eb pages contains bot' text and images. T'e t'ree most important image format used by )eb de eloper are. 4yntax. /img src >Oimage3pat'O )idt'>O100O 'eig't>OE0O0 To use images on )ebpage )e use an img element in t'e document. T'e image fileJs location is specified )it' t'e img elementJs src attribute. ;rap'ical 8nterc'ange format %;8G& Qoint p'otograp'ic Experts ;roup %Q5E;& 5ortable ,et)ork grap'ics %5,;&

5repared 2y. 6eepak 7umar 5ra+apat Lecturer. #418T 6epartment 9#ET( 2undi

Internet Programming
UNIT-1

11

XHTML
8f t'e image is located in t'e same directory as t'e XHTML document( t'en only image name reBuired( ot'er)ise complete pat' is reBuired. % Line 11=1&& -ptional attribute of image are )idt' and 'eig't. !e can measure image in pixels t'at represent dots of color on t'e screen. E ery image element in an XHTML document must 'a e an alt attribute. 8f a bro)ser cannot render an image( t'e bro)ser displays t'e alt attributeJs alue. T'e alt attribute 'elps you create accessible )eb pages for users )it' documents( especially t'ose )it' ision impairments )'o use text bro)sers. 4peciali=ed soft)are called speec' synt'esi=er can RspeakO t'e alue of alt attribute so t'at a user )it' ision impairment kno)s )'at t'e bro)ser is displaying.

*1am"%e# '

Note# Line 1131< s'o)s t'e code for including images on XHTML document.

.ut"ut.

5repared 2y. 6eepak 7umar 5ra+apat Lecturer. #418T 6epartment 9#ET( 2undi

Internet Programming
UNIT-1 XHTML

1<

0"ecia% -haracters and Hori5onta% /u%es


!'en marking up text( certain c'aracters or symbols may be difficult to embed directly into an XHTML document. 4ome keyboards do not pro ide t'ese symbols( or t'e presence of t'ese symbols may cause syntax error.

Examples: < > & , &lt; (for lower than) &gt; (for greater than) &amp; (for ampersand) &auml; (for a umlaut) &ouml; &uuml; &Auml; &Ouml; &Uuml; &euro; &copy;

5repared 2y. 6eepak 7umar 5ra+apat Lecturer. #418T 6epartment 9#ET( 2undi

Internet Programming
UNIT-1 XHTML

1"

Lists
!'en )e are arranging our data or information in a particular seBuence( it is called a list. List may be of t)o types3 -rdered list M #reated using /ol0 element. Cnordered list M #reated using /ul0 element. List 8tem M List index gi en by /li0 element. *1am"%e (# -reating .rdered > Unordered List

.ut"ut#

5repared 2y. 6eepak 7umar 5ra+apat Lecturer. #418T 6epartment 9#ET( 2undi

Internet Programming
UNIT-1 XHTML Nested List#
!'en t'ere is a list )it'in a list( it is called a ,ested List. *1am"%e ?#

14

Note# 1. Line D3<" s'o)s code for an ordered list of sub+ects. <. Line 1<3 1H s'o)s code for nested list. .ut"ut#

5repared 2y. 6eepak 7umar 5ra+apat Lecturer. #418T 6epartment 9#ET( 2undi

Internet Programming
UNIT-1 XHTML

1E

Ta %es
Tables are freBuently used to organi=ed data into ro) and columns. Tables are defined )it' t'e /table0 element as a starting tag. Table element 'as se eral attributes.

7tr: used for indicating table ro). 7td: used for indicating table column.
border M 2order )idt' in pixels . 'eig't and )idt' summary M 6escribes t'e tables contents.

, ta %e has three distinct sections @ head= ody= and foot$ The Head section is defined )it' /t'ead0 element( !'ic' contain 'eader information suc' as column names.

7tr: 3 8ndi idual table ro) 7th: 3 #olumns in t'e 'ead section.

Most bro)ser center text formatted by t' %table 'eader column& element and display t'em in bold. The +ody 0ection or table body contains t'e table primary data. T'e table body is defined in a /tbody0 element.

7tr: 3 4pecifies one table ro) 7td: 3 6ata cell contain indi idual piece of data.

The foot 0ection is defined )it' a /tfoot0 %table foot& element. T'e text placed in t'e footer commonly includes calculation result and footnotes.

7tr: 3 8ndi idual table ro) 7th: 3 #olumns in t'e foot section.

5repared 2y. 6eepak 7umar 5ra+apat Lecturer. #418T 6epartment 9#ET( 2undi

Internet Programming
UNIT-1 XHTML
*1am"%e A. -rating ta %e

1H

Note# Line D M "0 s'o)s t'e code for table .ut"ut#

5repared 2y. 6eepak 7umar 5ra+apat Lecturer. #418T 6epartment 9#ET( 2undi

Internet Programming
UNIT-1 XHTML Using /o!s"an and -o%s"an
8n a table all t'e data cell are of fixed si=e to fit t'e data t'ey contain. !e can create larger data cell using t'e attributes ro)span and colspan. ro!s"an BC)a%ueC M 9alue s'o)s t'e number of ro)s occupied by a single cell. co%s"an BC)a%ueC M 9alue s'o)s t'e number of columns occupied by a single cell .

1L

.utPut#

5repared 2y. 6eepak 7umar 5ra+apat Lecturer. #418T 6epartment 9#ET( 2undi

Internet Programming
UNIT-1 XHTML

1N

6orms
!'en bro)sing )ebsites( users often need to pro ide some information from 'is side like searc' key)ords( email address and =ip codes. XHTML pro ides a mec'anism called a form for collecting data from a Cser. 6ata t'at user enter on a )eb page is normally sent to a )eb ser er t'at pro ides access to siteJs resources. Gorm can contain isual and non isual components. 3isua% com"onents include clickable buttons and ot'ers grap'ical user interface components )it' )'ic' user can interact. Non )isua% com"onents( called 'idden inputs store any data t'at you specify. 4uc' as E3mail address and XHTML document filename t'at can act as links.8n XHTML document form is defined by using 7form: element.

7form: element 'as t)o attributes method and action.


,ttri ute CmethodC s"ecifies ho! the formDs data is sent to the !e ser)er$ methodBC"ostC appends form data to t'e bro)ser reBuest( )'ic' contains t'e protocol HTT5 and reBuested resourceJs C$L. T'is met'od of passing data to t'e ser er is transparent M t'at means user doesnJt see t'e data after t'e form is submitted methodB EgetC appends t'e form data directly to t'e end of t'e C$L of t'e script( )'ere it is isible in t'e bro)serJs ,ddress field. ,ttri ute action s"ecifies the U/L of a scri"t on the !e ser)er that !i%% e in)o<ed to "rocess formDs data$ Here )e are not using any ser er3side scripting( so )e left t'is attribute empty. 8n t'e form a user can input data using different type of input fields. T'ese input fields are pro ided by t'e aut'or of XHTML document by using 7in"ut: element.

7in"ut: element 'as t'ree important attributes M name= ty"e and )a%ue.
name attribute is t'e identification of t'e input element( Qust like ariable name. )a%ue attribute pro ides t'e alue t'at )ill be sent %or posted& to t'e )eb ser er. ty"e attribute specify t'e type of input element. T'ere may be different type of input element. type > 'idden 1 text 1 pass)ord 1 c'eckbox 1 radio 1 submit 1 reset 1 .etc

5repared 2y. 6eepak 7umar 5ra+apat Lecturer. #418T 6epartment 9#ET( 2undi

Internet Programming
UNIT-1 XHTML
0No$ Ty"e ty"e B EhiddenC Descri"tion :llo)s an aut'or to send form data t'at is not input by a user. Like E3Mail address to )'ic' data )ill be sent( t'e e3 mailJs sub+ect line and a C$L for t'e bro)ser to open after submission ty"e B Ete1t R t'e form. 5ro ide a one line input text box )'ic' :llo)s a user to input

1D

text information like name( e3mail address( comments etc. ty"e BC"ass!ordC T'is input type is used for inputting sensiti e information like
si5e B ENC pass)ord( credit card number )it' maximum si=e of , c'aracters. !it' t'is option input information is masked by using %S& asterisk. T'e actual ty"e B chec< o1 alue input is sent to )eb ser er( not t'e masking c'aracters. T'ese are small sBuare type boxes. #'eckboxes enable users to select one or more from a limited number of option. !'en a user selects a c'eckbox( a c'eckmark appears in t'e c'eckbox( all ot'er c'eckbox remains empty. #'eckboxes can be used indi idually or ty"e B EradioC in group. Eac' c'eckbox used in a group 'as t'e same name. $adio buttons are similar to c'eckbox except t'at t'ey 'a e circular s'ape and allo) t'e user to select only one from t'e limited number ty"e B Efi%eC ty"e B Csu mitC of c'oice. is used for file upload. 6efines a submit button. : 4ubmit button is used to send form data to a ser er. T'e data is sent to t'e page specified in t'e formJs ty"e B EresetC ty"e B EimageC action attribute. 6efines a reset button. : reset button reset all forms fields to t'eir initial alue. 6efines an image as 4ubmit button. T'e src and alt attribute are reBuired )it' t'is.

T)o ot'er input types are te1tarea and dro"-do!n list


T)o ot'er input types are textarea and drop3do)n list. 7te1tarea: element inserts a multiline textbox( called a text area into t'e form. T'e Ero!C attribute specify number of lines in t'e textbox( and t'e Eco%sC attribute specify number of c'aracters per line. The 7se%ect: element pro ides a drop3do)n list from )'ic' user can select an item. 7o"tion: element adds item to t'e drop3do)n list. 2y using se%ected B Cse%ectedC in t'e /option0 element )e can set a default selected item in t'e drop M do)n list. 8f no option element is marked as selected( t'e bro)ser selects t'e first option by default.
5repared 2y. 6eepak 7umar 5ra+apat Lecturer. #418T 6epartment 9#ET( 2undi

Internet Programming
UNIT-1 XHTML

<0

."tiona% ,ttri utes


6T6 indicates in )'ic' HTML 4.011XHTML 1.0 6T6 t'e attribute is allo)ed. 4>4trict( T>Transitional( and G>Grameset. ,ttri ute accept align 3a%ue M8MEItype Left( rig't( top middle( bottom Text c'ecked Descri"tion 4pecifies t'e types of files t'at can be submitted t'roug' a file upload %only for type>*file*& 6eprecated. Cse styles instead. 4pecifies t'e alignment of an image input %only for type>*image*& 4pecifies an alternate text for an image input %only for type>*image*& 4pecifies t'at an input element s'ould be preselected )'en t'e page loads %for type>*c'eckbox* or type>*radio*& DTD 4TG TG

alt c'ecked

4TG 4TG

disabled maxlengt'

disabled number name readonly number C$L 2utton c'eckbox file 'idden image pass)ord radio reset submit text alue

4pecifies t'at an input element s'ould be disabled )'en 4TG t'e page loads 4pecifies t'e maximum lengt' %in c'aracters& of an input field %for type>*text* or type>*pass)ord*& 4pecifies a name for an input element 4pecifies t'at an input field s'ould be read3only %for type>*text* or type>*pass)ord*& 4pecifies t'e )idt' of an input field 4pecifies t'e C$L to an image to display as a submit button %only for type>*image*& 4pecifies t'e type of an input element 4TG 4TG 4TG 4TG 4TG 4TG

name
readonly si=e src

type

alue

4pecifies t'e alue of an input element

4TG

Pro %em# #reate a feedback form for taking user feedback.


:ns)er. Gorm design.

5repared 2y. 6eepak 7umar 5ra+apat Lecturer. #418T 6epartment 9#ET( 2undi

Internet Programming
UNIT-1 XHTML

<1

5repared 2y. 6eepak 7umar 5ra+apat Lecturer. #418T 6epartment 9#ET( 2undi

Internet Programming
UNIT-1 XHTML
XHTML coding for feedback form

<<

5repared 2y. 6eepak 7umar 5ra+apat Lecturer. #418T 6epartment 9#ET( 2undi

Internet Programming
UNIT-1 XHTML
,ote. 1. Line 1< M 14 s'o) t'ree inputs of 'idden types. T'ese are set by t'e aut'or of document and 'idden from t'e user. <. Line 1H and <1 s'o)s t'e input of text type. 8t creates a single line text box for input. ". Line 1D s'o)s a multiline text box called textarea for inputting comment from t'e user. 4. Line <" M <L s'o)s c'eckbox type input. E. Line "0 M "" s'o)s radio type input. H. Link "H M 4N s'o) code for dropdo)n list type input.

<"

Interna% Lin<ing
!e 'a e already discussed t'at 'o) to 'yperlink one page to anot'er. ,o) )e study internal linking. 8nternal linking is a mec'anism t'at enables t'e user to +ump bet)een locations in t'e same document. 8nternal linking is useful for long document t'at contain many sections. #licking t'e internal link enables user to find a section )it'out scrolling t'roug' t'e entire document. !e use t'e id attribute for an internal 'yperlinking. Qust like different labels in t'e # 1 #TT programs. 7h1 id B E0tartC: We%come to 0tart7;h1: To crate a link for t'at id )e )ill use an anc'or %/a0& element. Here alue of 'erf attribute )ill be t'e alue of id preceded by pound1'as' %U& sign. 7a href B EF0tartC:0tart7;a:

5repared 2y. 6eepak 7umar 5ra+apat Lecturer. #418T 6epartment 9#ET( 2undi

Internet Programming
UNIT-1 XHTML

<4

Meta *%ement
: searc' engine 'elps us in finding )ebsites. T'ey usually catalog sites by follo)ing links from page to page %T'is process is kno)n as s'i ering or cra)ling& and sa ing identification and information of eac' page. 4earc' engine catalog pages by reading t'e content in eac' pageJs Meta elements( )'ic' specify information about a document. T)o important attribute of meta element are name and content. name M identifies t'e type of meta element. content M pro ides t'e information about t'e document( )'ic' is used by searc' engine for cataloging t'e page.

5repared 2y. 6eepak 7umar 5ra+apat Lecturer. #418T 6epartment 9#ET( 2undi

Вам также может понравиться