HTML and CSS. Lecture 14 COMPSCI111/111G S1 2018

Similar documents
COMPSCI 111 / 111G An introduction to practical computing

HTML and CSS Lecture 15 COMPSCI111/111G SS 2018

COMPSCI 345 SOFTENG 350 Moiz Safurah

CSC Web Programming. Introduction to HTML

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

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

CSCU9B2: Web Tech Lecture 1

CSC 121 Computers and Scientific Thinking

11. HTML5 and Future Web Application

Creating Web Pages. Getting Started

1. The basic building block of an HTML document is called a(n) a. tag. b. element. c. attribute. d. container. Answer: b Page 5

Introduction to HTML. SSE 3200 Web-based Services. Michigan Technological University Nilufer Onder

CSC Web Technologies, Spring HTML Review

A Balanced Introduction to Computer Science, 3/E

ITNP43: HTML Lecture 3

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

How the Internet Works

Basic HTML. Lecture 14. Robb T. Koether. Hampden-Sydney College. Wed, Feb 20, 2013

Basic HTML. Lecture 14. Robb T. Koether. Hampden-Sydney College. Wed, Feb 20, 2013

INTRODUCTION TO WEB USING HTML What is HTML?

What You Will Learn Today

HTML Images - The <img> Tag and the Src Attribute

Chapter 4 A Hypertext Markup Language Primer

Basic HTML Lecture 14

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

The internet is a worldwide collection of networks that link millions of computers. These links allow the computers to share and send data.

Introduction to Computers and Their Applications

Web Development & Design Foundations with XHTML. Chapter 2 Key Concepts

Hyper Text Markup Language

Programmazione Web a.a. 2017/2018 HTML5

Hyper Text Markup Language

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

Management Information Systems

Creating Web Pages Using HTML

HTML Overview. With an emphasis on XHTML

Hyper Text Markup Language HTML: A Tutorial

Web Design and HTML. Web Page vs Web Site. Navigation. Links. A web page is a single page viewable using web browser. A web site is a set of web pages

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

Anatomy of an HTML document

introduction to XHTML

HYPERTEXT MARKUP LANGUAGE ( HTML )

The Structural Layer (Hypertext Markup Language) Webpage Design

Bridges To Computing

Web Design 101. What is HTML? HTML Tags. Web Browsers. <!DOCTYPE html> <html> <body> <h1>my First Heading</h1> <p>my first paragraph.

Islamic University of Gaza Faculty of Engineering Department of Computer Engineering ECOM Advanced Internet Technology Lab.

CSE 3. Marking Up with HTML. Comics Updates Shortcut(s)/Tip(s) of the Day Google Earth/Google Maps ssh Anti-Spyware

UNIT II Dynamic HTML and web designing

LING 408/508: Computational Techniques for Linguists. Lecture 14

More about HTML. Digging in a little deeper

Brief Intro to HTML. CITS3403 Agile Web Development. 2018, Semester 1

Introduction to HTML

More HTML. Images and links. Tables and lists. <h1>running in the family</h1> <h2>tonight 9pm BBC One</h2>

5/17/2009. Marking Up with HTML. An HTML Web Page File. Tags for Bold, Italic, and underline. Structuring Documents

Html basics Course Outline

Introduction to Computer Science (I1100) Internet. Chapter 7

HTML & CSS November 19, 2014

Chapter 4: Marking Up With HTML: A Hypertext tmarkup Language Primer

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

Chapter 4. Introduction to XHTML: Part 1

HTML OBJECTIVES WHAT IS HTML? BY FAITH BRENNER AN INTRODUCTION

Creating A Web Page. Computer Concepts I and II. Sue Norris

Title: Sep 12 10:58 AM (1 of 38)

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

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

HTML HTML. Chris Seddon CRS Enterprises Ltd 1

Web Publishing Basics I

Computer Programming. Dr. Deepak B Phatak Dr. Supratik Chakraborty Department of Computer Science and Engineering IIT Bombay

Motivation (WWW) Markup Languages (defined). 7/15/2012. CISC1600-SummerII2012-Raphael-lec2 1. Agenda

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

A Brief Introduction to HTML

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

Marking Up with HTML. Tags for Bold, Italic, and underline. An HTML Web Page File. Chapter 4: Marking Up With HTML: A. Formatting with Tags:

Chapter 4 A Hypertext Markup Language Primer

Unit 5 Web Publishing Systems Page 1 of 13 Part 4 HTML Part 4

MODULE 2 HTML 5 FUNDAMENTALS. HyperText. > Douglas Engelbart ( )

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

Introduction to Web Technologies

Introduction to Computer Science (I1100) Internet. Chapter 7

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

ID1354 Internet Applications

Research and Development. Matthew Stone THE VILLAGE. Department of Computer Science Center for Cognitive Science Rutgers University

CHAPTER 1: GETTING STARTED WITH HTML CREATED BY L. ASMA RIKLI (ADAPTED FROM HTML, CSS, AND DYNAMIC HTML BY CAREY)

Web Programming Week 2 Semester Byron Fisher 2018

HTTP & Websites. Web Browsers. Web Servers vs. Web sites. World Wide Web. Internet Explorer. Surfing the World Wide Web. Part 4. The World Wide Web

Announcements. 1. Class webpage: Have you been reading the announcements? Lecture slides and coding examples will be posted

Tutorial 1: HTML Tutorial (Windows Version) HTML (Hypertext Markup Language) Basics Objectives

HTML Overview formerly a Quick Review

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

HTML Hyper Text Markup Language

INTRODUCTION TO HTML5! HTML5 Page Structure!

HTML (Hypertext Mark-up language) Basic Coding

Chapter 2 Creating and Editing a Web Page

HTML. MPRI : Web Data Management. Antoine Amarilli Friday, December 7th 1/28

Part 1: HTML Language HyperText Make-up Language

LAB 2 INTRODUCTION TO HTML

MPT Web Design. Week 1: Introduction to HTML and Web Design

Introduction to HTML. Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island

AP CS P. Unit 2. Introduction to HTML and CSS

7300 Warden Avenue, Suite 503 Markham, Ontario Canada L3R 9Z6. Phone: Toll Free: Fax:

2.1 Origins and Evolution of HTML

Transcription:

HTML and CSS Lecture 14 COMPSCI111/111G S1 2018

Essential Tags HTML5 requires the following tags to be in your html source file: html head title body HTML5 02 2

Block-level tags Define the structure of a block u Headings u Paragraphs u Lists u Tables u Preformatted text HTML5 02 3

Paragraphs <p> u Defines a paragraph of text <html lang="en"> <head> <meta charset="utf-8"> <title>introduction to tags</title> </head> <body> <p>this is a very simple web page</p> <p> It contains two different paragraphs of text. </p> </body> </html> HTML5 02

Exercises Create a complete HTML5 document with the title Simple page. The only text that should appear on the page is Hello World. <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>simple Page</title> </head> <body> <p>hello World</p> </body> </html> HTML5 02 5

Headings Six levels of headings u <h1> u <h2> u <h3> u <h4> u <h5> u <h6> First level heading Second level heading Third level heading Fourth level heading Fifth level heading Sixth level heading HTML5 02 6

Headings <html lang="en"> <head> <meta charset="utf-8"> <title>introduction to tags</title> </head> <body> <h1>a very simple web page</h1> <p>it contains two paragraphs and two headings</p> <h2>second section</h2> <p>this section is less important</p> </body> </html> HTML5 02 7

Example of Head, Heading and Title <html lang="en"> <head> <meta charset= UTF-8 > <title> Titles, headings and heads</title> </head> <body> <h1>title</h1> <p>the title is part of the document head</p> <h2>head</h2> <p>the head is not shown on the page</p> <h2>heading</h2> <p>these come in different sizes and make up the content of the page. They should therefore be used only in the body.</p> <p>do not get confused</p> </body> </html> HTML5 02 8

Ordered Lists Ordered Lists u Automatically numbered u <ol> </ol> Contains the entire list u <li> </li> Used for each list item <p>structure of an HTML document</p> <ol> <li>html</li> <li>head</li> <li>body</li> </ol> HTML5 02 9

Unordered Lists Unordered Lists u Bullet Points u <ul> </ul> Contains the entire list u <li> </li> Used for each list item <p>structure of an HTML document</p> <ul> <li>html</li> <li>head</li> <li>body</li> </ul> HTML5 02 10

Description Lists Terms and explanations u <dl> </dl> Contains the entire list u <dt> </dt> Defines a term in a description list u <dd> </dd> Is used to describe a term in a description list <p>some definitions</p> <dl> <dt>html</dt> <dd>hypertext Markup Language</dd> </dl> HTML5 02 11

Tables <table> Used to format tables of informa2on By default, there are no borders shown HTML5 02 12

Tags required to format Tables Tags <table> </table> Surrounds the entire table <tr> </tr> Iden2fies a row in the table <td> </td> Each element/cell of data in the row Row <tr> </tr> <td> </td> <td> </td> Data HTML5 02 13

A simple table example <html lang="en"> <head> <meta charset= UTF-8 > <title>simple Table</title> </head> <body> <p>what follows is a simple table:</p> <table> <tr> <td>one Row</td><td>Two Columns</td> </tr> </table> </body> </html> HTML5 02 14

Exercises Write a fragment of HTML5 code that will generate a table with 2 rows and 1 column. The text in the first row should be first row and the text in the second row should be second row. <html lang="en"> <head> <meta charset="utf-8"> <title>simple Table</title> </head> <body> <table> <tr><td>first row</td></tr> <tr><td>second row</td></tr> </table> </body> </html> HTML5 02 15

Inline tags u Appear within the blocks u Apply to words within paragraphs etc. u Common inline tags u Line Breaks u Images u Hypertext References HTML5 02 16

Empty tags u Tags that apply at a given point u Do not format content u Only the opening tag is required. u Line breaks u <br> u Images u <img> HTML5 02 17

Line break u Breaks a line u Same as hitting the Enter key u Use <br> <p>hello Class</p> <p>hello<br>class</p> HTML5 02 18

Images u Pages may contain images u But images are not plain text u Can t be inserted directly into HTML page u Solution u Store the image on the internet (or locally on disk) u Tag contains the address of the image u Web browser loads image when required u Only use images the browser understands u GIF, JPG, PNG HTML5 02 19

Image tag <img> u Insert an image at this location src u The source file of the image u Attribute that specifies the file name alt u Attribute to specify alternate text u Displayed if the image can t load u Important for people with visual impairment <img src="filename" alt="description"> HTML5 02 20

<img> example An image is inserted inline, so it is used inside a block-level element (a paragraph in this example). <p> Here is one of my holiday pictures. <img src="empire.jpg" alt="the Empire State Building"> It was late December and it was very cold. </p> HTML5 02 2 1

Hypertext reference A link to another resource on the WWW u References to other documents u Pages, images, files, sections <a> u Anchor tag href u Attribute used to specify the destination of the link u URL <a href=" url ">link text</a> HTML5 02 22

URLs Fully specified u Protocol u Host name u Path u File Relative u Omit the first parts u Path and file u File http://www.cs.auckland.ac.nz/courses/compsci111/index.html /courses/compsci111/index.html lectures/index.html index.html HTML5 02 23

Exercises What HTML5 code is required to create a hypertext reference that links to a page at the locaaon: http://www.cs.auckland.ac.nz/courses/compsci111/ The underlined link on the page should be the text 111 home page. <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>simple Page</title> </head> <body> <p> <a href="http://www.cs.auckland.ac.nz/courses/compsci111/"> 111 home page</a> </p> </body> </html> HTML5 02 24

Validated Code u Online system to check correctness of code u Provided by W3C u http://validator.w3.org HTML5 02 25

Example <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>a sample page</title> </head> <body> <h1>example</h1> <p>this is a complete html5 web page. You can verify that all the code is correct using the <a href="http://validator.w3.org">w3c Validator</ a>.</p> <h2>images</h2> <p>if your code is correct, you will get this message showing that your page has validated.</p> <p> <img src="validated.png" alt="validated html5"> </p> <p> Author: Damir Azhar<br> Date: 19/01/15<br> </p> </body> </html> HTML5 02 26

Example page HTML5 02 27

Sections <section> tag defines a section in a HTML5 document. Can be used to split a web page into different sections. Is an example of a semantic element. An element that clearly defines its content to both the browser and the developer. HTML5 02 2 8

<section> example <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>section Tag Example</title> </head> <body> <h1>about Me</h1> <section> <h2>work</h2> <p>most of my work centres around COMPSCI 111 where I:</p> <ul> <li>lecture</li> <li>run labs</li> </ul> </section> <section> <h2>interests</h2> <p>my interests include:</p> <ul> <li>gaming</li> <li>reading</li> </ul> </section> </body> </html> HTML5 02 2 9