Lesson 2: HTML5 Coding.

Slides:



Advertisements
Similar presentations
HTML popo.
Advertisements

XHTML Week Two Web Design. 2 What is XHTML? XHTML is the current standard for HTML Newest generation of HTML (post-HTML 4) but has many new features which.
Creating Pages in XHTML
1 eVenzia Technologies Learning HTML, XHTML & CSS Chapter 1.
Copyright © 2004 ProsoftTraining, All Rights Reserved. Lesson 3: XHTML Coding © 2007 Prosoft Learning Corporation All rights reserved ITD 110 Web Page.
Site Development Foundations © 2004 ProsoftTraining All rights reserved.
XHTML1 Tables and Lists. XHTML2 Objectives In this chapter, you will: Create basic tables Structure tables Format tables Create lists.
Chapter 2 Introduction to HTML5 Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
Basics of HTML Shashanka Rao. Learning Objectives 1. HTML Overview 2. Head, Body, Title and Meta Elements 3.Heading, Paragraph Elements and Special Characters.
HTML (HyperText Markup Language)
Essential Tags Web Design – Sec 3-3 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I” Course materials.
Essential Tags Web Design – Sec 3-3 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I” Course materials.
CS134 Web Design & Development Creating a Basic Web Page Exerted from Mehmud Abliz slides.
Learning Web Design: Chapter 4. HTML  Hypertext Markup Language (HTML)  Uses tags to tell the browser the start and end of a certain kind of formatting.
HTML. WHAT IS HTML HTML stands for Hyper Text Markup Language HTML is not a programming language, it is a markup language A markup language is a set of.
HTML Hyper-Text Markup Language or tags. HTML is a “tag” language Open and close tags Tags identified with angle brackets Basic format content (shorthand.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
Introduction to HTML. What is HTML? Hyper Text Markup Language (HTML) is a language for describing web pages. HTML is not a programming language, it is.
A Basic Web Page. Chapter 2 Objectives HTML tags and elements Create a simple Web Page XHTML Line breaks and Paragraph divisions Basic HTML elements.
INTRODUCTION. What is HTML? HTML is a language for describing web pages. HTML stands for Hyper Text Markup Language HTML is not a programming language,
HTML Basics BCIS 3680 Enterprise Programming. Web Client/Server Architecture 2  Your browser (the client) requests a Web page from a remote computer.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 2 Key Concepts 1 Copyright © Terry Felke-Morris.
HTML HyperText Markup Language ©Richard L. Goldman July 15, 2003.
©SoftMoore ConsultingSlide 1 Introduction to HTML: Basic Document Structure.
HTML Basics. HTML Coding HTML Hypertext markup language The code used to create web pages.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
XP 2 HTML Tutorial 1: Developing a Basic Web Page.
1999, COMPUTER SCIENCE, BUU Introduction to HTML Seree Chinodom
HTML. INDEX Introduction to HTML Creating Web Pages Commands And Tags Web Page.
INT222 – Internet Fundamentals
Tutorial #1 Using HTML to Create Web Pages. HTML, XHTML, and CSS HTML – HyperText Markup Language The tags the browser uses to define the content of the.
HTML Introduction. Lecture 7 What we will cover…  Understanding the first html code…  Tags o two-sided tags o one-sided tags  Block level elements.
Blended HTML and CSS Fundamentals 3 rd EDITION Tutorial 1 Using HTML to Create Web Pages.
Lesson 5. XHTML Tags, Attributes and Structure XHTML Basic Structure head and body titles Paragraph headings comments Document Presentation Manipulating.
HTML Structure & syntax
HTML Extra Markup CS 1150 Spring 2017.
HTML Basics.
CGS 3066: Lecture 2 Web Development and HTML5
Web Development & Design Foundations with HTML5 8th Edition
Marking Up with XHTML Tags describe how a web page should look
Introduction to basic HTML
Essential Tags Web Design – Sec 3-3
Elements of HTML Web Design – Sec 3-2
HTML.
HTML5 – Heading, Paragraph
Introducing XHTML: Module D: Text, Lists & Links
Coding, Testing and Valdating a Web Page
N100 Building a Simple Web Page
3.00cs HTML Overview 3.00cs Develop webpages.
Essential Tags Web Design – Sec 3-3
Chapter 1: Introduction to XHTML (part 1)
AN INTRODUCTORY LESSON TO MAKING A SIMPLE WEB PAGE By: RC Emily Solis
Introduction to XHTML.
Elements of HTML Web Design – Sec 3-2
HTML Vocabulary.
WEBSITE DESIGN Chp 1
Marking Up with XHTML Tags describe how a web page should look
Marking Up with XHTML Tags describe how a web page should look
CGS 3066: Lecture 2 Web Development and HTML5
1 Introduction to XHTML.
Introduction to HTML- Basics
Understand basic HTML and CSS terminology, concepts, and basic operations. Objective 3.01.
Marking Up with XHTML Tags describe how a web page should look
Pertemuan 1 Desain web Pertemuan 1
HyperText Markup Language
Marking Up with XHTML Tags describe how a web page should look
AN INTRODUCTION BY FAITH BRENNER
Marking Up with XHTML Tags describe how a web page should look
HTML5 and CSS3 Illustrated Unit B: Getting Started with HTML
CGS 3066: Web Programming and Design Fall 2019
Presentation transcript:

Lesson 2: HTML5 Coding

Lesson 2 Objectives Define elements and markup tags Identify HTML5 document structure tags Define Web site file structures Prepare your development environment Use paragraph formatting and block-level elements Use text-level elements Use ordered and unordered lists Use comments and good coding practices

Elements and Markup Tags Markup tags are element names enclosed in angle brackets, or wickets Tags embed the element information in the document so that a user agent (e.g., browser) will render text as instructed by the associated element The combination of elements, markup tags and standard text is loosely referred to as either "code" or "markup"

Container Tags Container tags contain page text between an opening and a closing tag, as shown Container tags are also known as non-empty tags HTML encourages the use of container or non-empty tags

Empty Tags An empty tag does not use a closing tag <br> <link> <img> <meta> An empty tag does not directly format a specified block of text, and therefore one tag can execute the instruction An empty tag can be written with a slash after the element to become a stand- alone non-empty tag <br> </br> (e.g., <br/>)

What Constitutes a Tag? An element – provides the main instruction of the tag (required… example: <html> <body> <title> <table>) An attribute – specifies a quality or describes a certain aspect of the element (only required if element requires an attribute) A value – gives value to the element and its attribute (instructs hyperlink to go to this site—optional unless required by attribute) Attribute Element Value <a href=http://www.certified.com</a>

Document Structure Tags HTML5 documents usually contain most of the following document structure components: A <!DOCTYPE> declaration (informs browser version of HTML—not case sensitive but most write in ALL CAPS) The <html> </html> tag (container for entire HTML document—nests all the code except <!DOCTYPE>) The <head> </head> tag (allows to insert <meta> tags, link to stylesheets, and <title> tag) Any <meta/> tags (specifies search engine keywords, revision dates, HTML5 character set used…usually HTF-8) A <link/> tag reference to a style sheet (recommended for HTML5, usually .css file, placed within the <head>) The <title> </title> tag (identifies document title—displayed in title bar of browser) The <body> </body> tag (includes all content of web page…video, audio, text, sidebar, etc)

Are HTML Tags Case-Sensitive? HTML tags are not case-sensitive, but older XHTML tags are case-sensitive It is recommended that you write code in lowercase letters to ensure consistency, compatibility and conformance

Document Type Declaration (<!DOCTYPE>) Describes the markup language and version of your code Placed at the top of the document If you do not specify a <!DOCTYPE> declaration, then two problems may arise: You will not be able to control how your code renders in the future You will not be able to use a markup validator Each version and flavor of HTML/XHTML has its own <!DOCTYPE> declaration <!DOCTYPE html> is used for HTML5 files See lesson 2: HTML5 Coding…page 2-7 AND 2-8 for more information

The <html> and <head> Tags The <html> </html> tags encompass all other HTML elements in the document The <head> </head> tags encompass several document elements, including: The <meta/> tag The <link/> tag that references a CSS file, if present The <title> </title> tags

The <body> tag All content to be displayed on the page through the user agent must be enclosed between the <body> </body> tags The <body> tag no longer has attributes with HTML5 The previous formatting attributes have been replaced by CSS and the inline CSS style attribute

Web Site File Structure When creating a Web page, you must consider the site’s file structure Your HTML and image files will be uploaded to a server eventually, so it is always good practice to organize your files as you create them

Preparing Your Development Environment Obtain a text editor Install multiple browsers Set file preferences

Paragraph Formatting and Block-Level Elements Elements that can affect entire paragraphs or multiple paragraphs The <p> tag The <br/> tag Text-level elements Elements that can affect as little as a single character or word <strong> or <em>

Heading Levels Block-level element Heading levels 1 through 6 <h1> </h1> <h2> </h2> <h3> </h3> <h4> </h4> <h5> </h5> <h6> </h6>

Tag Nesting in Markup Placing one pair of tags between another Proper: <h1> <em> ... </em> </h1> Improper: <h1> <em> ... </h1> </em> Improper: The <em> tag is opened within the <h1> tags, but closed after the </h1> tag If you fail to properly nest code, your pages may still render in some user agents, but they will not validate and may fail to render in the future

Primitive Formatting with the <pre> Tag The <pre> tag retains formatting on preformatted text Can be used to retain tabular format, spacing All text between <pre> </pre> tags will render as formatted in the HTML file

Indenting and Centering Text Use an inline CSS style attribute in the paragraph tag to: Center text Justify items to the right or left on a page The <blockquote> tag also centers and indents a block of text

Text-Level Elements Bold and italic text <strong> for bold text <em> for italic text

Phrase Elements and Font Style Elements The <b> element is a font style element, <strong> is a phrase element; both create boldface text The same is true of <i> and <em>, respectively, which both create italic or emphasized text The difference is that <b> specifically means apply the bold font style, whereas <strong> indicates that the text is to be given a strong appearance In short, <b> represents a font appearance instruction, whereas <strong> represents the weighting of the phrase relative to surrounding text

The <code>, <kbd> and <samp> Tags All make text appear in a fixed-width font in an HTML-compliant browser window Text-level phrase elements, their usage and their appearances:

Lists Ordered Unordered A numbered list Uses the <ol> element and requires a closing tag </ol> Unordered A bulleted list Uses the <ul> element and requires a closing tag </ul>

Lists (cont'd)

Good Coding Practice Write code for forward-compatibility: Close all tags Use lowercase letters within tags Surround attribute values with quotation marks Create universal markup that applies W3C standards consistently and thus renders consistently across most or all browsers

Good Coding Practice (cont’d) Create code that can be easily read by others Exceptions: Some code might encounter problems if it includes random spaces Always test your code in multiple browsers and validate it Adding hidden comments: <!-- Text inside these brackets will not appear --> Use comments to annotate code or document changes

Lesson 2 Summary Define elements and markup tags Identify HTML5 document structure tags Define Web site file structures Prepare your development environment Use paragraph formatting and block-level elements Use text-level elements Use ordered and unordered lists Use comments and good coding practices