WEEK 2: Design Tools: HTML, XHTML Ahsan Uddin Shan School of Film & Media Studies Ngee Ann Polytechnic
Objectives Learn about Web authoring tools Learn about the capabilities of HTML, XHTML and how they can assist you in Web development Understand what is HTML Understand basic document structure Use HTML tags to format document Create a local HTML document viewable with a browser Understand the role of the W3C
HTML Documents Originally, people created Web pages using Hypertext Markup Language Hypertext Markup Language (HTML) is a simple language used to create the Web pages that appear on the World Wide Web A markup language is a set of characters or symbols that define a document’s structure or how a document should be printed or displayed
HTML The stuff that web pages made of Telling the browser what to do A series of tags that are integrated into a text document Tags are ; surrounded with angle brackets like this <B> or <I>. Supported by thousands of applications
target output format There are different output device A target output format refers to the medium in which a document will be displayed, such as a Web page or an online help system
Basic HTML Syntax HTML documents are text documents that contain: formatting instructions, called tags Content [b/w body tag] Tags are enclosed in brackets [< >] <title> time management : so many boys so little time </title>
To configure HTML tags You use various parameters, called attributes , to configure many HTML tags It goes after the tag <body bgcolor=“green”>
The W3C To address the growing need for standards, Tim Berners-Lee established the World Wide Web Consortium , or W3C , in 1994 at MIT to oversee the development of Web technology standards W3c.org
Sneak preview Is this html or xhtml
another an html document Step1 : Choose any text editor program, Notepad, Edit, Word,etc. Step 2 : Enter the following code <html> <head> <title>how to start </title> </head> <body> 3 scientists happen to meet each other by chance at a party, an American, a Russian, and a Japanese. They boast their country's science achievements. The Russian says: We were the 1st ones in space, the American says, we were the 1st to goto moon, The Japanese thinks hard and says: we will be 1st ones on the sun! Both the american and russian start laughing, and say to the Japanese, you stupid the sun is too hot, your spaceship will burn b4 it reaches the sun. The Japanese scientist remains cool and calm, and says: You are stupid. We will go there at night!!!! </body> </html>
another an html document STEP 3: Go to the file menu and choose Save As option and save the file as how_to_create.html STEP 4: Click and open your web browser, navigate to your how_to_create.html file to view the output.
Another an html document <HTML> <HEAD><TITLE></TITLE> </HEAD> <BODY> </BODY> </HTML>
The Basics: Minimal HTML <HTML> <HEAD> <TITLE> Firstdocument.htm </TITLE> </HEAD> <BODY> The Document Text </BODY> </HTML>
The Basics: Minimal HTML <HTML> <HEAD> <TITLE> </TITLE> </HEAD> <BODY> </BODY> </HTML>
head Tags <head> : Defines information about the document <title> : Defines the document title Contains the page title, to be displayed in the browser window title bar and user book mark menu. <meta> :Defines meta information Tag Description <!DOCTYPE> Defines the document type. This tag goes before the <html> start tag.
HTML Tags Formatting applies to all text between tags Once you understand what each tag means, creating your HTML document is easy! Learn new tags by viewing source code from already existing pages < OPENTAG> Formatted Text </ CLOSETAG >
HTML Tags: Heading <H#> Heading tags are applied to text and are a good way to make different sections in your document They are displayed in various fonts and sizes to indicate relative importance. Headings come in levels 1 – 6 <H1> <H2> <H3> <H4> <H5> <H6>
HTML Tags: Application
HTML tags: Paragraph <P> HTML browsers ignore white space between paragraphs = … <BODY> I love being a student at Ngee Ann Polytechnic in Singapore. </BODY>… … <BODY> I love being a student at Ngee Ann Polytechnic in Singapore. </BODY>…
HTML tags: Paragraph <P> The paragraph tag forces the browser to start a new paragraph. New paragraphs always have a space between them
HTML tags: Paragraph <P> whitespace
HTML tags: Line Break <br> Force the browser to break to the next line Paragraphs cause space between Line breaks have no space between
HTML tags: Line Break <br> no white space
HTML tags: Horizontal Rule <hr> Method for breaking up space Causes a line to appear across the webpage Default width is the entire page Width can be adjusted Thickness (size) can be adjusted
Another way to format text Lists can be ordered (number) or unordered (bullet point) HTML tags: Lists Oranges Apples Pears bananas Oranges Apples Pears bananas Unordered List
Another way to format text Lists can be ordered (number) or unordered (bullet point) HTML tags: Lists Oranges Apples Pears bananas Oranges Apples Pears bananas Ordered List
ORDERED LIST <OL> <LI> oranges <LI> apples <LI> pears <LI> bananas </OL> UNORDERED LIST <UL> <LI> oranges <LI> apples <LI> pears <LI> bananas </UL> HTML tags: Lists LI = List Item
HTML tags: Lists
Definition List <DL> Useful for defining terms, words Same formatting as other lists <DL> <DT>orange <DD>A citrusy fruit <DT>banana <DD>A yellow fruit </DL> HTML tags: Lists Definition TITLE Definition DESCRIPTION
HTML tags: Lists Definition TITLE Definition DESCRIPTION
HTML tags In general, all tags should have a closing tag <OL> </OL>, <H2></H2> Some tags don’t need closing tag because it is assumed <P>, <LI>, <HR>, <BR> Important to view document for formatting preview before going public
XHTML tags Different browser technologies targets different devices Therefore - by combining HTML and XML, and their strengths, we got a markup language that is useful now and in the future - XHTML. XHTML pages can be read by all XML enabled devices
XHTML tags XHTML is a combination of HTML and XML (eXtensible Markup Language). XHTML consists of all the elements in HTML 4.01 combined with the syntax of XML. XML is a markup language where everything has to be marked up correctly, which results in &quot;well-formed&quot; documents.
“ Safe” XHTML example <?xml version= &quot; 1.0 &quot; encoding= &quot; utf-8 &quot; ?> <!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;DTD/xhtml1-strict.dtd&quot; > <html xmlns= &quot; http://www.w3.org/1999/xhtml1 &quot; xml:lang= &quot; en-ca &quot; lang= &quot; en-ca &quot; > <head> <title> ... </title> <meta http-equiv= &quot;content-type&quot; content= &quot; text/html;charset=utf-8 &quot; / > </head> <body> ..... </body> </html> space before slash
XHTML tags Three types of XHTML pages, they are: Strict: Use with CSS Transitional: The Transitional DTD includes presentation attributes and elements that W3C expects to move to a style sheet. Use this when you need to use HTML's presentational features because your readers don't have browsers that support Cascading Style Sheets (CSS) Frameset: documents with frames Add the <!doctype> tag <!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;>
How to write properly XHTML tags Use all lower case Attributes goes in quotes Close all tags Always nest tags properly

Design Tools Html Xhtml

  • 1.
    WEEK 2: DesignTools: HTML, XHTML Ahsan Uddin Shan School of Film & Media Studies Ngee Ann Polytechnic
  • 2.
    Objectives Learn aboutWeb authoring tools Learn about the capabilities of HTML, XHTML and how they can assist you in Web development Understand what is HTML Understand basic document structure Use HTML tags to format document Create a local HTML document viewable with a browser Understand the role of the W3C
  • 3.
    HTML Documents Originally,people created Web pages using Hypertext Markup Language Hypertext Markup Language (HTML) is a simple language used to create the Web pages that appear on the World Wide Web A markup language is a set of characters or symbols that define a document’s structure or how a document should be printed or displayed
  • 4.
    HTML The stuffthat web pages made of Telling the browser what to do A series of tags that are integrated into a text document Tags are ; surrounded with angle brackets like this <B> or <I>. Supported by thousands of applications
  • 5.
    target output formatThere are different output device A target output format refers to the medium in which a document will be displayed, such as a Web page or an online help system
  • 6.
    Basic HTML SyntaxHTML documents are text documents that contain: formatting instructions, called tags Content [b/w body tag] Tags are enclosed in brackets [< >] <title> time management : so many boys so little time </title>
  • 7.
    To configure HTMLtags You use various parameters, called attributes , to configure many HTML tags It goes after the tag <body bgcolor=“green”>
  • 8.
    The W3C Toaddress the growing need for standards, Tim Berners-Lee established the World Wide Web Consortium , or W3C , in 1994 at MIT to oversee the development of Web technology standards W3c.org
  • 9.
    Sneak preview Isthis html or xhtml
  • 10.
    another an htmldocument Step1 : Choose any text editor program, Notepad, Edit, Word,etc. Step 2 : Enter the following code <html> <head> <title>how to start </title> </head> <body> 3 scientists happen to meet each other by chance at a party, an American, a Russian, and a Japanese. They boast their country's science achievements. The Russian says: We were the 1st ones in space, the American says, we were the 1st to goto moon, The Japanese thinks hard and says: we will be 1st ones on the sun! Both the american and russian start laughing, and say to the Japanese, you stupid the sun is too hot, your spaceship will burn b4 it reaches the sun. The Japanese scientist remains cool and calm, and says: You are stupid. We will go there at night!!!! </body> </html>
  • 11.
    another an htmldocument STEP 3: Go to the file menu and choose Save As option and save the file as how_to_create.html STEP 4: Click and open your web browser, navigate to your how_to_create.html file to view the output.
  • 12.
    Another an htmldocument <HTML> <HEAD><TITLE></TITLE> </HEAD> <BODY> </BODY> </HTML>
  • 13.
    The Basics: MinimalHTML <HTML> <HEAD> <TITLE> Firstdocument.htm </TITLE> </HEAD> <BODY> The Document Text </BODY> </HTML>
  • 14.
    The Basics: MinimalHTML <HTML> <HEAD> <TITLE> </TITLE> </HEAD> <BODY> </BODY> </HTML>
  • 15.
    head Tags <head>: Defines information about the document <title> : Defines the document title Contains the page title, to be displayed in the browser window title bar and user book mark menu. <meta> :Defines meta information Tag Description <!DOCTYPE> Defines the document type. This tag goes before the <html> start tag.
  • 16.
    HTML Tags Formattingapplies to all text between tags Once you understand what each tag means, creating your HTML document is easy! Learn new tags by viewing source code from already existing pages < OPENTAG> Formatted Text </ CLOSETAG >
  • 17.
    HTML Tags: Heading<H#> Heading tags are applied to text and are a good way to make different sections in your document They are displayed in various fonts and sizes to indicate relative importance. Headings come in levels 1 – 6 <H1> <H2> <H3> <H4> <H5> <H6>
  • 18.
  • 19.
    HTML tags: Paragraph<P> HTML browsers ignore white space between paragraphs = … <BODY> I love being a student at Ngee Ann Polytechnic in Singapore. </BODY>… … <BODY> I love being a student at Ngee Ann Polytechnic in Singapore. </BODY>…
  • 20.
    HTML tags: Paragraph<P> The paragraph tag forces the browser to start a new paragraph. New paragraphs always have a space between them
  • 21.
    HTML tags: Paragraph<P> whitespace
  • 22.
    HTML tags: LineBreak <br> Force the browser to break to the next line Paragraphs cause space between Line breaks have no space between
  • 23.
    HTML tags: LineBreak <br> no white space
  • 24.
    HTML tags: HorizontalRule <hr> Method for breaking up space Causes a line to appear across the webpage Default width is the entire page Width can be adjusted Thickness (size) can be adjusted
  • 25.
    Another way toformat text Lists can be ordered (number) or unordered (bullet point) HTML tags: Lists Oranges Apples Pears bananas Oranges Apples Pears bananas Unordered List
  • 26.
    Another way toformat text Lists can be ordered (number) or unordered (bullet point) HTML tags: Lists Oranges Apples Pears bananas Oranges Apples Pears bananas Ordered List
  • 27.
    ORDERED LIST <OL><LI> oranges <LI> apples <LI> pears <LI> bananas </OL> UNORDERED LIST <UL> <LI> oranges <LI> apples <LI> pears <LI> bananas </UL> HTML tags: Lists LI = List Item
  • 28.
  • 29.
    Definition List <DL>Useful for defining terms, words Same formatting as other lists <DL> <DT>orange <DD>A citrusy fruit <DT>banana <DD>A yellow fruit </DL> HTML tags: Lists Definition TITLE Definition DESCRIPTION
  • 30.
    HTML tags: ListsDefinition TITLE Definition DESCRIPTION
  • 31.
    HTML tags Ingeneral, all tags should have a closing tag <OL> </OL>, <H2></H2> Some tags don’t need closing tag because it is assumed <P>, <LI>, <HR>, <BR> Important to view document for formatting preview before going public
  • 32.
    XHTML tags Differentbrowser technologies targets different devices Therefore - by combining HTML and XML, and their strengths, we got a markup language that is useful now and in the future - XHTML. XHTML pages can be read by all XML enabled devices
  • 33.
    XHTML tags XHTMLis a combination of HTML and XML (eXtensible Markup Language). XHTML consists of all the elements in HTML 4.01 combined with the syntax of XML. XML is a markup language where everything has to be marked up correctly, which results in &quot;well-formed&quot; documents.
  • 34.
    “ Safe” XHTMLexample <?xml version= &quot; 1.0 &quot; encoding= &quot; utf-8 &quot; ?> <!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;DTD/xhtml1-strict.dtd&quot; > <html xmlns= &quot; http://www.w3.org/1999/xhtml1 &quot; xml:lang= &quot; en-ca &quot; lang= &quot; en-ca &quot; > <head> <title> ... </title> <meta http-equiv= &quot;content-type&quot; content= &quot; text/html;charset=utf-8 &quot; / > </head> <body> ..... </body> </html> space before slash
  • 35.
    XHTML tags Threetypes of XHTML pages, they are: Strict: Use with CSS Transitional: The Transitional DTD includes presentation attributes and elements that W3C expects to move to a style sheet. Use this when you need to use HTML's presentational features because your readers don't have browsers that support Cascading Style Sheets (CSS) Frameset: documents with frames Add the <!doctype> tag <!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;>
  • 36.
    How to writeproperly XHTML tags Use all lower case Attributes goes in quotes Close all tags Always nest tags properly