XHTML and CSS Overview. Hypertext Markup Language A set of markup tags and associated syntax rules Unlike a programming language, you cannot describe.

Slides:



Advertisements
Similar presentations
Copyright © 2003 Pearson Education, Inc. Slide 3-1 Created by Cheryl M. Hughes The Web Wizards Guide to XML by Cheryl M. Hughes.
Advertisements

Table, List, Blocks, Inline Style
HTML popo.
CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
HTML: HyperText Markup Language Hello World Welcome to the world!
Cascading Style Sheets
Cascading Style Sheets
Creating Pages in XHTML
INTRODUCTION TO HYPERTEXT MARKUP LANGUAGE 1. Outline  Introduction  Markup Languages  Editing HTML  Common Tags  Headers  Text Styling  Linking.
Web Pages and Style Sheets Bert Wachsmuth. HTML versus XHTML XHTML is a stricter version of HTML: HTML + stricter rules = XHTML. XHTML Rule violations:
MR.Mohammed Sharaf al Shareef
XHTML 16-Apr-17.
17-Jun-15 XHTML 2 What is XHTML? XHTML stands for Extensible Hypertext Markup Language XHTML is aimed to replace HTML.
CSS Basics LIS Webteam April 8, Why CSS? What’s wrong with HTML? Structure vs Style Early web design used hacks to style webpages with HTML – like.
XHTML and CSS Overview. Hypertext Markup Language A set of markup tags and associated syntax rules Unlike a programming language, you cannot describe.
Tutorial 3: Adding and Formatting Text. 2 Objectives Session 3.1 Type text into a page Copy text from a document and paste it into a page Check for spelling.
Web Design is a class created to nurture the minds of high school techies, and introduce those without prior knowledge to the field.
HTML Tags. Objectives Know the commonly used HTML tags Create a simple webpage using the HTML tags that will be discussed.
XHTML and CSS Introduction to XHTML and CSS Bharti Patel 1 phones off (please)
Creating a Simple Page: HTML Overview
Chapter 4 HTML. Objectives Explain how HTML/XHTML are used and describe the difference between them Interpret HTML code Explain how HTML Forms are used.
Cascading Style Sheets (CSS) 1.  What is CSS?  Why CSS?  How to write a CSS? 2.
_ HTML, XHTML & CSS Sami Niemelä | Module 1: Introduction to digital media: Day 02.
Chapter 6 Web Typography. 2 Principles of Web Design Chapter 5 Objectives Understand principles for type design on a Web site Use the element Understand.
3 Layers of a Web Page 1. Content/Structure - HTML 2. Presentation - CSS 3. Action/Behavioral - JavaScript.
ACM 511 HTML Week -1 ACM 511 Course Notes. Books ACM 511 Course Notes.
 HTML stands for Hyper Text Mark-up Language. The coding language used to create documents for the World Wide Web  HTML is composed of tags. HTML tags.
Chapter 1 XHTML: Part I The Web Warrior Guide to Web Design Technologies.
1 HTML intro The development of HTMLThe development of HTML The transition from HTML to XHTMLThe transition from HTML to XHTML XHTML syntax, tags, and.
CS134 Web Design & Development Creating a Basic Web Page Exerted from Mehmud Abliz slides.
Reading & Exam Zeid: Chapter 9: XHTML Essential p Read before EXAM 1 Exam is Monday Oct. 25 th Review on Friday Oct. 22 nd.
XHTML1-1 Extensible HyperText Markup Language (XHTML) Xingquan (Hill) Zhu
1 Web Developer Foundations: Using XHTML Chapter 2 Key Concepts.
1 CSC 121 Computers and Scientific Thinking David Reed Creighton University HTML and Web Pages.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
CHAPTER 1 HTML & HTML5 I อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา 1.
Cascading Style Sheets Orientation Learning Web Design: Chapter 11.
Introduction to Programming the WWW I CMSC Winter 2003 Lecture 7.
XHTML 1.1  Derived from Standard Generalized Markup Language (SGML) of ISO  XHTML concerned primary with content rather than presentation and style 
ECA 228 Internet/Intranet Design I Intro to Markup.
Copyright (c) 2004 Prentice-Hall. All rights reserved. 1 Committed to Shaping the Next Generation of IT Experts. Creating XHTML Documents Essentials for.
Introduction to HTML Xiangming Mu 9/23/ Learning Objectives Understand basic HTML tags and their attributes Learn to create a simple HTML page.
Web Development & Design Foundations with XHTML Chapter 2 HTML/XHTML Basics.
1 Web Application Programming Presented by: Mehwish Shafiq.
HTML.
HTML Basics Computers. What is an HTML file? *HTML is a format that tells a computer how to display a web page. The documents themselves are plain text.
2.1 XHTML. Motto High thoughts must have high language. –Aristophanes.
Microsoft Expression Web 3 – Illustrated Unit D: Structuring and Styling Text.
WEEK -1 ACM 262 ACM 262 Course Notes. HTML What is HTML? HTML is a language for describing web pages. HTML stands for Hyper Text Markup Language HTML.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
XP 2 HTML Tutorial 1: Developing a Basic Web Page.
HTML. INDEX Introduction to HTML Creating Web Pages Commands And Tags Web Page.
INT222 – Internet Fundamentals
NASRULLAHIBA.  It is time to take your web designing skills to the next level with Cascading Style Sheets (CSS). They are a way to control the look and.
CSS Introductions. Objectives To take control of the appearance of a Web site by creating style sheets. To use a style sheet to give all the pages of.
Lesson 5. XHTML Tags, Attributes and Structure XHTML Basic Structure head and body titles Paragraph headings comments Document Presentation Manipulating.
4.01 Cascading Style Sheets
HTML: HyperText Markup Language
CX Introduction to Web Programming
WEBSITE DESIGN Chp 1
HTML Intro.
Marking Up with XHTML Tags describe how a web page should look
Marking Up with XHTML Tags describe how a web page should look
Marking Up with XHTML Tags describe how a web page should look
4.01 Cascading Style Sheets
Marking Up with XHTML Tags describe how a web page should look
Presentation transcript:

XHTML and CSS Overview

Hypertext Markup Language A set of markup tags and associated syntax rules Unlike a programming language, you cannot describe actions or logic You can only describe information structure and context Markup tags also called elements Data goes here

Cascading Style Sheets Used to define attributes of elements in HTML and XML ◦ Common attributes: height, width, font-size, alignment, color, etc. Documents can have multiple style sheets with overlapping and sometimes conflicting definitions Cascading refers to the set of rules for resolving conflicts.

Cascading Priority is given to the most specific definitions and then the definitions or rules cascade down to the less specific rules. Priority is also given to definitions that are “closer” to the content, i.e., embedded and inline styles can be used to override global or attached styles.

HTML HTML was supposed to be a structural or “semantic” language, ◦ But, the Browser Wars lead to the introduction of “style” or formatting tags. ◦ “style” tags are bad! ◦ They are being removed from the HTML standards (called deprecation).

CSS Cascading Style Sheets Used to specify the style/appearance of structural elements (HTML tags). CSS was part of the original design of the web, but its use was almost entirely abandoned between 1997 and 2003.

Why are “style” tags bad? The best answer is very complicated Short Answer: ◦ Leads to bloated HTML code that is hard to maintain.

Semantic vs Style Semantic = Has Meaning Style = Specifies Appearance

Semantic vs Style Semantic  Meaning This is a picture of a tiger A caption is meaningful. Images typically have a caption that describes the image. Style   Appearance This is a picture of a tiger Here, we specify how to display the caption but not the fact that it’s actually a caption.

Semantics + CSS is better! Figure 1 Figure 2 Figure 3 … Figure 99.caption { font-size: 10pt; font-style: italic; }

This is why the font tag sucks! (it’s a style tag) Figure 1 Figure 2 Figure 3 … Figure 999 Sub-title Imaging if you wanted to change the font size to 12pt for all image captions? Good luck!

XHTML & CSS syntax General StructureExample Content element { property: value; … } ESPN h1 { font-size: 10pt; color: red; }

Extensible HTML  XHTML XHTML is a reformulation of HTML according to XML standards. Only four differences 1.Inclusion of an XML header 2.Single tags end with />, instead of just > 3.Attribute values must have quotes: “value” 4.Tags must be in lowercase

Why use XHTML? It is the recommended standard (W3C) since 1999 ◦ HTML 4.01 (1998) ◦ XHTML 1.0 (1999) Allows your web page to be parsed by a general XML parser. ◦ Lots of applications support XML parsing.

Web’s 4 Commandments 1. Make sure your code validates as XHTML 2. Use Semantic Markup Use tags that describe the content, not the content’s appearance 3. Structure Documents Logically The HTML code should be in a logical order; Style sheets can reposition items for presentation 4. Use CSS, not or to layout and decorate your pages.

XHTML Rules Content content In XHTML all element names must be lower case. ◦ In HTML tag case didn’t matter. In XHTML all element must have a closing tag ◦ Most web browsers are forgiving about closing tags, which makes it possible to forget about them ◦ Example Here is paragraph with no ending tag Here is another paragraph

HTML single tags HTML has a few tags that are standalone, i.e., no closing tag. Image: Line break: Link: ◦ Used to link/insert a Cascading Style Sheet

XHTML single tags To meet XML guidelines HTML single tags must to closed with a /> 1. Image: 2. Line break: 3. Link: Note the space before the />

Attributes content XHTML requires that all attribute values be enclosed in quotes. HTML: XHTML: Forgiving browsers don’t care about the quotes (Follow XHTML; quotes matter to us)

Browsers ignore whitespace An XHTML document is an ASCII Text document. XHTML renderers ignores, tabs, spaces and line breaks ◦ Allows a web designer to format XHTML code without having an effect on the web page’s rendered appearance. To render tabs, spaces, and line breaks requires using tags and style sheets.

Basic XHTML document <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN… Title Displays in Browser’s Top Bar Page content here

Text Structure (blocks) Most Important Header A paragraph in the literal sense. Sub-heading Smaller Sub-heading … Smallest Sub-heading

Lists Ordered Lists (ol)Unordered Lists (ul) Item 1 Item 2 Item 3 Item 4 Item 1 Item 2 Item 3 Item 4

Terms and Definitions ExampleMeaning Coffee black hot drink Milk white cold drink dl – definition list dt – definition term dd – definition description Used heavily in early HTML documents which were most scientific papers with lost of definitions and terms

Text Formatting (style) Teletype text Italic text Bold text Big text Small text

Text identity (semantic) Emphasized text Strong text Definition term Computer code text Sample computer code Keyboard text Variable Citation

Hyperlinks Called the anchor tag ESPN href stands for hypertext reference What is the element name? What is the attribute? What is the attribute’s value What is the content?

Elements we’ll learn about later Tables Forms Forms Frames Deprecated! Frames Deprecated!

Deprecation Removed from the standard Most browsers will still render deprecated tags ◦ However, browsers do not have to according to the standards Do not use deprecated tags unless you have no choice

Divisions and Spans Divisions used to break your webpage into logical blocks or boxes Spans used to create custom in- line tags, i.e., within the flow of a paragraph of text. Example: This is paragraph with a table reference. Table 2.4 is a lovely table.

CSS Attributes TEXT BOXES (usually elements) Font family, size, alignment, weight, sytle, variant, line-height, indent, spacing, direction Height, width, margins, padding, borders, border color, border styles, background color, background image.