CSS – 1h. Without stylesheets proprietary HTML extensions making text into images proliferate use of "spacer" GIF images deprecated HTML elements and/or.

Slides:



Advertisements
Similar presentations
Introduction to HTML & CSS
Advertisements

CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
CSS Digital Media: Communication and design 2007.
HTML Overview - Cascading Style Sheets (CSS). Before We Begin Make a copy of one of your HTML file you have previously created Make a copy of one of your.
Making Things Look Nice: Visual Appearance and CSS CMPT 281.
Introduction to Cascading Style Sheets (CSS) Module 2: HTML Basics LESSON 4.
 Pseudo-elements  Centering  Tables  Classes and ids.
Prepared by ackoo Styli n g your page (font type, font size, colors, text decoration, alignment, set margin, table padding, etc.) References: W3Schools.
HCI 201 Week 6 Client Side Image Maps Introduction to CSS.
Cascading Style Sheets Scripting with Style. CSS versus HTML  Ways to format in HTML –HTML Tag extensions –Converting Text to images –Page Layout with.
Cascading Style Sheets Controlling the Display Of Web Content.
SM5312 week 6: basic CSS syntax1 An Introduction to Cascading Style Sheets Basic CSS Syntax Nick Foxall.
Controlling Page Style: Cascading Style Sheets (CSS) References: 1.Wang, P.S & Katila, S. (2004). A Introduction to Web Design and Programming. CA: Thomson.
Cascading Style Sheets 26 th March. Introduction 1. CSS types 2. Pseudoclasses and pseudoelements 3. Other considerations 4. Worked example.
Working with Cascading Style Sheets. 2 Objectives Introducing Cascading Style Sheets Using Inline Styles Using Embedded Styles Using an External Style.
CSS (Cascading Style Sheets): How the web is styled Create Rules that specify how the content of an HTML Element should appear. CSS controls how your web.
 Missing (or duplicate) semicolons can make the browser completely ignore the style rule.  You may add extra spaces between the properties/values to.
HIGHER COMPUTING CSS. WHAT IS CSS? CSS: Cascaded Style Sheets used to separate a web site’s content(information) from its style(how it looks).
Principles of Web Design 6 th Edition Chapter 4 – Cascading Style Sheets.
1 Web Developer Foundations: Using XHTML Chapter 9 Cascading Style Sheet Concepts.
Chapter 4 Cascading Style Sheets Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
Cascading Style Sheets Part 1 Library and Information Services, University of St Andrews.
XP Tutorial 7New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks.
Review: Three parts to a webpage: - Content - Structure  XHTML - Presentation  CSS In this chapter we will focus on introducing and examining the mechanics.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
Week 4.  Three ways to apply CSS: Inline CSS Internal style sheets ( header style information) External style sheets.
CSS Cascading Style Sheets By Garrett Garman. CSS Why use Style Sheets? Separates Appearance and Structure Modularity Quick and Easy changes Flexibility.
Cascading Style Sheets CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
Cascading Style Sheet (CSS)
SE-2840 Dr. Mark L. Hornick 1 Separating Structure from Presentation: CSS.
CSS – Presentation of Information. Types of Style Sheets External Embedded h1{color:red; font-family: Arial;} Inline Text is here.
 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.
Cascading Style Sheets by Pavlovic Nenad by. Presentation Contents  What is CSS?  Why CSS?  Types of Style Sheets  Style Sheets Syntax  Box Formatting.
Today’s objectives  Review  CSS | Rules | Declarations  HTML Structure document  Class asignment.
Website Development & Management Working with Style Rules Instructor: John Seydel, Ph.D. CIT Fall
Part 1: CSS - Why? - How it works - Writing rules - Examples.
Today’s objectives  Review  CSS | Rules | Declarations  HTML Structure document  Class asignment.
CO1552 – Web Application Development Cascading Style Sheets.
CSS CSS is short for C ascading S tyle S heets. It is a new web page layout method that has been added to HTML to give web developers more control over.
Michigan.gov - Style Sheets (CSS) Adding Style And Layout To HTML.
Introduction to CSS. What is CSS?  Cascading Style Sheets  Used for styling HTML  Also important in javascript and jquery for selectors  External.
The Web Wizard’s Guide To DHTML and CSS Chapter 1 A Review of CSS1.
ALBERT WAVERING BOBBY SENG. Week 2: HTML + CSS  Quiz  Announcements/questions/etc  Some functional HTML elements.
Introduction to Programming the WWW I CMSC Winter 2003 Lecture 7.
Cascading Style Sheets Part 1. CSS vs HTML HTML: Originally intended to markup structure of a document (,...,,,,,...) CSS Developing technology, CSS1,
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Tutorial 7.
CSS Tutorial 1 Introduction Syntax How to use style specifications. Styles.
Cascading Style Sheets Robin Burke ECT 270. Outline Midterm The Layout Debate CSS properties Fonts Alignment Color CSS selection selectors pseudo-classes.
ECA225 Applied Interactive Programming Cascading Style Sheets, pt 1 ECA 225 Applied Online Programming.
The Web Wizard’s Guide To DHTML and CSS Chapter 1 A Review of CSS1.
Cascading Style Sheets CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
XP Review 2 New Perspectives on JavaScript, Comprehensive1 Introducing Cascading Style Sheets Formatting Web Pages with CSS.
1 Web Development CSS (Cascading Style Sheet). 2 1.Setting rules for multiple elements To decrease the amount of typing for setting rules for multiple.
XHTML Formatting font with a style declaration. Formatting Font HTML uses the font tag to change size and family of font But… the font tag is being deprecated.
CNIT 132 – Week 4 Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of.
CSS Cascading Style Sheets A very brief introduction CSS, Cascading Style Sheets1.
Cascading Style Sheets Primary readings Presentations Explain & review projects with class mates.
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.
ECA 228 Internet/Intranet Design I Cascading Style Sheets.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
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.
Cascading Style Sheets Robin Burke ECT 270. Outline CSS properties Fonts Alignment Color CSS selection selectors.
1 Cascading Style Sheets
Cascading Style Sheets
>> Introduction to CSS
>> CSS Rules Selection
Introduction to Cascading Style Sheets (CSS)
Cascading Style Sheets
Presentation transcript:

CSS – 1h

Without stylesheets proprietary HTML extensions making text into images proliferate use of "spacer" GIF images deprecated HTML elements and/or attributes using tables for layout General lack of flexibility

Stylesheets XHTML for content CSS for presentation

With stylesheets Separation of content and presentation Increased flexibility Increased accessibility Simple yet powerful Eg: ew

It’s in all in the head!

Three ways of introducing styling 1.style attribute 2.style element 3.Link element

1. Style attribute This is a paragraph formatted using CSS.

2. Style element In head: p { color: red; font-family: helvetica; } In body: This is a paragraph formatted using CSS.

3. Link element In head: In style.css: p{ color: red; font-family: helvetica; }

CSS Rule Rule –p { color: red;} Selectors and Declarations p{ color: red;} –Selector: p –Declaration: {color: red;} Properties and Values color: red –Property: color –Value: red

Combining rules p{color: red;} p{font-family: helvetica;} ⇕ p{ color: red; font-family: helvetica; }

Combining selectors h1 {color: red;} h2 {color: red;} h3 {color: red;} h4 {color: red;} ⇕ h1, h2, h3, h4 {color: red;}

Inheritance What happens if you have (head): body {color:blue;} em {color: red;} And (body): Here’s a short paragraph.

Inheritance Rules are inherited from parent Unless overwritten specifically Priority: –Styling at tag takes highest priority –Then styling in the head –Last comes the stylesheet file

id In the head: p{color:black;} #quote{font-style:italic;} In the body: Here's a short paragraph formatted in a standard way. Here's a type of paragraph that is intended to be displayed in italic.

class In the head: p{color:black;}.quote{font-style:italic;} In the body: Here's a short paragraph formatted in a standard way. Here's a type of paragraph that is intended to be displayed in italic. Here's a section of text. Using a unique class identifier, the previous paragraph and the current div share the same formatting property.

Differences between class and id id applies to a single element, class to any element Only one id per element, several classes per element But, these rules are not enforced by all browsers

Contextual selectors In the head: div em{color: blue;} p em{color: green;} In the body: Here is one context for this em tag. Here is another context for this em tag.

Pseudo-classes Used to represent properties of a limited number of elements: Used essentially for links Selector:pseudo-class {property: value;}

Pseudo-classes In the head: a {text-decoration:none;} a:hover {text-decoration: underline;} a:visited {color: #aaaaaa;} In the body: The style of this link uses pseudo-classes.

Pseudo-elements Similar to pseudo-classes Limited scope: –:first-letter –:first-line –:before (not supported yet) –:after (not supported yet)

Summary selector #id.class :pseudo-class

Where to reference / read more References: - W3schools - W3C

Example 1: text formatting Write a stylesheet that formats paragraphs as follows: -first line of each paragraph is indented by 10% of the length of a paragraph -The text colour is The font is arial