Basic Web Pages with XHTML (and a bit of CSS) CSE 190 M (Web Programming), Spring 2008 University of Washington Reading: Chapter 1, sections

Similar documents
Web Programming Step by Step

CSS for Styling CS380

Lecture Notes 2: Hypertext Markup Language (HTML)

CSE 154 LECTURE 1: BASIC HTML AND CSS

Lecture 2 HTML. April 11 th, Web Application Development CS 228 Web Development CS 303

CSS: The Basics CISC 282 September 20, 2014

CSC 443: Web Programming

Introduction to Web Design CSS Reference

Introduction to Web Design CSS Reference

CMPT 165 INTRODUCTION TO THE INTERNET AND THE WORLD WIDE WEB

<body bgcolor=" " fgcolor=" " link=" " vlink=" " alink=" "> These body attributes have now been deprecated, and should not be used in XHTML.

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

Reading 2.2 Cascading Style Sheets

CSc 337 LECTURE 3: CSS

Chapter 3 Style Sheets: CSS

CSS. Lecture 16 COMPSCI 111/111G SS 2018

ADDING CSS TO YOUR HTML DOCUMENT. A FEW CSS VALUES (colour, size and the box model)

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

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

CSS Lecture 16 COMPSCI 111/111G SS 2018

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

Salvedicta. - Hans Selye CSC 210

CS 1100: Web Development: Client Side Coding / Fall 2016 Lab 2: More HTML and CSS

CSC 121 Computers and Scientific Thinking

Appendix D CSS Properties and Values

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

CSS: Cascading Style Sheets

Controlling Appearance the Old Way

Lab Introduction to Cascading Style Sheets

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

HTML + CSS. ScottyLabs WDW. Overview HTML Tags CSS Properties Resources

CSE 154 LECTURE 3: MORE CSS

CS134 Web Site Design & Development. Quiz1

Lecture B3 Style : Algorithmic Thinking. Computing and Art : Nature, Power, and Limits CC 3.12: Fall 2007

A Balanced Introduction to Computer Science, 3/E

Fundamentals: Client/Server

Introduction to WEB PROGRAMMING

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

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

CS144 Notes: Web Standards

ITNP43: HTML Lecture 4

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

Web Site Design and Development Lecture 5

ID1354 Internet Applications

Html basics Course Outline

Web Publishing Basics I

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

Introduction to Web Technologies

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

Final Exam Study Guide

Welcome Please sit on alternating rows. powered by lucid & no.dots.nl/student

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

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

2. Write style rules for how you d like certain elements to look.

Assignments (4) Assessment as per Schedule (2)

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

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

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

Midterm 1 Review Sheet CSS 305 Sp 06

Introduction to using HTML to design webpages

Three Ways to Use CSS:

EECS1012. Net-centric Introduction to Computing. Lecture 2: HTML

CSC 337. Cascading Style Sheets. Marty Stepp, Rick Mercer

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

The building block of a CSS stylesheet. A rule consists of a selector and a declaration block (one or more declarations).

INFORMATICA GENERALE 2014/2015 LINGUAGGI DI MARKUP CSS

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

Session 4. Style Sheets (CSS) Reading & References. A reference containing tables of CSS properties

INTERNATIONAL UNIVERSITY OF JAPAN Public Management and Policy Analysis Program Graduate School of International Relations

Programmazione Web a.a. 2017/2018 HTML5

CSS.

Comp-206 : Introduction to Software Systems Lecture 23. Alexandre Denault Computer Science McGill University Fall 2006

Methods for configuring Cascading Style Sheets. Applying style to element name selectors. Style Rule Basics. CMPT 165: Cascading Style Sheets

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

Lab 4 CSS CISC1600, Spring 2012

Cascading Style Sheet Quick Reference

Introduction to Web Development

Cascading Style Sheets (CSS)

Certified HTML5 Developer VS-1029

Outline. Link HTML With Style Sheets &6&7XWRULDO &66 ;+70/ (GZDUG;LD

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

What is XHTML? XHTML is the language used to create and organize a web page:

CSS: Cascading Style Sheets

WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5

Fundamentals of Web Programming a

Chapter 4 A Hypertext Markup Language Primer

With HTML you can create your own Web site. This tutorial teaches you everything about HTML.

XHTML & CSS CASCADING STYLE SHEETS

In the early days of the Web, designers just had the original 91 HTML tags to work with.

COSC 2206 Internet Tools. CSS Cascading Style Sheets

Overview. Part I: Portraying the Internet as a collection of online information systems HTML/XHTML & CSS

**Method 3** By attaching a style sheet to your web page, and then placing all your styles in that new style sheet.

HTML & CSS November 19, 2014

Management Information Systems

A Brief Introduction to HTML

introduction to XHTML

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

ACSC 231 Internet Technologies

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

Scripting for Multimedia LECTURE 5: INTRODUCING CSS3

Transcription:

Basic Web Pages with XHTML (and a bit of CSS) CSE 190 M (Web Programming), Spring 2008 University of Washington Reading: Chapter 1, sections 1.1-1.3 Except where otherwise noted, the contents of this presentation are Copyright 2008 Marty Stepp and Jessica Miller and are licensed under the Creative Commons Attribution 2.5 License. Hypertext Markup Language (HTML) describes the content and structure of information on a web page not the same as the presentation (appearance on screen) surrounds text content with opening and closing tags each tag's name is called an element syntax: <element> content </element> example: This is a paragraph most whitespace is insignificant in HTML (it gets ignored or collapsed into a single space) XHTML a newer version of HTML, standardized in 2000 uses a markup format called XML (XML + HTML = XHTML) though the browser will accept some malformed HTML, we'll write "strict" XHTML that complies to the official web standards why use XHTML and web standards? more rigid and structured language more interoperable across different web browsers more likely that our pages will display correctly in the future can be interchanged with other XML data: SVG (graphics), MathML, MusicML, etc. a strict XHTML page uses some different syntax and tags

Structure of an XHTML page <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/tr/xhtml11/dtd/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> information about the page </head> <body> page contents </body> </html> a header describes the page and a body contains the page's contents an HTML page is saved into a file ending with extension.html Page title: <title> describes the title of the web page <title>cse 190 M: HTML</title> placed within the head of the page displayed in the web browser's title bar and when bookmarking the page Paragraph: paragraphs of text (block) You're not your job. You're not how much money you have in the bank. You're not the car you drive. You're not the contents of your wallet. You're not your khakis. You're the all-singing, all-dancing crap of the world. You're not your job. You're not how much money you have in the bank. You're not the car you drive. You're not the contents of your wallet. You're not your khakis. You're the all-singing, all-dancing crap of the world. placed within the body of the page more paragraph examples

Headings: <h1>, <h2>,..., <h6> headings to separate major areas of the page (block) <h1>university of Whoville</h1> <h2>department of Computer Science</h2> <h3>sponsored by Micro$oft</h3> University of Whoville Department of Computer Science Sponsored by Microsoft More heading examples Block and inline elements (explanation) block elements contain an entire large region of text examples: paragraphs, lists, table cells the browser places a margin of whitespace between block elements for separation inline elements affect a small amount of text and must be nested inside of a block element examples: bold text, code fragments, images the browser allows many inline elements to appear on the same line or within the same block element

Horizontal rule: <hr> a horizontal line to visually separate sections of a page (block) First paragraph <hr /> Second paragraph <hr /> First paragraph Second paragraph should be immediately closed with /> More about HTML tags some tags can contain additional information called attributes syntax: <element attribute="value" attribute="value"> content </element> example: <a href="page2.html">next page</a> some tags don't contain content; can be opened and closed in one tag syntax: <element attribute="value" attribute="value" /> example: <img src="bunny.jpg" alt="a bunny" /> example: <hr /> Links: <a> links, or "anchors", to other pages (inline) Search <a href="http://www.google.com/">google</a> now! Search Google now! uses the href attribute to specify the destination URL anchors are inline elements, so they must be placed inside a block element such as a p or h1

More about anchors <a href="1-internet.html">lecture Notes 1</a> <a href="http://www.google.com/" title="search">google</a> Lecture Notes 1 Google types of URLs that can appear in anchors: absolute (to another web site) relative (to another page on this web site) specify a tooltip with the title attribute more anchor examples to make links that open in new windows, we'll need to learn Javascript (later) Nesting tags Bad: <a href="1-internet.html">lecture Notes 1 This text also links to Lecture Notes 1</a> tags must be correctly nested (a closing tag must match the most recently opened tag) the browser may render it correctly anyway, but it is invalid XHTML

W3C XHTML Validator <a href="http://validator.w3.org/check/referer"> <img src="http://www.w3.org/icons/valid-xhtml11" alt="validate" /> </a> validator.w3.org checks your XHTML code to make sure it meets the official strict XHTML specifications more picky than the web browser, which may render malformed XHTML correctly Line break: <br> forces a line break in the middle of a block element (inline) Teddy said it was a hat,<br />So I put it on. Now Daddy's sayin',<br /> Where the heck's the toilet plunger gone? Teddy said it was a hat, So I put it on. Now Daddy's sayin', Where the heck's the toilet plunger gone? br should be immediately closed with /> br should not be used to separate paragraphs or used multiple times in a row to create spacing

Images: <img> inserts a graphical image into the page (inline) <img src="gollum.jpg" alt="gollum from LOTR" /> the src attribute specifies the image URL XHTML also requires an alt attribute describing the image More about images <a href="http://theonering.net/"> <img src="gandalf.jpg" alt="gandalf from LOTR" title="you shall not pass!" /> </a> if placed inside an a anchor, the image will become a link the title attribute specifies an optional tooltip

Comments: <!--... --> comments to document your HTML file or "comment out" text <!-- My web page, by Suzy Student CSE 190 D, Spring 2008 --> CSE courses are <!-- NOT --> a lot of fun! CSE courses are a lot of fun! Phrase elements : <em>, <strong> em: emphasized text (usually rendered in italic) strong: strongly emphasized text (usually rendered in bold) HTML is <em>really</em>, <strong>really</strong> fun! HTML is really, REALLY fun!

Introduction to CSS producing styles with Cascading Style Sheets The bad way to produce styles <font face="arial">welcome to Greasy Joe's. You will <b>never, <i>ever, <u>ever</u></i></b> beat <font size="+1" color="red">our</font> prices!</font> Welcome to Greasy Joe's. You will never, ever, EVER beat OUR prices! tags such as b, i, u, and font are discouraged in strict XHTML do not use the above tags on your homework assignments! why?? Cascading Style Sheets (CSS) describe the appearance, layout, and presentation of information on a web page (as opposed to HTML, which describes the content of the page) describe how information is to be displayed, not what is being displayed can be embedded in HTML document or placed into separate.css file advantage of.css file: one style sheet can be shared across many pages

Basic CSS rule syntax selector { property: value; property: value;... property: value; } p { font-family: sans-serif; color: red; } a CSS file consists of one or more rules each rule starts with a selector that specifies an HTML element(s) and then applies style properties to them Attaching a CSS file: <link> <head>... <link rel="stylesheet" type="text/css" href="filename" />... </head> <link rel="stylesheet" type="text/css" href="style.css" /> <link rel="stylesheet" type="text/css" href="http://www.google.com/uds/css/gsearch.css" /> a page can link to multiple style sheet files in case of a conflict (two sheets define a style for the same HTML element), the latter sheet's properties will be used

CSS properties for colors p { color: red; background-color: yellow; } This paragraph uses the style above. color: color of the element's text background-color: color that will appear behind the element Specifying colors p { color: red; } h2 { color: rgb(128, 0, 196); } h4 { color: #FF8800; } This paragraph uses the first style above. This heading uses the second style above. This heading uses the third style above. color names: aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white (white), yellow RGB codes: red, green, and blue values from 0 (none) to 255 (full) hex codes: RGB values in base-16 from 00 (0, none) to FF (255, full)

Grouping styles p, h1, h2 { color: blue; } h2 { background-color: yellow; } This paragraph uses the above style. This heading uses the above style. a style can select multiple elements separated by commas the individual elements can also have their own styles (like h2 above)