Presentation is loading. Please wait.

Presentation is loading. Please wait.

HTML 5 Overview Document Structure, Basic Tags, Common Elements SoftUni Team Technical Trainers Software University

Similar presentations


Presentation on theme: "HTML 5 Overview Document Structure, Basic Tags, Common Elements SoftUni Team Technical Trainers Software University"— Presentation transcript:

1 HTML 5 Overview Document Structure, Basic Tags, Common Elements SoftUni Team Technical Trainers Software University http://softuni.bg

2 Table of Contents 1.Hypertext Markup Language (HTML) 2.HTML Terminology: Tags, Attributes, Elements 3.HTML Document Structure:,,, DOCTYPE 4.HTML Common Elements: Text, Paragraphs, Headings, Hyperlinks, Images, Lists 5.Section Elements: and 6.Semantic Structural Tags 2

3 Hypertext Markup Language What is HTML?

4 Hypertext Markup Language  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 meta-information about the page content and define its structure  A HTML document consists of many tags (with nesting) 4

5 5  An HTML document must have an.htm or.html file extension  HTML files can be created with text editors:  Notepad++, GEdit, Sublime Text, WebStorm, …  Or HTML editors (WYSIWYG Editors):  Microsoft WebMatrix  Microsoft Expression Web  Microsoft Visual Studio  Adobe Dreamweaver  Adobe Edge Creating HTML Pages

6 HTML – Past, Present, Future  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  http://en.wikipedia.org/wiki/HTML5#Plan_2014 http://en.wikipedia.org/wiki/HTML5#Plan_2014 6

7 HTML Terminology Tags, Attributes and Elements

8 HTML Terminology  Concepts in HTML  Tags  Opening tag and closing tag  The smallest piece in HTML  Attributes  Properties of the tag, e.g. size, color, etc…  Elements  Combination of opening, closing tag and attributes 8

9 HTML Tags  Tags are the smallest piece in HTML Document  Start with " "  Two kinds of tags  Opening  Mark the start of an HTML element  Closing  Mark the end of an HTML element  Start with " " 9 Hello HTML5! Hello HTML5! Opening tag Closing tag Opening tag

10  Attributes are properties of the HTML elements  Used to specify size, color, borders, etc…  Has value surrounded by " " or ' ' (always a string) go to SoftUni go to SoftUni Attributes 10 Some tags don't have closing tag Some tags don't have s closing tag

11 Most Common Attributes  Common attributes for every HTML element  id – assigns a unique element identifier (ID)  class – assigns CSS class to styling  name – assigns a name (for form elements)  style – defines inline CSS style definitions  Specific attributes for certain elements  E.g. attribute src of the img element  Shows the path to the image to be shown 11

12 Custom Attributes  The data- attributes gives us the ability to embed custom data attributes on all HTML elements.  The stored (custom) data can then be used in the page's JavaScript.  Note: Custom attributes prefixed with "data-" will be completely ignored by the user agent. 12

13 HTML Elements  HTML elements are tags with content  Opening tag (+ attributes) + content + closing tag 13 SoftUni SoftUni Books Books </div> HTML element Opening tag Closing tag Element body (content)

14 HTML Terminology Live Demo

15 HTML Document Structure HTML Document, Doctype, Head, Body

16 HTML Document Structure  Essential elements for each HTML document:  html, head, body, doctype  The element  Used to mark the start and ending of the HTML document  All the content of the web page is inside this tag 16 <html> …</html>

17 Head Element  The contains markup not visible to the user  But helps the browser to render correctly the HTML document  What is in there?  Styles declarations  Scripts declarations  Encoding specification  Metadata definitions  The title tag – the text in the title (tab title) of the browser 17

18 DOCTYPE and Body Element  The DOCTYPE declaration is kind of the validator of the page  Tells the browser which version of HTML to use  Prefer the HTML 5 Doctype:  The element contains the entire visible markup  Headings, paragraphs, text, hyperlinks, images, etc…  Forms, textboxes, sliders, buttons, … 18

19 HTML Document Structure Live Demo

20 HTML Common Elements Used in 90% of All Internet Sites

21  The text formatting tags modify the text inside them  Ex. Hello makes the text "Hello" bold  Most of them are deprecated  use CSS instead! 21 HTML Element Result<strong></strong> strong (bold) <em></em>emphasized <sub></sub> Sample subscript <sup></sup> Sample superscript <b></b>bold <i></i>italicized <u></u>underlined <pre></pre> Preformatted text

22 Some Simple Tags  Hyperlink tag  Image tag  Text formatting tags 22 SoftUni SoftUni This text is emphasized. This text is emphasized. new line new line This one is more emphasized. This one is more emphasized.

23 23  External hyperlink  Local hyperlink  Relative hyperlink Hyperlinks SoftUni SoftUni Exercises Exercises … See the exercises See the exercises presentation presentation

24 24  Images are inserted by the tag  Recommended attributes for all images:  alt – image alternative text (acts like a description)  title – image description (shown on mouse hover)  width, height – the image size  Avoid using width and height attributes. Use CSS instead!  Always assign size to all images! Images <img src="logo.gif" alt="company logo" width="150px" height="150px" title="Company Slogan" /> width="150px" height="150px" title="Company Slogan" />

25 25  Embedded images have special src attribute:  Use embedded images only as last resort  Not cached  Hard to modify / maintain Embedded Images

26 Headings and Paragraphs  Heading Tags: –  Paragraph Tags:  Sections: and 26 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

27 Ordered Lists: Tag  Create an Ordered List using :  Attribute values for type are 1, A, a, I, or i 27 Java Java PHP PHP C++ C++ </ol> a.Java b.PHP c.C++ 1.Java 2.PHP 3.C++ A.Java B.PHP C.C++ I.Java II.PHP III.C++ i.Java ii.PHP iii.C++

28 Unordered Lists: Tag  Create an U nordered L ist using :  Attribute values for type are: disc, circle and square 28 Java PHP C++ o Java o PHP o C++  Java  PHP  C++ Java Java PHP PHP C++ C++ </ul>

29 Definition lists: tag  Create definition lists using  Pairs of text ( ) and associated definition ( )  Renders without bullets  Definition is indented 29 <dl><dt>HTML</dt> A markup language … A markup language … <dt>CSS</dt> Language used to … Language used to … </dl>

30 HTML Common Elements Live Demo

31 Section Elements and

32 The Tag  creates logical divisions within a page  Block element (rendered as rectangle)  Typically used with CSS classes  s can be nested as blocks  Example: 32 DIV example DIV example This one is only a test. This one is only a test.

33 Live Demo

34 The Tag  is inline styling element  Useful for modifying a specific portion of text  Inline element  doesn't create a separate area (paragraph) in the document  Used to style pieces of text 34 This one is only a test. This one is only a test. This one is another TEST. This one is another TEST.

35 Live Demo

36 Semantic Structural Tags

37 The Structure of a Web Page  A typical layout structure of a Web page

38 The "HTML 4 and Before" Way  Using s with ID s (the IDs are needed for styling) 38 <html> … … <body> </body></html>

39 The HTML 4 Way Live Demo

40 The HTML 5 Way  In HTML 5 there are semantic tags for layout ,,,, 40 <html> … … <body> </body></html>

41 Semantic Structural Tags Live Demo

42 42  HTML should be well formatted  Nested tags should be indented on the right, but not always!  Any sequence of whitespace converts to a single space HTML Code Formatting </div> </div> We have a space after the image! We have a space before the image!

43 43  Character entities are used to display reserved characters in HTML.  Characters, not present on your keyboard, can also be replaced by entities.  Entities can be presented by name or by number. HTML Entities <div> <div></div> <div></div></div> Result will be a div with content as text start (&) name end (;)

44 HTML Tips and Practices  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 always write correct HTML  Format your HTML code  Always think about semantics  The W3C HTML Validator is a way to validate your HTML  http://validator.w3.org http://validator.w3.org 44

45 45  HTML describe structured content (text, images, tables, figures, etc.) in HTML elements  Elements consist of open / closing tag + content  HTML documents consist of +  Commonly used HTML tags: ,,,,,,, …,,,,,,,  are block elements  is inline element Summary

46 ? ? ? ? ? ? ? ? ? HTML 5 - Overview https://softuni.bg/courses/web-fundamentals

47 License  This course (slides, examples, demos, videos, homework, etc.) is licensed under the "Creative Commons Attribution- NonCommercial-ShareAlike 4.0 International" licenseCreative Commons Attribution- NonCommercial-ShareAlike 4.0 International 47  Attribution: this work may contain portions from  "HTML Basics" course by Telerik Academy under CC-BY-NC-SA licenseHTML BasicsCC-BY-NC-SA  "CSS Styling" course by Telerik Academy under CC-BY-NC-SA licenseCSS StylingCC-BY-NC-SA

48 Free Trainings @ Software University  Software University Foundation – softuni.orgsoftuni.org  Software University – High-Quality Education, Profession and Job for Software Developers  softuni.bg softuni.bg  Software University @ Facebook  facebook.com/SoftwareUniversity facebook.com/SoftwareUniversity  Software University @ YouTube  youtube.com/SoftwareUniversity youtube.com/SoftwareUniversity  Software University Forums – forum.softuni.bgforum.softuni.bg


Download ppt "HTML 5 Overview Document Structure, Basic Tags, Common Elements SoftUni Team Technical Trainers Software University"

Similar presentations


Ads by Google