Download presentation
Presentation is loading. Please wait.
Published byKiera Vicary Modified over 9 years ago
1
HTML, Text, Images, Tables, Forms, New Tags, New Attributes Doncho Minkov Telerik Academy Web Design Course html5course.telerik.com Technical Trainer http://minkov.it
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: Hyperlinks: Hyperlinks and Sections Images: Images: Lists:, and Lists:, and HTML Special Characters 3. The and elements 3
4
4. Introducing to HTML5 Changed old tags New tags New Attributes New Structural Tags 4
5
Before HTML
6
Jaquard’s Loom First use of binary storage Punch cards 80 by 12 holes in size You could store anything Including a program 1 line = 1 card 6
7
Mainframe computers Stored program concept Assembly language A charming way to program using three letters Computers were quite expensive, many modern concepts were born: Job queue / batch mode Quality assurance Bugs (found by Grace Hopper) 7
8
Timesharing computers Shared resources Teletype machines Character encoding ASCII, UNICODE, UTF-8 CRLF Innovation File sharing, email, distributed computing, chat, games, security 8
9
Editors Edit, Vi, Emacs … CRT Displays On screen editing Arrow keys instead of H,J,K,L IBM 3270 – first electronic form like thing The computer mouse by Doug Engelbart Miniaturization of computers New architectures: 8 bit, 16 bit, IBM PC 9
10
Moore’s law Holds for more than 40 users Mean more accessible (cheaper) computers A slowdown (end by some) in hardware (chip) and software (OS) design innovation On the other hand, programming languages excel and developer like never before High level languages, not just Assembly Structured programming 10
11
Challenges before structured languages: How to do blocks? They used BEGIN and END Now we use curly braces {} Remove GOTO High level vs. Assembly It took a generation to figure it out Meanwhile game consoles were still assembly, so some things were unchanged 11
12
Object oriented programming Simula, Smaltalk, C++, Java … The actor model Graphical User Interface Hypercard HC types: stack, image, car, buttons, fields … Hypertalk powered behaviour No colors, no links, no colours, little security Eventually died out 12
13
Initially intelligent typewriters, but eventually becoming pieces of software Two main types: Binary – mostly proprietary Textual – extremely open 13
14
The grandfather of them all Two types of lines: A line starting with period (.) is instruction The rest are text Instructions could have parameters Instructions were often cryptic looking 14
15
Similar idea Colon (:) would be for commands Period (.) would turn the command off No display oriented instructions / commands Just document structure 15
16
Similar idea Colon (:) would be for commands Period (.) would turn the command off No display oriented instructions / commands Just document structure :h1.Chapter 1: Introduction :p.GML supports hierarchical containers like :ol :li.Ordered lists :li.Unordered lists :eol 16
17
Influenced by Scribe SGML Tags instead of commands An eventually HTML :eol -> ::ol -> :eol -> ::ol -> 17 <strong>Hello</strong>
18
Intended for simple document viewers Headings, paragraphs and lists It was not intended to be the application platform that we use today Comparison with SGML A smaller subset Much simpler Resilient syntax 18
19
HTML evolved driven by people and browsers New versions of HTML Inevitably a doctype Accompanying technologies CSS, JavaScript Plugins like Java, Flash, Silverlight Rich media and so on… 19
20
Web 101
21
WWW use classical client / server architecture HTTP is text-based request-response protocol 21 Page request Client running a Web Browser Server running Web Server Software (IIS, Apache, etc.) Server response HTTP HTTP
22
Web pages are text files containing HTML HTML – Hyper Text Markup Language A notation for describing document structure (semantic markup) formatting (presentation markup) Looks (looked?) like: A Microsoft Word document The markup tags provide information about the page content structure 22
23
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 Expression Web 23
24
Text, Images, Tables, Forms
25
HTML is comprised of “elements” and “tags” Begins with and ends with Begins with and ends with When writing XHTML, must define a namespace Elements (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
The HTML source code should be formatted to increase readability and facilitate debugging. Every block element should start on a new line. Every nested (block) element should be indented. Browsers ignore multiple whitespaces in the page source, so formatting is harmless. For performance reasons, formatting can be sacrificed 26
27
27 <html> My First HTML Page My First HTML Page This is some text... This is some text... </html> test.html
28
<html> My First HTML Page My First HTML Page This is some text... This is some text... </html> 28 Opening tag Closing tag An HTML element consists of an opening tag, a closing tag and the content inside.
29
<html> My First HTML Page My First HTML Page This is some text... This is some text... </html> 29 HTML header
30
<html> My First HTML Page My First HTML Page This is some text... This is some text... </html> 30 HTML body
31
Hyperlink Tags Image Tags Text formatting tags 31 <a href="http://www.telerik.com/" title="Telerik">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.
32
32 <html><head> Simple Tags Demo Simple Tags Demo </head><body> <a href="http://www.telerik.com/" title= "Telerik site">This is a link. "Telerik site">This is a link. Bold and italic text. Bold and italic text.</body></html> some-tags.html
33
33 <html><head> Simple Tags Demo Simple Tags Demo </head><body> <a href="http://www.telerik.com/" title= "Telerik site">This is a link. "Telerik site">This is a link. Bold and italic text. Bold and italic text.</body></html> some-tags.html
34
Live Demo
35
Tags can have attributes Attributes specify properties and behavior Example: Few attributes can apply to every element: id, style, class, title The id is unique in the document Content of title attribute is displayed as hint when the element is hovered with the mouse Some elements have obligatory attributes 35 Attribute alt with value " logo "
36
Heading Tags (h1 – h6) Paragraph Tags Sections: div and span 36 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 This is a div This is a div
37
37 <html> 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 </html> headings.html
38
<html> 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 </html> 38 headings.html
39
Live Demo
40
HTML Document Structure in Depth
41
It is important to have the correct vision and attitude towards HTML HTML is only about structure, not appearance Browsers tolerate invalid HTML code and parse errors – you should not Always think about semantics 41
42
HTML documents must start with a document type definition (DTD) 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 Example: See http://w3.org/QA/2002/04/valid-dtd-list.html for a list of possible doctypes http://w3.org/QA/2002/04/valid-dtd-list.html 42
43
XHTML is more strict than HTML Tags and attribute names must be in lowercase 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) 43
44
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! 44
45
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 some other tags, e.g. 45
46
Title should be placed between and tags Used to specify a title in the window titlebar Search engines and people rely on titles 46 Telerik Academy – Winter Season 2009/2010 Telerik Academy – Winter Season 2009/2010
47
Meta tags additionally describe the content contained within the page 47
48
The element 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 48
49
49 <html> JavaScript Example JavaScript Example function sayHello() { function sayHello() { document.write(" Hello World! "); document.write(" Hello World! "); } <script type= <script type= "text/javascript"> "text/javascript"> sayHello(); sayHello(); </html> scripts-example.html
50
Live Demo
51
The element embeds formatting information (CSS styles) into an HTML page 51 <html> p { font-size: 12pt; line-height: 12pt; } p { font-size: 12pt; line-height: 12pt; } p:first-letter { font-size: 200%; } p:first-letter { font-size: 200%; } span { text-transform: uppercase; } span { text-transform: uppercase; } Styles demo. Styles demo. Test uppercase. Test uppercase. </html> style-example.html
52
Live Demo
53
Comments can exist anywhere between the tags Comments start with Comments start with 53 Telerik Telerik...
54
The section describes the viewable portion of the page Starts after the section Begins with and ends with Begins with and ends with 54 <html> Test page Test page </html>
55
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 55
56
56 <!DOCTYPE html PUBLIC "-//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> Page Title Page Title 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
57
57 <!DOCTYPE html PUBLIC "-//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> Page Title Page Title 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
58
Live Demo
59
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 : 59 Fill Our Form Fill Our Form Parent Parent Catalog Catalog
60
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: 60 BASD BASD Please report bugs here (by e-mail only) Please report bugs here (by e-mail only)
61
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: 61 <img src="apply-now-button.jpg" /> src="apply-now-button.jpg" /> Switch to English version Switch to English version
62
Link to another location in the same document: Link to a specific location in another document: 62 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 </div>
63
63 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
64
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 64
65
Live Demo
66
66 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
67
67 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
68
Live Demo
69
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) height Number of pixels of the height width Number of pixels of the width border Size of border, 0 for no border 69
70
: Draws a horizontal rule (line): : Deprecated! 70 Hello World! Hello World! Font3 Font3 Font+4 Font+4
71
71 <html> Miscellaneous Tags Example Miscellaneous Tags Example Hello World! Hello World! Font3 Font3 Font+4 Font+4 </html> misc.html
72
Live Demo
73
a.Apple b.Orange c.Grapefruit Create an Ordered List using : Attribute values for type are 1, A, a, I, or i 73 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>
74
Create an Unordered List using : Attribute values for type are: disc, circle or square 74 Apple Orange Pear o Apple o Orange o Pear Apple Orange Pear Apple Apple Orange Orange Grapefruit Grapefruit </ul>
75
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 75 <dl><dt>HTML</dt> A markup language … A markup language … <dt>CSS</dt> Language used to … Language used to … </dl>
76
76 Apple Apple Orange Orange Grapefruit Grapefruit </ol> Apple Apple Orange Orange Grapefruit Grapefruit </ul><dl> HTML HTML A markup lang… A markup lang… </dl> lists.html
77
Live Demo
78
££ 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 78
79
79 <p>[>> 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™ special-chars.html
80
80 <p>[>> 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™ special-chars.html
81
Live Demo
83
Block elements add a line break before and after them, and expand to 100% width ,,, are block elements Inline elements don’t break the text before and after them ,, are inline elements http://www.w3.org/TR/CSS2/visuren.html#blo ck-boxes http://www.w3.org/TR/CSS2/visuren.html#blo ck-boxes http://www.w3.org/TR/CSS2/visuren.html#blo ck-boxes 83
84
creates logical divisions within a page Block style element Used with CSS Example: 84 DIV example DIV example This one is only a test. This one is only a test. div-and-span.html
85
Live Demo
86
Inline style element Useful for modifying a specific portion of text Don't create a separate area (paragraph) in the document Makes sense only with some CSS 86 This one is only a test. This one is only a test. This one is another TEST. This one is another TEST. span.html
87
Live Demo
88
http://www.w3.org/TR/html4/index/elements. html http://www.w3.org/TR/html4/index/elements. html http://www.w3.org/TR/html4/index/elements. html http://www.htmldog.com/reference/htmltags/ http://www.htmldog.com/reference/htmltags/ 88
89
What the … is HTML 5?
90
HTML5 – the next major revision of the HTML Currently under development Far away from final version Developed under the HTML 5 working group of the World Wide Web Consortium (W3C) in 2007 First Public Working Draft of the specification January 22, 2008 Parts of HTML5 are being implemented in browsers before the whole specification is ready 90
91
1991 – HTML first mentioned – Tim Berners-Lee – HTML tags 1993 – HTML (first public version, published at IETF) 1993 – HTML 2 draft 1995 – HTML 2 – W3C 1995 – HTML 3 draft 1997 – HTML 3.2 – “Wilbur” 1997 – HTML 4 – ”Cougar” – CSS 1999 – HTML 4.01 (final) 2000 – XHTML draft 2001 – XHTML (final) 2008 – HTML5 / XHTML5 draft 2011 – feature complete HTML5 2022 – HTML5 – final specification 91
92
Latest version is HTML5 Aimed to have all of the power of native applications Run on any platform (Windows, Linux, iPhone, Android, etc.) New features should be based on HTML, CSS, DOM and JavaScript Reduce the need for external plugins Better error handling More markup to replace scripting 92
93
What a Designer Should Know?
94
Doctype tag: HTML tag: Meta tag: Link tag:
95
Better layout structure: new structural elements <header> <footer> <nav><aside><section> <header> <article> <footer>
96
Elements like header and footer are not meant to be only at the top and bottom of the page Header and footer of each document section Not very different from tag but are more semantically well defined in the document structure
97
<body> HTML 5 Presentation HTML 5 Presentation New Layout Structure New Layout Structure </header> <ul> Lecture Lecture </ul> Demos </ul> Trainers Trainers </ul> </nav>
98
First Paragraph First Paragraph </header> Some text Some text <aside> more info more info </aside> <footer> Done by Doncho Minkov, (c) 2011, Telerik Academy Done by Doncho Minkov, (c) 2011, Telerik Academy </footer></body>
99
Live Demo
100
For external content, like text from a news-article, blog, forum, or any other external source For content aside from (but related to) the content it is placed in For describing details about a document, or parts of a document A caption, or summary, inside the details element
101
For text that should be highlighted For a section of navigation For a section in a document (e.g. chapters, headers, footers) Word break. For defining an appropriate place to break a long word or sentence Other tags ,,,, etc.
102
Media Tags Attributes: autoplay, controls, loop, src Attributes: autoplay, controls, loop, height, width, src Audio tag is not supported Audio tag is not supported</audio>
103
Live Demo
104
Defines embedded content, such as a plug-in Attributes src="url", type="type"
105
New attributes AttributeDescriptionAutocomplete ON / OFF. In case of “ on ”, the browser stores the value, auto fill when the user visits the same form next time Autofocus Autofocus. Input field is focused on page load Required Required. Mandates input field value for the form submit action Draggable True / false indicates if the element is draggable or not
106
New type(s) AttributeDescriptionNumber/Range Restricts users to enter only numbers. Additional attributes min, max and step and value can convert the input to a slider control or a spin box date, month, week, time, date + time, and date + time - time zone Providers a date picker interface. Email Input type for Email Addresses URL Input field for URL address Telephone Input type for Telephone number
107
Questions? http://academy.telerik.com
108
1. Write an HTML page like the following: * Use headings and divs 108
109
2. Write an HTML page like the following: 3. Write an HTML page looking like the PNG file named 3.Introduction.PNG. Using the tag add anchors to the corresponding sections in the same page. 109
110
4. Create an user profile Web page Profile.html, friends page named Friends.html and info page named Info.html. Link them to one another using tag 110
111
111 5. Create a Web site like the following: See the image InetJava-site.png.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.