COS 125 Day 17. Agenda Assignment #4 due Assignment #5 due next class Capstone Progress Reports Due Exam #3 will March 26 – Castro Chaps 1-7 Lecture/Discuss.

Slides:



Advertisements
Similar presentations
Cascading Style Sheets
Advertisements

Introduction to HTML & CSS
CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
Ideas to Layout Beginning web layout using Cascading Style Sheets (CSS). Basic ideas, practices, tools and resources for designing a tableless web site.
Cascading Style Sheets (CSS) “Styles” for short. Pg. 418.
© 2004, Robert K. Moniot Chapter 6 CSS : Cascading Style Sheets.
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 9: Defining Selectors.
CSW131 Steven Battilana 1 CSW 131 – Chapter 5 (More) Advanced CSS Prepared by Prof. B. for use with Teach Yourself Visually Web Design by Ron Huddleston,
© 2010, Robert K. Moniot Chapter 5 CSS : Cascading Style Sheets 1.
AD Intermediate Computer Graphics | spring 2008 | Daria Tsoupikova | School of Art and Design | UIC CSS Cascading Style Sheets.
COS 125 Day 17. Agenda Assignment #4 Corrected – 4 A’s, 5 B’s, 3 C’s, and 3 non-submits Assignment #5 Due Exam #3 Corrected – 5 A’s, 5 B’s, 2 C’s, 2 D’s.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic CSS: Cascading Style Sheets.
COS 125 DAY 15. Agenda Assignment 4 Posted Corrected –4 A’s, 3 B’s, 2 C’s and 1 MIA Assignment 5 posted –Due April 4 Left to do –4 Assignments (9 total)
Working with Cascading Style Sheets. 2 Objectives Introducing Cascading Style Sheets Using Inline Styles Using Embedded Styles Using an External Style.
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.
 Missing (or duplicate) semicolons can make the browser completely ignore the style rule.  You may add extra spaces between the properties/values to.
Pre-Module CSS BTM 395: Internet Programming. Cascading Style Sheets (CSS) Separation of structure from presentation CSS guide and tutorial –
Principles of Web Design 6 th Edition Chapter 4 – Cascading Style Sheets.
Working with Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of a document.
Cascading Style Sheets (CSS) Instructor: Mr. Ahmed Al Astal ITGD4104 Department Requirement for senior student University of Palestine Faculty of IT.
Chapter 11 Cascading Style Sheets: Part I The Web Warrior Guide to Web Design Technologies.
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.
Robert Vitolo CS430.  CSS (Cascading Style Sheets)  Purpose: To provide a consistent look and feel for a set of web pages To make it easy to update.
Chapter 3 Working with Text and Cascading Style Sheets.
Week 4.  Three ways to apply CSS: Inline CSS Internal style sheets ( header style information) External style sheets.
Cascading Style Sheets CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
MORE Cascading Style Sheets (The Positioning Model)
INTRODUCTION TO HTML5 CSS Styles. Understanding Style Sheets  HTML5 enables you to define many different types of content on a web page, including headings,
Today’s objectives  Review  CSS | Rules | Declarations  HTML Structure document  Class asignment.
ITCS373: Internet Technology Week 3: Introduction to CSS Dr. Faisal Al-Qaed.
Part 1: CSS - Why? - How it works - Writing rules - Examples.
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.
CSS Basic (cascading style sheets)
Web Page Design Day 2. Agenda  Questions  Assignment 1 posted Due March 2:05 Pm  Today we begin building web pages Chap 1 of text.
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.
Chapter 6 Introducing Cascading Style Sheets Principles of Web Design, 4 th Edition.
ECA225 Applied Interactive Programming Cascading Style Sheets, pt 1 ECA 225 Applied Online Programming.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
© 2011 Delmar, Cengage Learning Chapter 3 Working with Text and Cascading Style Sheets.
>> More on CSS Selectors. Pre-requisite Open the file called sample.txt Copy the all the text from the file Open your browser and go to codepen.io Paste.
Cascading Style Sheets CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
Cascading Style Sheets CSS. Source W3Schools
CS 174: Web Programming September 9 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
CSS – 1h. Without stylesheets proprietary HTML extensions making text into images proliferate use of "spacer" GIF images deprecated HTML elements and/or.
CNIT 132 – Week 4 Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of.
Practice for Chapter 3: Assume that you are a freelance web designer and need to create a website to promote your freelance company.
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.
HTML5 and CSS3 Illustrated Unit C: Getting Started with CSS.
 Capstone Proposals Due on Feb 23 › Must be a web site › Capstone Project Description sp 09.htm Capstone Project Description sp 09.htm  Assignment 3.
CSS Layout Cascading Style Sheets. Lesson Overview  In this lesson, we’ll cover:  Brief CSS review  Creating sections with the tag  Creating inline.
Chapter 6 Introducing Cascading Style Sheets Principles of Web Design, Third Edition.
HTML 5 AND CSS Dr Mohd Soperi Mohd Zahid Semester /16.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
INTERNET APPLICATIONS CPIT405 CSS Cascading Style Sheet Instructor: Omnia H. Alwazzan
CASCADING STYLE SHEET CSS. CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to solve a problem.
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.
IS 360 Understanding CSS Selectors. Slide 2 Types of Selectors There are different types of selectors Each has a different level of “specificity” An element.
Introduction to CSS: Selectors
Getting Started with CSS
CSS: Cascading Style Sheets
>> Introduction to CSS
Cascading Style Sheets
Website Design 3
IS 360 Understanding CSS Selectors
Cascading Style Sheets (Introduction)
Chapter 6 Introducing Cascading Style Sheets
CS332A Advanced HTML Programming
Presentation transcript:

COS 125 Day 17

Agenda Assignment #4 due Assignment #5 due next class Capstone Progress Reports Due Exam #3 will March 26 – Castro Chaps 1-7 Lecture/Discuss Creating and Applying Styles

Learning Objectives Understand the syntax of a CSS rule Write CSS rules Assign the same style rule to more than one element Create style rules for link states Understand how to create an external style sheet Understand how to link to an external style sheet Understand how to use internal style sheets Understand how to import an external style sheet Understand how to apply styles locally Explore how to use comments in style rules

Style Sheet Examples Examples of applying style sheets – Formatting –

Styles Use to format XHTML documents Separate Content from Format Allows consistent “Look and Feel” to all web pages in a web site

Constructing A Style Rule Selector {property:value; property:value} Examples – h1 {color:red;background:yellow} – h2 {color:white;background:black} – p {color:blue}

Constructing Selectors A selector determines which elements will be formatted A selector can contain up to 5 criteria (any combination) – The type or name of the element – The context in which the element is found – The class or id of an element – The pseudo-class of an element or a pseudo-element itself – Whether or not an element has certain attributes and values

Selecting Elements by Name Simply type the element as the selector – h1 – p – div Add { property:value;…} You can group element with a comma – h1,h2,h3 {color:red} You can use * for all elements – * {color:red}

Selecting Elements by Class or ID If your elements is labeled with id or class, it can be formatted via a selector If you used class – –.bigheader {property:value} If you used id – – #firstheader { property :value} Can be used with element name – h1.class {color:red} – h2#label {color:red}

Selecting Elements by Context Selecting elements based on parent/child relationship between elements header paragraph BIG small div is ancestor of all the above elements h1 is child of div div is parent (ancestor) of h1 big is a sibling of small h1 is a sibling of p big is descendent of div and child of p

Selecting Elements by context To select an element based on the context (relationship) do the following For a any descendant element – Ancestor descendant {…} – Div.class p {color:red} For only the child of a parent element (only some browsers) – Ancestor > descendent {…} – Div#label > p {color:red}

Selecting Elements by Context To select elements that are the first child of a parent element – div p:first-child {color-red} To select element based on siblings – div p+p {color:red}

Selecting Links elements based on their state (pseudo-class) State means visited, mouse is over link.. etc a:link {color:red} a:visted{color:blue} a:focus{color:yellow} a:hover{color:green} a:active{color:white}

Selecting part of an element (pseudo- element) You can select just the first letter or first line f a element to be formatted h1:first-letter {color:red} p:first-line {color:blue} Does not work with all browsers

Selecting elements based on attributes of the element element[attribute]{…} Or element[attribute=“value”] {…} (must have) Or element[attribute~=“value”]{…} (can have) Or element[attribute|=“value”]{…} (must have “value-”) Does not work in Internet Explorer

Combining Elements You can combine any of the previous techniques First you define context Then the element Then class or id Next pseudo-class or pseudo-element Div.works p em:firstletter{color:red}

Creating an external Style Sheet Create a new text doc Define rules Save as “anyname.css File must be “text only” In Dreamweaver – File>New>”CSS Style Sheets” – then select one of the already begun style sheets

Linking an external style sheet In head section – – url.css is the location and filename of your external CSS style sheets

Creating an Internal Style Sheet Internal style sheet will only effect the one web page In head section selector{property:value} ….

Importing External Style Sheets Used with internal style sheet “external.css”; selector{property:value} ….

Applying styles locally Use style attribute in the element you wish to format Will only effect that occurrence of the element Example

Location of style rules With so many ways to apply style what happens when there is more than one rule for a an element – Locally applied rules take precedence – Internal style rules before imported style rules – Order of the rules in a style sheet

Adding comments to a style rule Why?? – So that you remember /* comments */ Cannot be nested – /* this /*doesn’t*/ work */

Assignment #6 posted I have posted assignment 6 in WebCT – Covers Chapters 8-11 – Most difficult assignment yet. – Due April 5 (two weeks) – I posted it early to allow for any one who may wish to get an early start – We will discuss this assignment in upcoming classes