Presentation is loading. Please wait.

Presentation is loading. Please wait.

HTML, Text, Images, Tables, Forms Svetlin Nakov Telerik Corporation www.telerik.com.

Similar presentations


Presentation on theme: "HTML, Text, Images, Tables, Forms Svetlin Nakov Telerik Corporation www.telerik.com."— Presentation transcript:

1 HTML, Text, Images, Tables, Forms Svetlin Nakov Telerik Corporation www.telerik.com

2 1. Introduction to HTML  How the Web Works?  What is a Web Page?  My First HTML Page  Basic Tags: Hyperlinks, Images, Formatting  Headings and Paragraphs 2. HTML in Details  The Declaration  The Section: Title, Meta, Script, Style 2

3  The Section  Text Styling and Formatting Tags  Hyperlinks: Tag  Hyperlinks and Sections  Images: tag  Lists: and Tag  HTML Special Characters 3. The and Tags 3

4  WWW use classical client / server architecture  HTTP is text-based request-response protocol 4 Page request Client running a Web Browser Server running Web Server Software (IIS Apache, etc.) Server response HTTP HTTP

5  Web pages are text files containing HTML  HTML – Hyper Text Markup Language  A notation for describing  document structure (semantic markup)  formatting (presentation markup)  Looks like:  A Microsoft Word document  The markup tags tell the Web browser how to display the page 5

6  An HTML file must have an.htm or.html file extension  HTML files can be created with text editors:  NotePad, NotePad ++, PSPad  Or HTML editors (WYSIWYG Editors):  Microsoft FrontPage  Macromedia Dreamweaver  Netscape Composer  Microsoft Word 6

7 Text, Images, Tables, Forms

8 8 <html> My First HTML Page My First HTML Page This is some text that will This is some text that will appear on the web page. appear on the web page. </html> test.html

9 <html> My First HTML Page My First HTML Page This is some text that will This is some text that will appear on the web page. appear on the web page. </html> 9 Opening tag Closing tag

10 <html> My First HTML Page My First HTML Page This is some text that will This is some text that will appear on the web page. appear on the web page. </html> 10 HTML header

11 <html> My First HTML Page My First HTML Page This is some text that will This is some text that will appear on the web page. appear on the web page. </html> 11 HTML body

12  Hyperlink Tags  Image Tags  Formatting tags 12 <a href="http://www.telerik.com/" title="Telerik">Link to Telerik Web site title="Telerik">Link to Telerik Web site This text is bold This text is bold And this is underlined And this is underlined Some centered text Some centered text

13 13 <html> <a href="http://www.devbg.org/" title= <a href="http://www.devbg.org/" title= "BASD">This is a link to some URL "BASD">This is a link to some URL This text is bold This text is bold And this is underlined And this is underlined Some centered text Some centered text </html> some-tags.html

14 14 <html> <a href="http://www.devbg.org/" title= <a href="http://www.devbg.org/" title= "BASD">This is a link to some URL "BASD">This is a link to some URL This text is bold This text is bold And this is underlined And this is underlined Some centered text Some centered text </html> some-tags.html

15 Live Demo

16  Tags could have attributes  Attributes specify their properties and behavior  Example:  Few attributes that apply to every element:  id, style, class, title  The id is unique in the document  Content of title attribute is displayed as hint when element is hovered with mouse  Some elements have obligatory attributes 16 Attribute alt with value " logo "

17  Heading Tags  Paragraph Tags  Sections: div and span 17 This is my first paragraph This is my first paragraph This is my second paragraph This is my second paragraph Heading 1 Heading 1 Sub heading 2 Sub heading 2 Sub heading 3 Sub heading 3 <div align="center" style= "background: skyblue">This is a div "background: skyblue">This is a div

18 18 <html> Headings and Headings and paragraphs paragraphs Heading 1 Heading 1 Sub heading 2 Sub heading 2 Sub heading 3 Sub heading 3 This is my first paragraph This is my first paragraph This is my second paragraph This is my second paragraph <div align="center" <div align="center" style="background:skyblue"> style="background:skyblue"> This is a div This is a div </html> headings.html

19 <html> Headings and Headings and paragraphs paragraphs Heading 1 Heading 1 Sub heading 2 Sub heading 2 Sub heading 3 Sub heading 3 This is my first paragraph This is my first paragraph This is my second paragraph This is my second paragraph <div align="center" <div align="center" style="background:skyblue"> style="background:skyblue"> This is a div This is a div </html> 19 headings.html

20 Live Demo

21 HTML Document Structure in Depth

22  At their beginning HTML documents must have a document type declaration  It tells the Web browsers how to handle the HTML data  Possible versions: HTML 2.0, HTML 3.2, HTML 4.01, XHTML 1.0, XHTML 1.1, …  Example:  See http://www.w3.org/QA/2002/04/Web-Quality for a list of possible doctypes http://www.w3.org/QA/2002/04/Web-Quality 22

23  XHTML is more strict then HTML  All tags must be properly nested (HTML allows text )  Tags and attribute names must be in lowercase  Attribute values must be in " " (HTML allows ' ')  All tags must be closed (, ) while HTML allows and  All tags must be closed (, ) while HTML allows and  XHTML allows only one root element (HTML allows more than one) 23

24  Many element attributes are deprecated in XHTML, most are moved to CSS  Attribute minimization is forbidden, e.g.  Note: Web browsers load XHTML faster than HTML and valid code faster than invalid! 24

25  HTML is comprised of elements called “tags”  Begins with and ends with  Begins with and ends with  When writing XHTML, must define a namespace  Tags are nested one inside another:  Tags have attributes:  HTML describes structure using two main sections: and  HTML describes structure using two main sections: and 25

26  Contains information that doesn’t show directly on the viewable page  Starts after the declaration  Begins with and ends with  Begins with and ends with  Contains mandatory single tag  Can contain multiple nested tags, e. g.:   26

27  Title should be placed between and tags  Used to specify a title to the Web page window  Search engines and people rely on titles 27 Telerik Academy – Winter Season 2009/2010 Telerik Academy – Winter Season 2009/2010

28  Meta tags additionally describe the content contained within the page 28

29  The tag is used to embed scripts into an HTML document  Script are executed in the client's Web browser  Scripts can live in the and in the sections  Supported client-side scripting languages:  JavaScript (it is not Java!)  VBScript  JScript 29

30 30 <html> JavaScript Example JavaScript Example function sayHello() { function sayHello() { document.write( document.write( " Hello World! "); " Hello World! "); } <script type= <script type= "text/javascript"> "text/javascript"> sayHello(); sayHello(); </html> scripts-example.html

31 Live Demo

32  The tag embeds formatting information (CSS styles) into a HTML page 32 <html> p { font-size: 12pt; line-height: 12pt } p { font-size: 12pt; line-height: 12pt } p:first-letter { font-size: 200%; float: left } p:first-letter { font-size: 200%; float: left } span { text-transform: uppercase } span { text-transform: uppercase } Styles demo. Styles demo. Test uppercase. Test uppercase. </html> style-example.html

33 Live Demo

34  Comments can exist anywhere between the tags  Comments start with  Comments start with 34 BASD Home BASD Home...

35  The section describes the viewable portion of the page  Starts after the section  Begins with and ends with  Begins with and ends with 35 <html> Test page Test page This is the Web page body! This is the Web page body! </html>

36  The tag has the following attributes:  Example: background Background image file ="URL" bgcolor Background color ="color" text Default text color ="color" link Hyperlink color ="color" vlink Visited hyperlink color ="color" * For color codes, see www.webreference.com/html/tools/colorizer/www.webreference.com/html/tools/colorizer/ 36

37 <h1></h1> Heading 1 <h2></h2> Heading 2 <h3></h3> Heading 3 <h4></h4> Heading 4 <h5></h5> Heading 5 <h6></h6> Heading 6 <p></p>Paragraph Line break  Text can be formatted as headings or regular paragraph text  Use these consistently!  by default doubles the spaces after each paragraph  is weird: the trailing “ / ” makes it XHTML compliant  Different styles of heading are available: 37

38  Text formatting tags modify the text between the opening tag and the closing tag  Ex. Hello makes “Hello” bold bold italicized underlined Sample superscript Sample subscript strong emphasized Preformatted text Quoted text block Deleted text – strike through 38

39 39 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html> Svetlin Nakov Svetlin Nakov Notice Notice This is a sample Web page. This is a sample Web page. Next paragraph: Next paragraph: preformatted. preformatted. More Info More Info Specifically, we’re using XHMTL 1.0 transitional. Specifically, we’re using XHMTL 1.0 transitional. Next line. Next line. </html> text-formatting.html

40 40 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html> Svetlin Nakov Svetlin Nakov Notice Notice This is a sample Web page. This is a sample Web page. Next paragraph: Next paragraph: preformatted. preformatted. More Info More Info Specifically, we’re using XHMTL 1.0 transitional. Specifically, we’re using XHMTL 1.0 transitional. Next line. Next line. </html> text-formatting.html

41 Live Demo

42  Link to a document called form.html on the same server in the same directory:  Link to a document called parent.html on the same server in the parent directory:  Link to a document called cat.html on the same server in the subdirectory stuff : 42 Fill Our Form Fill Our Form Parent Parent Catalog Catalog

43  Link to an external Web site:  Always use a full URL, including " http:// ", not just " www.somesite.com "  Using the target="_blank" attribute opens the link in a new window  Link to an e-mail address: 43 BASD BASD Please report bugs here (by e-mail only) Please report bugs here (by e-mail only)

44  Link to a document called apply-now.html  On the same server, in same directory  Using an image as a link button:  Link to a document called index.html  On the same server, in the subdirectory english of the parent directory: 44 <img src="apply-now-button.jpg" /> src="apply-now-button.jpg" /> Switch to English version Switch to English version

45  Link to another location in the same document:  Link to a specific location in another document: 45 Go to Introduction Go to Introduction... Introduction Introduction Go to Section 3.1.1 Go to Section 3.1.1... 3.1.1. Technical Background 3.1.1. Technical Background </a>

46 46 Fill Our Form Fill Our Form Parent Parent Catalog Catalog BASD BASD Please report bugs here (by e-mail only) Please report bugs here (by e-mail only) Switch to English version Switch to English version hyperlinks.html

47 Fill Our Form Fill Our Form Parent Parent Catalog Catalog BASD BASD Please report bugs here (by e-mail only) Please report bugs here (by e-mail only) Switch to English version Switch to English version hyperlinks.html 47

48 Live Demo

49 49 Table of Contents Table of Contents Introduction Introduction Some background Some background Project History Project History...the rest of the table of contents... Introduction Introduction... Section 1 follows here... Some background Some background... Section 2 follows here... Project History Project History... Section 2.1 follows here... links-to-same-document.html

50 50 Table of Contents Table of Contents Introduction Introduction Some background Some background Project History Project History...the rest of the table of contents... Introduction Introduction... Section 1 follows here... Some background Some background... Section 2 follows here... Project History Project History... Section 2.1 follows here... links-to-same-document.html

51 Live Demo

52  Inserting an image with tag:  Image attributes:  Example: src Location of image file (relative or absolute) alt Substitute text for display (e.g. in text mode) align Text alignment: bottom, middle, top height Number of pixels of the height width Number of pixels of the width border Size of border, 0 for no border 52

53  : Draws a horizontal rule (line):  : Deprecated!  : Changes font style  With CSS, there is no reason to use this tag 53 Hello World! Hello World! Font3 Font3 Font+4 Font+4

54 54 <html> Miscellaneous Tags Example Miscellaneous Tags Example Hello World! Hello World! Font3 Font3 Font+4 Font+4 </html> misc.html

55 Live Demo

56 a.Apple b.Orange c.Grapefruit  Create an Ordered List using :  Attribute values for type are 1, A, a, I, or i 56 1.Apple 2.Orange 3.Grapefruit A.Apple B.Orange C.Grapefruit I.Apple II.Orange III.Grapefruit i.Apple ii.Orange iii.Grapefruit Apple Apple Orange Orange Grapefruit Grapefruit </ol>

57  Create an Unordered List using :  Attribute values for type are:  disc, circle or square 57 Apple Orange Pear o Apple o Orange o Pear  Apple  Orange  Pear Apple Apple Orange Orange Grapefruit Grapefruit </ul>

58  Create definition lists using  Create definition lists using  Pairs of text and associated definition; text is in tag, definition in tag  Renders without bullets  Definition is indented 58 <dl><dt>HTML</dt> A markup language … A markup language … <dt>CSS</dt> Language used to … Language used to … </dl>

59 59 <html> Apple Apple Orange Orange Grapefruit Grapefruit Apple Apple Orange Orange Grapefruit Grapefruit HTML HTML A markup lang… A markup lang… </html> lists.html

60 Live Demo

61 ££ British Pound €€Euro "" Quotation Mark ¥¥ Japanese Yen —— Em Dash Non-breaking Space &&Ampersand >> Greater Than << Less Than ™™ Trademark Sign ®® Registered Trademark Sign ©© Copyright Sign Symbol HTML Entity Symbol Name 61

62 62 <html><head> Special HTML Characters Example Special HTML Characters Example </head><body> [>> Welcome [>> Welcome <<] <<] ►I have following cards: ►I have following cards: A♣, K♦ and 9♥. A♣, K♦ and 9♥. ►I prefer hard rock ♫ ►I prefer hard rock ♫ music ♫ music ♫ © 2006 by Svetlin Nakov & his team © 2006 by Svetlin Nakov & his team Telerik Academy™ Telerik Academy™ </body></html> special-chars.html

63 63 <html><head> Special HTML Characters Example Special HTML Characters Example </head><body> [>> Welcome [>> Welcome <<] <<] ►I have following cards: ►I have following cards: A♣, K♦ and 9♥. A♣, K♦ and 9♥. ►I prefer hard rock ♫ ►I prefer hard rock ♫ music ♫ music ♫ © 2006 by Svetlin Nakov & his team © 2006 by Svetlin Nakov & his team Telerik Academy™ Telerik Academy™ </body></html> special-chars.html

64 Live Demo

65

66  Block elements act as if there is a break before and after them  is a block element  Other block elements are,, headings, lists,, and etc.  Inline elements don’t break the text before and after them  is inline element  Most HTML elements are inline, e.g.  Most HTML elements are inline, e.g. 66

67  creates logical divisions within a page  Block style element  Used with CSS  Example: 67 DIV example DIV example This one is only a test. This one is only a test. div-and-span.html

68 Live Demo

69  Inline style element  Useful for modifying a specific portion of text  Don't create a separate area (paragraph) in the document  Very useful with CSS 69 This one is only a test. This one is only a test. This one is another TEST. This one is another TEST. span.html

70 Live Demo

71 Questions? http://academy.telerik.com


Download ppt "HTML, Text, Images, Tables, Forms Svetlin Nakov Telerik Corporation www.telerik.com."

Similar presentations


Ads by Google