Today’s objectives  Review  CSS | Rules | Declarations  HTML Structure document  Class asignment.

Slides:



Advertisements
Similar presentations
CSS-Formatting Review Cascading Style Sheets addstyle to your HTML web pages.
Advertisements

CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
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.
Today’s objectives  Element relations – tree structure  Pseudo classes  Pseudo elements.
© 2004, Robert K. Moniot Chapter 6 CSS : Cascading Style Sheets.
Recognizing the Benefits of Using CSS 1. The Evolution of CSS CSS was developed to standardize display information CSS was slow to be supported by browsers.
WEB DESIGN Multimedia and Web. Today’s Objectives  Quick review selector types  Layout and positioning.
Beginning Web Site Creation: Dreamweaver CS4. XHTMLCSS  Describes the structure  Content  Collection of styles  Formatting body { background-color:
Cascading Style Sheets. Slide 2 Lecture Overview Overview of Cascading Style Sheets (CSS) Ways to declare a CSS CSS formatting capabilities New features.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic CSS: Cascading Style Sheets.
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.
CSS: Cascading Style Sheets. What are Style Sheets A style sheet is a mechanism that allows to specify how HTML (/XHTML/XML) pages should look The style.
Controlling Page Style: Cascading Style Sheets (CSS) References: 1.Wang, P.S & Katila, S. (2004). A Introduction to Web Design and Programming. CA: Thomson.
CSS: Cascading Style Sheets. 2 History HTML tags were originally designed to define the content of a document. The layout of the document was supposed.
Principles of Web Design 6 th Edition Chapter 4 – Cascading Style Sheets.
Review: Three parts to a webpage: - Content - Structure  XHTML - Presentation  CSS In this chapter we will focus on introducing and examining the mechanics.
Cascading Style Sheets (CSS) 1.  What is CSS?  Why CSS?  How to write a CSS? 2.
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.
Cascading Style Sheet (CSS)
MORE Cascading Style Sheets (The Positioning Model)
Cascading Style Sheets. Defines the presentation of one or more web pages Similar to a template Can control the appearance of an entire web site giving.
Today’s Objectives  CSS | Rules | Declarations  Project portfolio page  Introduce User-Center Design | Design Activity.
 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.
Doman’s Sections Information in this presentation includes text and images from
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
Cascading Style Sheets by Pavlovic Nenad by. Presentation Contents  What is CSS?  Why CSS?  Types of Style Sheets  Style Sheets Syntax  Box Formatting.
Part 1: CSS - Why? - How it works - Writing rules - Examples.
Cascading Style Sheets CSS by Pavlovic Nenad by. 2Cascading Style Sheets Presentation Contents What are CSS? What are CSS? History of CSS History of CSS.
Tutorial #4 Formatting Text and Links. Tutorial #3 Review - CSS CSS format Selector { property1: value1; /* Comments */ } Embedded, In-Line, and External.
Today’s objectives  Review  CSS | Rules | Declarations  HTML Structure document  Class asignment.
IS 360 Declaring CSS Styles. Slide 2 Introduction Learn about the three ways to declare a style Inline / embedded / external Learn about the effect of.
Cascading Style Sheets Part 1. CSS vs HTML HTML: Originally intended to markup structure of a document (,...,,,,,...) CSS Developing technology, CSS1,
CSS Tutorial 1 Introduction Syntax How to use style specifications. Styles.
CSS October 19. Review of CSS CSS was designed to separate the content of HTML pages from their appearance We are primarily dealing with external style.
HTML – Organizing Page Content. HTML Images img tag Required attribute: src
Chapter 6 Introducing Cascading Style Sheets Principles of Web Design, 4 th Edition.
Cascading Style Sheets Robin Burke ECT 270. Outline Midterm The Layout Debate CSS properties Fonts Alignment Color CSS selection selectors pseudo-classes.
HTML – Organizing Page Content. HTML Images img tag Required attribute: src
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.
>> 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 Level 2. Course Objectives, Session 1 Level 1 Quick Review Chapter 8: Adding Graphics to Web Pages Chapter 9: Sprucing Up Your.
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). A style sheet is a document which describes the presentation semantics of a document written in a mark-up language such.
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.
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.
Cascading Style Sheets Primary readings Presentations Explain & review projects with class mates.
CSS: Cascading Style Sheets Part II. Style Syntax.
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.
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.
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.
1 Cascading Style Sheets
Internet & World Wide Web How to Program, 5/e 1. 2.
WebD Introduction to CSS By Manik Rastogi.
Cascading Style Sheets
CSS: Cascading Style Sheets
IS 360 Declaring CSS Styles
>> CSS Rules Selection
Cascading Style Sheets
Intro to CSS CS 1150 Fall 2016.
Cascading Style Sheets
Intro to CSS CS 1150 Spring 2017.
Cascading Style Sheets
Part 1: Cascading Style Sheets
Introduction to Styling
Presentation transcript:

Today’s objectives  Review  CSS | Rules | Declarations  HTML Structure document  Class asignment

TYPES OF SELECTORS CSS

Types of selectors  The Universal Selector* { }  Tag or HTML Selectorsh1 { } p { } body { }  Class Selectors.imageframes { }  ID Selectors#main-navigation { }  Selecting in contexth1 strong { }  Attribute Selectorsli img[title] { }

 Can put a collection of rules in a file and refer to it from within an HTML document  link element with href attribute points to stylesheet, rel="stylesheet", type="text/css“ External Stylesheets External styles are preferred over inline and embedded styles

5 The Element  A self-contained tag  Placed in the header section  Purpose: associates the external style sheet file with the web page.  Example:

CSS Guidelines  Review the design of the page  Configure global font and color properties for the body selector  Identify typical elements (such as,, and so on) and declare style rules for these if needed.  Identify page areas such as logo, navigation, footer, and so on – configure an appropriate class or id for each.

HTML TREE: RELATIONSHIP OF ONE ELEMENT TO ANOTHER.

HTML Tree My Web Page Main Topic A web page about the days of the week, specifically Tuesday.

HTML Tree

HTML Tree Ancestor to all tags Ancestor to h1, p, strong Siblings Child of Descendent of Descendent of and

HTML Tree  Ancestor: tag that wraps around another tag. ancestor of all other tags  Descendent: A tag inside one or more tags.  Parent: tag’s closest ancestor HOME  Child: tag directly enclosed by another tag. HOME…

HTML Tree  Sibling: tags that are children of same tag. Siblings

HTML Tree  Sibling: tags that are children of same tag. Siblings h1+p {color : green;}

Selectors | Context | Descendent Descendent selector - context  h1 strong { color: red; } Any tag inside a level 1(h1) is red, but other instances of the tag on the page aren’t affected. Hello World  li a { font-family: Arial; }  Any tag inside a line item is Arial font, but other instances of the tag on the page aren’t affected.

Specificity | Descendent selectors  Specific descendent selectors override less specific selectors li a {color : green;} All anchors ( ) in line items are green ol li a {color : green;} Only anchors in line item in ordered lists are green

Child | descendent selectors  div > h1 {color : blue; }  All heading 1 that are children of div will be blue. Hello world Hello everyone Paragraph text…

Adjacent Siblings  A tag that appears immediately after another tag in HTML h1+p {color : green;} Paragraphs that are adjacent to heading 1 will be green.

Sibling: tags that are children of same tag. h1+p { } My Web Page Main Topic A web page about the days of the week, specifically Tuesday. These elements are adjacent: h1+p.

Attribute Selectors  Format a tag based on any attributes it has. img[title] {border : solid 4px #EFEFEF;} All images with a title attribute will have a border

Attribute Selectors li img[title] {border : solid 4px #EFEFEF;} All images that are line items with a title attribute will have a border

Attribute Selectors  Can be used with classes.hiLight[title] {color : red;} 186,000 MPS Tags using.hiLight class and title attribute are red

Attribute Selectors | ^ and $ Format external links: a[href^=" { color : yellow; } ^ - begins with Any link that begins with “ is yellow a[href$=".zip"] { color : green; } $ - Ends with Any link URL that ends with “zip” is green.

Attribute Selectors | * img[src*="Ire"] {border : solid 5px green;}  * - Contains  All images where src attribute contains “_Ire” get a green, solid border.

Attribute Selectors | * img[src*="Ire"] {border : solid 5px green;}

Pseudo-Classes  a:link| a:link { color : #EFEFEF; }  a:visited | a:visited { color : #CCCCCC; }  a:hover| a:hover { color : # F33333; }  a:active | a:active {color : #B2F511;}  Hover: (these will also work)  h1:hover { color : #FFFFFF; } .hiLite:hover { color : #FFFFFF; }

Pseudo-Classes  Proper way to order four link pseudo-classes: 1. a:link { color: #F60; } 2. a:visited { color: #900; } 3. a:hover { color: #F33; } 4. a:active {color: #B2F511; }  If order is changed, the hover and active don’t work.

Pseudo-elements  :first-letter – p:first-letter {font-size : 2em; font-weight: bold; color: red;}  :first-line – p:first-line {font-size : 2em; font-weight: bold; color: red;}.hiLite:first-line { text-transform: uppercase; }

Pseudo-element | :before  :before  Adds content before an element. p:before {content : "ON SPECIAL! " } p.onSpecial:before {content : "ON SPECIAL! “; color : red;}

Pseudo-element | :after  :after  Adds content after an element  p:after {content: url(bullet_Ire.png);}  p.tip:after {content: url(bullet_Ire.png);}

Pseudo-element | :first-child  :first-child  the first of all children an OL may have. ol li:first-child { font-size:1.2em; } Item 1 Item 2 Item 3