Learning Objectives. Review html Learn to write a basic webpage in html Understand what the basic building blocks of html are

Similar documents
Basics of Web Design, 3 rd Edition Instructor Materials Chapter 2 Test Bank

A HTML document has two sections 1) HEAD section and 2) BODY section A HTML file is saved with.html or.htm extension

Programmazione Web a.a. 2017/2018 HTML5

Appendix D CSS Properties and Values

Text and Layout. Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 11. This presentation 2004, MacAvon Media Productions

HTML. Based mostly on

Make a Website. A complex guide to building a website through continuing the fundamentals of HTML & CSS. Created by Michael Parekh 1

HTML Summary. All of the following are containers. Structure. Italics Bold. Line Break. Horizontal Rule. Non-break (hard) space.

HTML Hyper Text Markup Language

INTRODUCTION TO HTML5! HTML5 Page Structure!

More about HTML. Digging in a little deeper

3.1 Introduction. 3.2 Levels of Style Sheets. - HTML is primarily concerned with content, rather than style. - There are three levels of style sheets

Index. alt, 38, 57 class, 86, 88, 101, 107 href, 24, 51, 57 id, 86 88, 98 overview, 37. src, 37, 57. backend, WordPress, 146, 148

CSC 121 Computers and Scientific Thinking

recall: a Web page is a text document that contains additional formatting information in the HyperText Markup Language (HTML)

CMPT 165: More CSS Basics

As we design and build out our HTML pages, there are some basics that we may follow for each page, site, and application.

CMPT 165 INTRODUCTION TO THE INTERNET AND THE WORLD WIDE WEB

- HTML is primarily concerned with content, rather than style. - However, tags have presentation properties, for which browsers have default values

Html basics Course Outline

Introduction to WEB PROGRAMMING

Certified HTML5 Developer VS-1029

Session 3.1 Objectives Review the history and concepts of CSS Explore inline styles, embedded styles, and external style sheets Understand style

ITNP43: HTML Lecture 4

CSC Web Programming. Introduction to HTML

HTML & CSS. SWE 432, Fall 2017 Design and Implementation of Software for the Web

COSC 2206 Internet Tools. CSS Cascading Style Sheets

Downloads: Google Chrome Browser (Free) - Adobe Brackets (Free) -

HTML TAG SUMMARY HTML REFERENCE 18 TAG/ATTRIBUTE DESCRIPTION PAGE REFERENCES TAG/ATTRIBUTE DESCRIPTION PAGE REFERENCES MOST TAGS

3.1 Introduction. 3.2 Levels of Style Sheets. - The CSS1 specification was developed in There are three levels of style sheets

- The CSS1 specification was developed in CSS2 was released in CSS2.1 reflects browser implementations

CSS: The Basics CISC 282 September 20, 2014

HTML TUTORIAL ONE. Understanding What XHTML is Not

Introduction to Web Tech and Programming

ICT IGCSE Practical Revision Presentation Web Authoring

A Balanced Introduction to Computer Science, 3/E

HTML/XML. HTML Continued Introduction to CSS

Management Information Systems

Chapter 4. Introduction to XHTML: Part 1

ID1354 Internet Applications

- The CSS1 specification was developed in CSSs provide the means to control and change presentation of HTML documents

Web Development & Design Foundations with HTML5 & CSS3 Instructor Materials Chapter 2 Test Bank

CSS.

CS 350 COMPUTER/HUMAN INTERACTION. Lecture 6

Review Question 1. Which tag is used to create a link to another page? 1. <p> 2. <li> 3. <a> 4. <em>

CS105 Course Reader Appendix A: HTML Reference

Reading 2.2 Cascading Style Sheets

Chapter 1 Getting Started with HTML 5 1. Chapter 2 Introduction to New Elements in HTML 5 21

COPYRIGHTED MATERIAL. Contents. Chapter 1: Creating Structured Documents 1

Creating A Website - Part 1: Web Design principles, HTML & CSS. CSS Color Values. Hexadecimal Colors. RGB Color

8/19/2018. Web Development & Design Foundations with HTML5. Learning Objectives (1 of 2) More on Relative Linking. Learning Objectives (2 of 2)

EECS1012. Net-centric Introduction to Computing. Lecture 3: CSS for Styling

COMP519 Web Programming Lecture 3: HTML (HTLM5 Elements: Part 1) Handouts

Announcements. Paper due this Wednesday

Hyper Text Markup Language

ICT IGCSE Practical Revision Presentation Web Authoring

WEBSITE PROJECT 2 PURPOSE: INSTRUCTIONS: REQUIREMENTS:

CHAPTER 2 MARKUP LANGUAGES: XHTML 1.0

Introduction to Multimedia. MMP100 Spring 2016 thiserichagan.com/mmp100

Study Guide 2 - HTML and CSS - Chap. 6,8,10,11,12 Name - Alexia Bernardo

CSS Styles Quick Reference Guide

CSS مفاهیم ساختار و اصول استفاده و به کارگیری

BASICS OF WEB DESIGN CHAPTER 2 HTML BASICS KEY CONCEPTS

Hyper Text Markup Language

Adding CSS to your HTML

Review of HTML. Chapter Pearson. Fundamentals of Web Development. Randy Connolly and Ricardo Hoar

QUICK REFERENCE GUIDE

HTML CS 4640 Programming Languages for Web Applications

8/19/2018. Web Development & Design Foundations with HTML5. Learning Objectives (1 of 2) Learning Objectives (2 of 2)

Tutorial 3: Working with Cascading Style Sheets

8a. Cascading Style Sheet

Introduction to HTML & CSS. Instructor: Beck Johnson Week 2

Understanding this structure is pretty straightforward, but nonetheless crucial to working with HTML, CSS, and JavaScript.

Markup Language SGML: Standard Generalized Markup Language. HyperText Markup Language (HTML) extensible Markup Language (XML) TeX LaTeX

CSCE 101. Creating Web Pages with HTML5 Applying style with CSS

Module 2 (VII): CSS [Part 4]

HTML5 & CSS 8 th Edition. Chapter 2 Building a Webpage Template with HTML5

AGENDA :: MULTIMEDIA TOOLS :: (1382) :: CLASS NOTES

Client-Side Web Technologies. CSS Part I

Cascading Style Sheets. Overview and Basic use of CSS

Introduction to using HTML to design webpages

CSS Cascading Style Sheets

Note: The screenshots in this document were taken on Windows in Firefox, which may differ from your system.

HTML BEGINNING TAGS. HTML Structure <html> <head> <title> </title> </head> <body> Web page content </body> </html>

CSS for Styling CS380

NEW WEBMASTER HTML & CSS FOR BEGINNERS COURSE SYNOPSIS

Web Designing HTML5 NOTES

HTML. Mohammed Alhessi M.Sc. Geomatics Engineering. Internet GIS Technologies كلية اآلداب - قسم الجغرافيا نظم المعلومات الجغرافية

Web Design and Development Tutorial 03

Web Development and Design Foundations with HTML5 8th Edition

Symbols INDEX. !important rule, rule, , 146, , rule,

Web Design and Application Development

Certified HTML Designer VS-1027

Styles, Style Sheets, the Box Model and Liquid Layout

Zen Garden. CSS Zen Garden

CSE 154 LECTURE 3: MORE CSS

Introduction to CSS. Fijihosting.com Introduction to CSS page 1. What are style sheets? Lovely! How do I use them?

HTML Organizing Page Content

The Benefits of CSS. Less work: Change look of the whole site with one edit

Tutorial 2 - HTML basics

Transcription:

HTML CSCI311

Learning Objectives Review html Learn to write a basic webpage in html Understand what the basic building blocks of html are

HTML: Hypertext Markup Language HTML5 is new standard that replaces previous versions of HTML elements are used to structure the page content e.g., <h2> second-level header, <p> paragraph markup language: tags are added to content to give it structure open tag <xyz> closing tag </xyz> self-closing tag <xyz /> tags are always surrounded by < >

Basic structure of HTML file <!DOCTYPE html> <html xmlns= http://www.w3.org/1999/xhtml lang= en > <head> <meta charset= utf-8 /> <title>basic Web Page</title> <!-- other head stuff --> </head> <body> <!-- page content here --> </body> </html>

Creating a web page Demo here: basic Page

HTML elements over 100 different html elements meta information is placed in the head element content information is placed in the body element Two main kinds of element: flow elements (or block) phrasing element (or inline)

Classifying HTML elements top-level elements: html, head and body head elements: placed inside the head title style link meta base script do not display on the page

Classifying HTML elements block-level elements flow elements that behave like paragraphs occupy 100% of available width stacked vertically with preceding and subsequent block elements article, h1-h6, header, footer, section, p, figure, canvas, pre, div ul, ol, dl, table, form, video

Classifying HTML elements inline elements phrasing elements that behave like words flow horizontally usually placed inside block elements a (anchor), audio, br, code, img, em, nav, samp span, strong, sub, sup, time, var

Syntax of HTML All tags begin with < and end with > tag name is given immediately following opening < unrecognized tags are ignored attributes are given following the tag name: <tag attribute1= value attribute2= value...> can be used instead of forgetting to close a quote can result in a blank page names and attributes are lowercase values are case sensitive attributes that have boolean values: true: attribute_name= attribute_name false: attribute_name=

Syntax of HTML unrecognized tags and attributes are ignored elements without closing tags are of the form <img /> ending / is optional for HTML5, needed for polyglot documents elements must be well-formed no bad nesting <p>stuff <strong></p></strong> attributes can be in any order white space is allowed between tag name and attributes around the = sign within attribute value (but should be avoided) body element may only directly contain block elements no free-stranding text no inline elements

HTML core attributes All HTML5 elements can have the following: id uniquely identifies an element in the page style gives presentation style class style class, or space-separated list of style classes title title for the element. Can be used as tool-top display hidden prevents element from being displayed when set to true contenteditable, draggable, dropzone, spellcheck, and more

Typical Webpage Architecture In detail we will look at: Headings and Paragraphs White space and line wrapping presentation styles lists links navbars images layout validation Demo of basic architecture

Headings and Paragraphs Six heading levels: h1-h6 block elements paragraph element: p can contain text and phrasing elements typically has a new line before and after lines wrapped to fit width extra white space in text ignored break element: <br /> can be used to insert blank line line break opportunity: <wbr /> can be used to break up long-running text like urls and emails

Headings and Paragraphs inline (phrasing) elements can be placed in a paragraph em emphasis q quote mark highlight strong like bold paragraphs and headings are left aligned by default

White Space and Wrapping in HTML white space separates text into words space (ASCII 32, entity ) tab (ASCII 9, entity ) formfeed (ASCII 12, entity &#x000c;) zero-width space (entity &#200B;) whitespace collapsing only one white space is rendered between characters line-breaking white space entities return (ASCII 13) newline (ASCII 10) only linebreak the code, not the content

White Space and Wrapping Only whitespace separates words: tags don t e.g., <p>the HTML<strong>5</strong> standard.</p> Yeilds: The HTML5 standard to force a line break: <br /> to force two words to stay on a line: non-breaking white space: or to indicate where a word can be broken across a line with a hyphen: soft hyphen: to indicate where long words can broken across a line without a hyphen: <wbr />

Phrasing (inline) elements link: a line break: br citation: cite emphasis (usually italics): em strong emphasis (usually bold): strong stronger emphasis (usually highlight): mark computer code: code deleted words (crossed out): del subscript: sub superscript: sup sample computer output: samp general phrasing element that can contain other phrasing elements: span

Presentation Styles To add non-default presentation style we use style rules Three ways: 1. place rules in a style sheet 2. include <style> elements in the head element 3. use the style attribute for individual elements <h1 style= color: darkgreen >This is Green</h1> style attribute takes precedence over styles in the style element style element takes precedence over style sheets

Some style properties foreground colour color background colour background-color text alignment text-align e.g., text-align: left left justified font size font-size e.g., font-size: x-small indentation text-indent e.g., text-indent: 3em margin margin-left: length margin-right: length

Style Length Units relative lengths: em: font-size of the current font ex: the x-height of the current font ch: the size of 0 in the current font absolute lengths (avoid) cm: centimeters in: inches mm: millimeters pc: picas (1pc = 12pt) pt: points (1pt = 1/72in) px: pixels (1px = 1/96in) not sensitive to resolution, or font size

Colours There are a number of ways to specify colours by name e.g., red, green, magenta ~150 colour names in CSS w3.org/tr/css3-color/#rgba-color by rgb value: #rrggbb #rgb rgb(r, g, b) base 10 numbers between 0 and 255 rgb (r%, g%, b%) rgba (r, g, b, a) a is alpha, ranging from 0 to 1 rgba (r%, g%, b%, a) hsl (hue, saturation, light) hsl(h, s%, l%) h is degrees 0 360 hsla(h, s%, l%, a)

Font font-family property lets you set font e.g., font-family: Times can list more than one font e.g., font-family: Arial, Helvetica, sans-serif always good to list a generic font family last, in case fonts are not found on host multi-word font family names enclosed single or double quotes

Font font-weight property controls how heavy font is e.g., font-weight: bolder font-size property controls size of font to a specific size e.g., font-size: small to an absolute size e.g., font-size: 16pt relatively e.g., font-size: smaller (or percentage)

Lists Three kinds of list in html5: bullet list ul element ordered list ol element definition list dl element each term <dt> is given a definition <dd> dt element can contain inline elements dd element can contain inline and block elements ul and ol can only contain list elements li li can contain block elements like paragraphs, headings and other lists

List styles Default list item marker for ul and ol is browser-dependent list-style-type property lets you customize list: e.g., <ul style= list-style-type: circle >... </ul> e.g., <ol style= list-style-type: upper-alpha >... </ol> style types include: disc, circle, square, none, decimal, lower-roman, lower-alpha... you can make an ul numbered you can make an ol with bullets list-style-image: url(imageurl) lets you customize bullet with an image list-style-position value outside or inside Demo: MarkerStyle.html

Links anchor tag: a e.g., <a href= URL >anchor</a> anchor can be: text, image, button, video link can also be attached to part of an image map links can be to other web pages e.g., <a href= http://viu.ca >VIU</a> local files (using relative paths) e.g., <a href=../pics/dog.png >Doggy</a> to parts of an html document (using the id attribute) e.g., <a href= #products >Products</a>

Links When opening external links (outside your site) it is good practice to open link in separate browser window <a href= http://www.w3.org/ target= _blank >The W3C Consortium</a> Make it clear that click will leave your site: placement of link in sidebar

Site Organization Place home file (usually index.html) in root directory use directories to organize files: images/, videos/, css/, js/, products/, services/ an index.html within each of these directories can be used as the lead page for that heading keep organization simple no more than depth 3 make sure navigation is simple and straightforward for user images videos public_html css media js index.html pic1.jpg pic2.jpg scripts.js mystyles.css

Linking to services to email <a href= mailto:email-address?subject=line > e.g., <a href= mailto:sarah.carruthers@viu.ca?subject=very%20important%20stuff >contact Sarah</a> note use of %20 to include spaces in subject line Download links: <a href= ftp://host:port/path-to-file > Telephone/SMS/Fax: <a href= tel:phone_number > <a href= sms:phone_number > <a href= fax:phone_number > VOIP <a href= callto:screen_name or phone_number >

Navbars Common to have horizontal and vertical navbars Main navigation commonly on horizontal Secondary navigation in vertical nav element creates navbars We will revisit this, including side nav and styling later

Images To include an image in a page: <imgsrc= hat.jpg alt= A nice hat style= width:160px; height:200px /> self closing tag src attribute gives URL to download image to be displayed it replaces the img tag in content of page do not hot link images alt tag is required, gives alternate text (not tool tip) optional height and width attributes best practice is to make sure it matches original, or very close to it To make a clickable image link place an image tag in the anchor of <a>

Layout Come up with a clear and consistent layout Make sure important things are easy to find Ex: Layout.html

Debugging and Validation After you ve written your code: spell check test with many browsers test on different platforms test on different screen size/resolution can be done within browser too, but best to also test on devices Test all links validator.w3.org/checklink Use a validator: validator.w3.org for HTML jigsaw.w3.org/css-validator for CSS

Summary HTML is used to structure content We ve seen a number of different kinds of elements Block and inline elements Basic structure and contents of a web page