Skip to main content

Posts

Showing posts from September, 2013

XHTML 1.0 Strict program with pre tag

This program shows the usage of pre tag so that the developer can have clutter free of paragraph tags(lots of them) across a large project. 1: <?xml version = "1.0" encoding="utf-8"?> 2: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 3: <html xmlns = "http://www.w3.org/1999/xhtml"> 4: <head> 5: <title> This is the title of the page</title> 6: </head> 7: <body> 8: <pre> 9: This is the paragraph tag. 10: T h i s i s t h e p r e t a g 11: With the pre tag I can place a text here 12: and 13: here 14: and also here 15: without any clutter of paragraph tags 16: </pre> 17: <p> 18: This is the second paragraph tag usage 19: </p> 20: </body> 21: </html>

Simple XHTML 1.0 Strict program with 5 tags (html,head,title,body,p)

This program below shows the usage of basic 5 tags/XHTML elements html | head | title | body | p 1: <?xml version = "1.0" encoding="utf-8"?> 2: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 3: <html xmlns = "http://www.w3.org/1999/xhtml"> 4: <head> 5: <title> This is the title of the page</title> 6: </head> 7: <body> 8: <p> 9: Hello Web! 10: </p> 11: </body> 12: </html>

Tags under DTDs

The different set of tags under the different DTD are as below 1: XHTML 1.0 Strict XHTML 1.1 Basic 2: a a 3: abbr abbr 4: acronym acronym 5: address address 6: area b 7: b base 8: base big 9: bdo blockquote 10: big body 11: blockquote br 12: body button 13: br caption 14: button cite 15: caption code 16: cite dd 17: code dfn 18: col div 19: colgroup dl 20: dd dt 21: del em 22: dfn fieldset 23: div form 24: dl h1 25: dt h2 26: em h3 27: fieldset h4 28:

Why DTDs?

Why do we need different type of DTDs? We need them, because as we see from the basic definition they are packages or templates or sets of particular type of tags or more technically referred to as the HTML elements, so if user wants a particular set of tags to be used then the user may opt for that. Below the meaning of each of them is given. 1. Strict      It makes the developer follow the standards strictly without any loosely tied up tags or incomplete tags.   2. Transitional     The transitional is used to have the backward compatibility. The designer get more freedom to use deprecated tags in this type of dtd. 3. Frameset     The frameset standard allows the designer to use the collection of frame elements and their attributes to be included.They can be included even though they are deprecated features.     If the user would like to have frames in their site then frameset dtd comes into play.     

DOCTYPE-The beginning of all xhtml documents.

The Document Type Definition DTD is used to define the set of markup declarations that define the kind of SGML family markup language you use in your website design. The different DTD that can be used under different set of user requirements. For XHTML version 1.0 we have 3 different DTD definitions. XHTML 1.0 Strict <DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">  Transitional <!DOCTYPE html PUBLIC "-W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1-transitional.dtd"> Frameset <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1-frameset.dtd"> For XHTML version 1.1 we have 2 different DTD definitions XHTML 1.1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> XHTML Basic 1.1 <!DOCTYPE html