Presentation is loading. Please wait.

Presentation is loading. Please wait.

HTML, Text, Images, Tables. 1. Introduction to HTML How the Web Works? How the Web Works? What is a Web Page? What is a Web Page? My First HTML Page My.

Similar presentations


Presentation on theme: "HTML, Text, Images, Tables. 1. Introduction to HTML How the Web Works? How the Web Works? What is a Web Page? What is a Web Page? My First HTML Page My."— Presentation transcript:

1 HTML, Text, Images, Tables

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

3 2. HTML in Details The Section The Section Text Styling and Formatting Tags Text Styling and Formatting Tags Hyperlinks:, Hyperlinks and Sections Hyperlinks:, Hyperlinks and Sections Images: Images: Lists:, and Lists:, and 3. HTML Tables 4. HTML Forms 3

4 WWW use classical client / server architecture WWW use classical client / server architecture HTTP is text-based request-response protocol 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 Web pages are text files containing HTML HTML – H yper T ext M arkup L anguage HTML – H yper T ext M arkup L anguage A notation for describing A notation for describing document structure (semantic markup) document structure (semantic markup) formatting (presentation markup) formatting (presentation markup) Looks (looked?) like: Looks (looked?) like: A Microsoft Word document A Microsoft Word document The markup tags provide information about the page content structure The markup tags provide information about the page content structure 5

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

7 Text, Images, Tables, Forms

8 HTML is comprised of elements and tags HTML is comprised of elements and tags Begins with and ends with Begins with and ends with Elements (tags) are nested one inside another: Elements (tags) are nested one inside another: Tags have attributes: Tags have attributes: HTML describes structure using two main sections: and HTML describes structure using two main sections: and 8

9 The HTML source code should be formatted to increase readability and facilitate debugging. The HTML source code should be formatted to increase readability and facilitate debugging. Every block element should start on a new line. Every block element should start on a new line. Every nested (block) element should be indented. Every nested (block) element should be indented. Browsers ignore multiple whitespaces in the page source, so formatting is harmless. Browsers ignore multiple whitespaces in the page source, so formatting is harmless. For performance reasons, formatting can be sacrificed For performance reasons, formatting can be sacrificed 9

10 10 My First HTML Page My First HTML Page This is some text... This is some text... test.html

11 My First HTML Page My First HTML Page This is some text... This is some text... 11 Opening tag Closing tag An HTML element consists of an opening tag, a closing tag and the content inside.

12 My First HTML Page My First HTML Page This is some text... This is some text... 12 HTML header

13 My First HTML Page My First HTML Page This is some text... This is some text... 13 HTML body

14 Hyperlink Tags Hyperlink Tags Image Tags Image Tags Text formatting tags Text formatting tags 14 Link to Telerik Web site title="Telerik">Link to Telerik Web site This text is emphasized. This text is emphasized. new line new line This one is more emphasized. This one is more emphasized.

15 15 Simple Tags Demo Simple Tags Demo This is a link. "Telerik site">This is a link. Bold and italic text. Bold and italic text. some-tags.html

16 16 Simple Tags Demo Simple Tags Demo This is a link. "Telerik site">This is a link. Bold and italic text. Bold and italic text. some-tags.html

17 Heading Tags (h1 – h6) Heading Tags (h1 – h6) Paragraph Tags Paragraph Tags 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

18 18 Headings and paragraphs Headings and 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 This is a div This is a div headings.html

19 Headings and paragraphs Headings and 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 This is a div This is a div 19 headings.html

20 HTML Document Structure in Depth

21 It is important to have the correct vision and attitude towards HTML It is important to have the correct vision and attitude towards HTML HTML is only about structure, not appearance HTML is only about structure, not appearance Browsers tolerate invalid HTML code and parse errors – you should not. Browsers tolerate invalid HTML code and parse errors – you should not. 21

22 HTML documents must start with a document type definition (DTD) HTML documents must start with a document type definition (DTD) It tells web browsers what type is the served code It tells web browsers what type is the served code Possible versions: HTML 4.01, XHTML 1.0 (Transitional or Strict), XHTML 1.1, HTML 5 Possible versions: HTML 4.01, XHTML 1.0 (Transitional or Strict), XHTML 1.1, HTML 5 Example: Example: See for a list of possible doctypes See for a list of possible doctypes 22

23 XHTML is more strict than HTML XHTML is more strict than HTML Tags and attribute names must be in lowercase Tags and attribute names must be in lowercase All tags must be closed (, ) while HTML allows and and implies missing closing tags ( par1 par2 ) All tags must be closed (, ) while HTML allows and and implies missing closing tags ( par1 par2 ) XHTML allows only one root element (HTML allows more than one) 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 Many element attributes are deprecated in XHTML, most are moved to CSS Attribute minimization is forbidden, e.g. Attribute minimization is forbidden, e.g. Note: Web browsers load XHTML faster than HTML and valid code faster than invalid! Note: Web browsers load XHTML faster than HTML and valid code faster than invalid! 24

25 Contains information that doesnt show directly on the viewable page Contains information that doesnt show directly on the viewable page Starts after the declaration Starts after the declaration Begins with and ends with Begins with and ends with Contains mandatory single tag Contains mandatory single tag Can contain some other tags, e.g. Can contain some other tags, e.g. 25

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

27 Meta tags additionally describe the content contained within the page Meta tags additionally describe the content contained within the page 27

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

29 29 JavaScript Example JavaScript Example function sayHello() { function sayHello() { document.write(" Hello World! "); document.write(" Hello World! "); }

Ads by Google