Client-Side Web Technologies. CSS Part I

Size: px
Start display at page:

Download "Client-Side Web Technologies. CSS Part I"

Transcription

1 Client-Side Web Technologies CSS Part I

2 Topics Style declarations Style sources Selectors Selector specificity The cascade and inheritance Values and units

3 CSS Cascading Style Sheets CSS specifies the presentation of web page content W3C CSS Validation Service:

4 Modular CSS Level 3 CSS 2.1 specification is its core Each module adds functionality and/or replaces part of the CSS 2.1 specification Allows for more immediate, incremental improvement

5 Module Examples CSS 2.1 (core) Media Queries Level 3 (module) Selectors Level 3 (module) Color Level 3 (module) Values and Units Level 3 (module) Etc.

6 CSS Styles A declaration consists of: A CSS property name A property value Separated by a colon Examples: background-color: gray color: white

7 CSS Styles (continued) A declaration block starts with a left curly brace ({) and ends with a matching right curly brace(}) In between must be a list of zero or more semicolon-separated (;) declarations Example: { } background-color: gray; color: white

8 CSS Styles (continued) A rule set consists of a selector (discussed later) followed by a declaration block Example: h1 { } color: red

9 CSS Styles (continued) Properties may begin with a dash (-) These represent vendor-specific properties Examples: -webkit-animation -moz-box-sizing -moz-border-radius

10 How Website Authors Apply Styles Inline using the HTML global attribute style Embedded using the HTML style element External style sheets

11 Inline Styles <!doctype html> <html>... <div style= background-color: red; height: 100px; width: 100px; > <p style= color: blue; >Hello</p> </div>... </html>

12 Embedded Styles <!doctype html> <html>... <head> <title>example</title> <style type= text/css > p { } </style> </head> </html> color: blue;

13 External Style Sheet <!doctype html> <html> <head> <title>example</title> <link rel= stylesheet type= text/css href= styles.css > </head>... </html>

14 External Style Sheet (continued) styles.css p { } color: blue;

15 Other Sources of Styles User agents (browsers) have default styles that they apply when no other style is specified (e.g. underlined hyperlinks) User styles can be defined by browser users Chrome has eliminated support... (why?) Firefox: Find your profile folder (about:support) Create/edit chrome\usercontent.css Why is the folder called chrome?

16 Media Queries Allows for presentation to be tailored to a specific range of output devices without changing the content itself (think responsive web design!) Consist of a media type and zero or more expressions that check for the conditions of particular media features Can be defined: Using the media attribute of the link element In embedded styles or external style sheets using at-rule See the MediaQueries examples

17 Imported Styles at-rule allows importing style rules from other style sheets Used in external style sheets and must occur before any other rules Can be used with media queries to specify rules otherstyles.css url( otherstyles.css url( fineprint.css ) print; See the Import examples

18 Feature Queries at-rule test whether the user agent supports property:value pairs Defined in Conditional Rules Module Level 3 Candidate Recommendation status ( display: flexbox ) { } body { } display: flexbox; font-size: 12px; Also supports and, or, and not for greater flexibility

19 CSS Selectors Patterns that match against elements in an HTML document CSS uses selectors to bind style properties to elements There are many defined selectors that can be combined to create very powerful and flexible effects

20 Type Selectors The name of an HTML element Matches all elements of the type The following will cause all h1 elements in the document to have a green text color: h1 { color: green; }

21 Universal Selector Denoted with an asterisk (*) Matches all elements The following will cause all elements in the document to have a green text color: * { color: green; }

22 Attribute Selectors Allows for the representation of an element s attributes Matches elements that have an attribute corresponding to the attribute selector

23 Attribute Selectors Selector [att] [att=val] [att~=val] [att =val] Representation An element with the att attribute, regardless of value An element with the att attribute whose value is exactly "val" An element with the att attribute whose value is a whitespaceseparated list of words, one of which is exactly "val" An element with the att attribute, its value either being exactly "val" or beginning with "val" immediately followed by "-" [att^=val] [att$=val] [att*=val] An element with the att attribute whose value begins with the prefix "val" An element with the att attribute whose value ends with the suffix "val" An element with the att attribute whose value contains at least one instance of the substring "val"

24 Class Selectors Denoted with a period (.) followed immediately by an element s class attribute value Matches elements that have a class attribute value corresponding to the selector Thus *.value and *[class~=value] have the same meaning The following will cause all elements in the document with class attribute ~= foo to have a green text color: *.foo { } color: green;

25 ID Selectors Denoted with a number sign (#) followed immediately by an element s id attribute value Matches elements that have an id attribute value corresponding to the selector Thus *#xyz and *[id=xyz] will match the same elements, however there is a BIG difference between these two as we will soon see The following will cause the element in the document with id attribute = xyz to have a green text color: *#xyz { } color: green;

26 Pseudo-Class Selectors Allows for element selection based on: Information that lies outside the document tree Or information that cannot be expressed using other selectors Denoted by a colon (:) followed by the name of the pseudo-class and optionally followed by a value between parenthesis

27 Dynamic Pseudo-Classes Pseudo-Class :link :visited :hover :active :focus Representation Applies to links that have not yet been visited Applies once the link has been visited by the user Applies while the user designates an element with a pointing device (e.g. mouse pointer hovering over element) Applies when an element is being activated by the user (e.g. time between mouse button pressed and released) Applies while an element has the input focus

28 UI Element State Pseudo-Classes Pseudo-Class :enabled :disabled :checked Representation Represents elements that are in an enabled state; such elements have a corresponding disabled state Represents elements that are in a disabled state; such elements have a corresponding enabled state Represents elements (such as radio buttons and checkboxes) that are checked

29 Structural Pseudo-Classes Pseudo-Class :root Representation Represents an element that is the root of the document (in HTML, the html element) :nth-child() :nth-child(an+b) notation represents an element that has (an+b)-1 siblings before it in the document tree and has a parent element :nth-last-child() :nth-last-child(an+b) notation represents an element that has (an+b)-1 siblings after it in the document tree and has a parent element

30 Structural Pseudo-Classes (continued) Pseudo-Class :nth-of-type() :nth-last-of-type() :first-child :last-child Representation :nth-of-type(an+b) notation represents an element that has (an+b)-1 siblings with the same element name before it in the document tree and has a parent element :nth-last-of-type(an+b) notation represents an element that has (an+b)-1 siblings with the same element name after it in the document tree and has a parent element Represents an element that is the first child of some other element Represents an element that is the last child of some other element

31 Structural Pseudo-Classes (continued) Pseudo-Class :first-of-type :last-of-type :only-child :only-of-type :empty Representation Represents an element that is the first sibling of its type in the list of children of its parent element represents an element that is the last sibling of its type in the list of children of its parent element Represents an element that has a parent element and whose parent element has no other element children Represents an element that has a parent element and whose parent element has no other element children with the same element name Represents an element that has no children at all

32 The Negation Pseudo-Class A functional notation taking a simple selector (discussed later) as an argument It represents an element that is not represented by its argument The following will cause all elements other than div elements to have a green text color: *:not(div) { } color: green;

33 Pseudo-Elements Create abstractions about the document tree beyond those specified by HTML Denoted by two colons (::) followed by the name of the pseudo-element Only one pseudo-element may appear per selector and must appear at the end

34 Pseudo-Elements (continued) Pseudo-Element Representation ::first-line Represents the contents of the first formatted line of an element ::first-letter Represents the first letter of an element

35 CSS Combinators Describe relationships among elements Descendant combinator: Denoted by a whitespace A selector A B represents an element B that is a descendant of element A Child combinator: Denoted by a greater than sign (>) A selector A>B represents an element B that is a child of element A

36 CSS Combinators (continued) Sibling combinators Adjacent sibling combinator: Denoted by a plus sign(+) A selector A+B represents an element B that shares the same parent as element A and element B immediately follows element A General sibling combinator: Denoted by a tilde (~) A selector A~B represents an element B that shares the same parent as element A and element B follows element A

37 CSS Selector Syntax Simple selector: Type selector, universal selector, attribute selector, class selector, ID selector, and pseudo-class Examples: div * [class= foo ].foo #abc :checked

38 CSS Selector Syntax (continued) Sequence of simple selectors: A chain of simple selectors not separated by any combinator and always beginning with a type or universal selector Examples: div.foo.bar *[lang= en-us ] input:focus *.foo (matches div elements having both classes) Note: the universal selector can generally be dropped so *.foo is the same as.foo

39 CSS Selector Syntax (continued) Selector: A chain of one or more sequences of simple selectors separated by combinators Examples: div.foo div a:hover div>ol>li (one sequence) (two sequences) (three sequences) Note: Only one pseudo-element can appear and must be appended to the last sequence OK: div p:first-line Incorrect: p:first-line span

40 CSS Selector Groups Defined by a comma (,) separated list of selectors Represents the union of all elements selected by each individual selector in the list The following will cause all div elements and all span elements to have a green text color: div, span { } color: green; See the Selectors examples

41 Selector Examples

42

43

44

45

46

47

48

49

50

51 a n b an+b

52

53 a n b an+b

54 :

55 : a n b an+b

56 CSS Selector Specificity Used to determine which rule takes precedence Is calculated as: Count the number of ID selectors in the selector (=a) Count the number of class selectors, attribute selectors, and pseudo-classes in the selector (=b) Count the number of type selectors and pseudo elements in the selector (=c) Ignore the universal selector Concatenating the three numbers a-b-c gives the specificity

57 CSS Selector Specificity (continued) Examples: * a=0, b=0, c=0 Specificity = 0,0,0 li a=0, b=0, c=1 Specificity = 0,0,1 ul li a=0, b=0, c=2 Specificity = 0,0,2 ul ol+li a=0, b=0, c=3 Specificity = 0,0,3 *[id= x34y ] a=0, b=1, c=0 Specificity = 0,1,0 h1 + *[rel= up ] a=0, b=1, c=1 Specificity = 0,1,1 ul ol li.red a=0, b=1, c=3 Specificity = 0,1,3 li.red.level a=0, b=2, c=1 Specificity = 0,2,1 #x34y a=1, b=0, c=0 Specificity = 1,0,0 #s12:not(div) a=1, b=0, c=1 Specificity = 1,0,1

58 CSS Selector Specificity (continued) Styles declared with the HTML style attribute always take precedence over ones declared with selectors so there is an added component to calculating specificity for HTML document styles Examples: ul li s=0,a=0, b=0, c=2 Specificity = 0,0,0,2 #x34y s=0,a=1, b=0, c=0 Specificity = 0,1,0,0 style= s=1,a=0, b=0, c=0 Specificity = 1,0,0,0

59 !important Rules /* From the user's style sheet */ p { text-indent: 1em!important } p { font-style: italic!important } p { font-size: 18pt } /* From the author's style sheet */ p { text-indent: 1.5em!important } p { font-style: normal!important } p { font-size: 12pt!important } p { font-size: 24pt }

60 The Cascade To find the value for an element s property: 1. Find all declarations that apply to the element and property 2. Sort in ascending order 1. User agent (browser) declarations 2. User normal declarations 3. Author normal declarations 4. Author important declarations (!important rules) 5. User important declarations (!important rules) 3. Sort rules with the same importance and origin by selector specificity in ascending order (a, then b, then c) 4. Finally, sort by order specified (i.e. most recent rule has precedence)

61 Inheritance Some property values are inherited by the children of an element in the document tree Each property defines whether it is inherited or not Property declarations may specify a value of inherit to enforce inheritance of values or cause inheritance on properties that are not normally inherited div { } background-color: inherit;

62 Assigning Value User agents (browsers) determine specified property values in this order: 1. If the cascade results in a value, use it 2. Otherwise, if the property is inherited, use the value of the parent element 3. Otherwise, use the property s initial value (from property s definition) Specified values are then resolved to computed values as dictated by property definitions See CascadeAndInheritance examples

63 CSS Values and Units Keywords none, collapse, inherit Resource locators url( penguins.jpg ) Numbers 20, 3.5 Percentages 50% Distance units 0.8em, 100px Colors blue, #efefef There are some others

64 Unit Distance Units Description cm, mm, in, pt, pc centimeters, millimeters, inches, points, picas - these are generally not good for screen media but are useful for printing em rem ex px relative to font-size so if the font-size is 18px then 1em = 18px relative to the font-size on the root element (the html element) relative to the height of a lowercase x in the font being used not related to the font and not equivalent to device pixels, but behave much like absolute units

65 Keywords blue, green, yellow, etc. Color Units RGB red, green, blue #ff or 6 hexadecimal characters rgb(255,0,0) Integer values 0 to 255 rgb(100%, 0%, 0%) Percentage values 0% to 100% RGBA adds alpha to specify opacity rgba(255,0,0,1) Alpha is number from 0.0 to 1.0 HSL hue, saturation, lightness hsl(120, 100%, 50%) Hue is defined in degrees HSLA adds alpha hsla(240, 100%, 50%, 0.5)

66 calc() Function Allows mathematical expressions with +, -, *, and / to be used as component values p { font-size: calc(1rem 2px); } See Units examples

CSS

CSS http://www.flickr.com/photos/baylorbear78/3406180116/ CSS 2 OVERVIEW OF CSS HTML is about content and structure (semantics) What is the content? How is the content related to other content? CSS is all

More information

3.1 Introduction. 3.2 Levels of Style Sheets. - The CSS1 specification was developed in There are three levels of style sheets

3.1 Introduction. 3.2 Levels of Style Sheets. - The CSS1 specification was developed in There are three levels of style sheets 3.1 Introduction - The CSS1 specification was developed in 1996 - CSS2 was released in 1998 - CSS2.1 reflects browser implementations - CSS3 is partially finished and parts are implemented in current browsers

More information

- The CSS1 specification was developed in CSS2 was released in CSS2.1 reflects browser implementations

- The CSS1 specification was developed in CSS2 was released in CSS2.1 reflects browser implementations 3.1 Introduction - The CSS1 specification was developed in 1996 - CSS2 was released in 1998 - CSS2.1 reflects browser implementations - CSS3 is partially finished and parts are implemented in current browsers

More information

BIM222 Internet Programming

BIM222 Internet Programming BIM222 Internet Programming Week 7 Cascading Style Sheets (CSS) Adding Style to your Pages Part II March 20, 2018 Review: What is CSS? CSS stands for Cascading Style Sheets CSS describes how HTML elements

More information

The Benefits of CSS. Less work: Change look of the whole site with one edit

The Benefits of CSS. Less work: Change look of the whole site with one edit 11 INTRODUCING CSS OVERVIEW The benefits of CSS Inheritance Understanding document structure Writing style rules Attaching styles to the HTML document The cascade The box model CSS units of measurement

More information

INTRODUCTION TO CSS. Topics MODULE 5

INTRODUCTION TO CSS. Topics MODULE 5 MODULE 5 INTRODUCTION TO CSS Topics > Cascading Style Sheets (CSS3) Basics Adding a Style Sheet Selectors Adding Dynamic Styles to Elements CSS3 Properties CSS3 Box Model Vendor Prefixes Cascading Style

More information

Web Site Design and Development Lecture 5

Web Site Design and Development Lecture 5 Web Site Design and Development Lecture 5 CS 0134 Fall 2018 Tues and Thurs 1:00 2:15PM CSS CSS stands for Cascading Style Sheets. These style sheets define the look and layout of your HTML elements. A

More information

CSS: The Basics CISC 282 September 20, 2014

CSS: The Basics CISC 282 September 20, 2014 CSS: The Basics CISC 282 September 20, 2014 Style Sheets System for defining a document's style Used in many contexts Desktop publishing Markup languages Cascading Style Sheets (CSS) Style sheets for HTML

More information

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

- The CSS1 specification was developed in CSSs provide the means to control and change presentation of HTML documents 3.1 Introduction - The CSS1 specification was developed in 1996 - CSS2 was released in 1998 - CSS3 is on its way - CSSs provide the means to control and change presentation of HTML documents - CSS is not

More information

Session 3.1 Objectives Review the history and concepts of CSS Explore inline styles, embedded styles, and external style sheets Understand style

Session 3.1 Objectives Review the history and concepts of CSS Explore inline styles, embedded styles, and external style sheets Understand style Session 3.1 Objectives Review the history and concepts of CSS Explore inline styles, embedded styles, and external style sheets Understand style precedence and style inheritance Understand the CSS use

More information

CSS. Selectors & Measurments. Copyright DevelopIntelligence LLC

CSS. Selectors & Measurments. Copyright DevelopIntelligence LLC CSS Selectors & Measurments 1 Back to descendants remember walking down the document tree structure and see how parents and children interact not only is it important to know about inheritance walking

More information

COMP519 Web Programming Lecture 7: Cascading Style Sheets: Part 3 Handouts

COMP519 Web Programming Lecture 7: Cascading Style Sheets: Part 3 Handouts COMP519 Web Programming Lecture 7: Cascading Style Sheets: Part 3 Handouts Ullrich Hustadt Department of Computer Science School of Electrical Engineering, Electronics, and Computer Science University

More information

Chapter 3 Style Sheets: CSS

Chapter 3 Style Sheets: CSS WEB TECHNOLOGIES A COMPUTER SCIENCE PERSPECTIVE JEFFREY C. JACKSON Chapter 3 Style Sheets: CSS 1 Motivation HTML markup can be used to represent Semantics: h1 means that an element is a top-level heading

More information

CSS Cascading Style Sheets

CSS Cascading Style Sheets CSS Cascading Style Sheets site root index.html about.html services.html stylesheet.css images boris.jpg Types of CSS External Internal Inline External CSS An external style sheet is a text document with

More information

Appendix D CSS Properties and Values

Appendix D CSS Properties and Values HTML Appendix D CSS Properties and Values This appendix provides a brief review of Cascading Style Sheets (CSS) concepts and terminology, and lists CSS level 1 and 2 properties and values supported by

More information

CSS: Cascading Style Sheets

CSS: Cascading Style Sheets What are Style Sheets CSS: Cascading Style Sheets Representation and Management of Data on the Internet, CS Department, Hebrew University, 2007 A style sheet is a mechanism that allows to specify how HTML

More information

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

Study Guide 2 - HTML and CSS - Chap. 6,8,10,11,12 Name - Alexia Bernardo Study Guide 2 - HTML and CSS - Chap. 6,8,10,11,12 Name - Alexia Bernardo Note: We skipped Study Guide 1. If you d like to review it, I place a copy here: https:// people.rit.edu/~nbbigm/studyguides/sg-1.docx

More information

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

2. Write style rules for how you d like certain elements to look. CSS for presentation Cascading Style Sheet Orientation CSS Cascading Style Sheet is a language that allows the user to change the appearance or presentation of elements on the page: the size, style, and

More information

8a. Cascading Style Sheet

8a. Cascading Style Sheet INFS 2150 Introduction to Web Development 8a. Cascading Style Sheet 1 Objectives Concepts of cascading style sheets (CSS). 3 ways of using CSS: inline styles, embedded styles, and external style sheet.

More information

HTML & CSS. SWE 432, Fall 2017 Design and Implementation of Software for the Web

HTML & CSS. SWE 432, Fall 2017 Design and Implementation of Software for the Web HTML & CSS SWE 432, Fall 2017 Design and Implementation of Software for the Web HTML: HyperText Markup Language LaToza Language for describing structure of a document Denotes hierarchy of elements What

More information

Cascading Style Sheets (CSS)

Cascading Style Sheets (CSS) Cascading Style Sheets (CSS) Mendel Rosenblum 1 Driving problem behind CSS What font type and size does introduction generate? Answer: Some default from the browser (HTML tells what browser how)

More information

Cascade Stylesheets (CSS)

Cascade Stylesheets (CSS) Previous versions: David Benavides and Amador Durán Toro (noviembre 2006) Last revision: Manuel Resinas (october 2007) Tiempo: 2h escuela técnica superior de ingeniería informática Departamento de Lenguajes

More information

Web Engineering CSS. By Assistant Prof Malik M Ali

Web Engineering CSS. By Assistant Prof Malik M Ali Web Engineering CSS By Assistant Prof Malik M Ali Overview of CSS CSS : Cascading Style Sheet a style is a formatting rule. That rule can be applied to an individual tag element, to all instances of a

More information

CSS Cascading Style Sheets

CSS Cascading Style Sheets CSS Cascading Style Sheets site root index.html about.html services.html stylesheet.css charlie.jpg Linking to your HTML You need to link to your css in the of your HTML file.

More information

HTML/CSS. HTML review and extra CSS review CSS Color

HTML/CSS. HTML review and extra CSS review CSS Color HTML/CSS HTML review and extra CSS review CSS Color ID Every HTML element can carry the id attribute ID is used to uniquely identify that element from other elements on the page Can be used to allow the

More information

This tutorial will help both students as well as professionals who want to make their websites or personal blogs more attractive.

This tutorial will help both students as well as professionals who want to make their websites or personal blogs more attractive. About the Tutorial CSS is used to control the style of a web document in a simple and easy way. CSS stands for Cascading Style Sheets. This tutorial covers both the versions CSS1 and CSS2 and gives a complete

More information

CSS. https://developer.mozilla.org/en-us/docs/web/css

CSS. https://developer.mozilla.org/en-us/docs/web/css CSS https://developer.mozilla.org/en-us/docs/web/css http://www.w3schools.com/css/default.asp Cascading Style Sheets Specifying visual style and layout for an HTML document HTML elements inherit CSS properties

More information

Parashar Technologies HTML Lecture Notes-4

Parashar Technologies HTML Lecture Notes-4 CSS Links Links can be styled in different ways. HTML Lecture Notes-4 Styling Links Links can be styled with any CSS property (e.g. color, font-family, background, etc.). a { color: #FF0000; In addition,

More information

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

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 3.1 Introduction - HTML is primarily concerned with content, rather than style - However, tags have presentation properties, for which browsers have default values - The CSS1 cascading style sheet specification

More information

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

- HTML is primarily concerned with content, rather than style. - However, tags have presentation properties, for which browsers have default values 3.1 Introduction - HTML is primarily concerned with content, rather than style - However, tags have presentation properties, for which browsers have default values - The CSS1 cascading style sheet specification

More information

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

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

More information

IDM 221. Web Design I. IDM 221: Web Authoring I 1

IDM 221. Web Design I. IDM 221: Web Authoring I 1 IDM 221 Web Design I IDM 221: Web Authoring I 1 Week 4 IDM 221: Web Authoring I 2 Presenta(on IDM 221: Web Authoring I 3 Up until this point everything we've focused on has been related to content, and

More information

Assignments (4) Assessment as per Schedule (2)

Assignments (4) Assessment as per Schedule (2) Specification (6) Readability (4) Assignments (4) Assessment as per Schedule (2) Oral (4) Total (20) Sign of Faculty Assignment No. 02 Date of Performance:. Title: To apply various CSS properties like

More information

Chapter 4 CSS basics

Chapter 4 CSS basics Sungkyunkwan University Chapter 4 CSS basics Prepared by J. Lee and H. Choo Web Programming Copyright 2000-2018 Networking Laboratory 1/48 Copyright 2000-2012 Networking Laboratory Chapter 4 Outline 4.1

More information

CSS Selectors. element selectors. .class selectors. #id selectors

CSS Selectors. element selectors. .class selectors. #id selectors CSS Selectors Patterns used to select elements to style. CSS selectors refer either to a class, an id, an HTML element, or some combination thereof, followed by a list of styling declarations. Selectors

More information

CMPT 165 INTRODUCTION TO THE INTERNET AND THE WORLD WIDE WEB

CMPT 165 INTRODUCTION TO THE INTERNET AND THE WORLD WIDE WEB CMPT 165 INTRODUCTION TO THE INTERNET AND THE WORLD WIDE WEB Unit 3 Cascading Style Sheets (CSS) Slides based on course material SFU Icons their respective owners 1 Learning Objectives In this unit you

More information

Web Information System Design No.4 Put Style to Web Documents. Tatsuya Hagino

Web Information System Design No.4 Put Style to Web Documents. Tatsuya Hagino Web Information System Design No.4 Put Style to Web Documents Tatsuya Hagino (hagino@sfc.keio.ac.jp) 1 Web Page Components Combine orthogonal technologies content style programming style JavaScript Programming

More information

CITS3403 Agile Web Development 2019 Semester 1

CITS3403 Agile Web Development 2019 Semester 1 Cascading Style Sheets CITS3403 Agile Web Development 2019 Semester 1 What is CSS? CSS stands for Cascading Style Sheets stylesheet language for web used to specify the presentation (layout and style)

More information

ID1354 Internet Applications

ID1354 Internet Applications ID1354 Internet Applications CSS Leif Lindbäck, Nima Dokoohaki leifl@kth.se, nimad@kth.se SCS/ICT/KTH What is CSS? - Cascading Style Sheets, CSS provide the means to control and change presentation of

More information

CSS Styles Quick Reference Guide

CSS Styles Quick Reference Guide Table 1: CSS Font and Text Properties Font & Text Properties Example(s) font-family Font or typeface font-family: Tahoma font-size Size of the font font-size: 12pt font-weight Normal or bold font-weight:

More information

GIMP WEB 2.0 MENUS WEB 2.0 MENUS: HORIZONTAL NAVIGATION BAR CREATING AN HTML LIST

GIMP WEB 2.0 MENUS WEB 2.0 MENUS: HORIZONTAL NAVIGATION BAR CREATING AN HTML LIST GIMP WEB 2.0 MENUS Web 2.0 Menus: Horizontal Navigation Bar WEB 2.0 MENUS: HORIZONTAL NAVIGATION BAR Hover effect: CREATING AN HTML LIST Most horizontal or vertical navigation bars begin with a simple

More information

HTML-5.com itemscopehttp://data-vocabulary.org/breadcrumb<span itemprop="title">html 5</span> itemscopehttp://data-vocabulary.

HTML-5.com itemscopehttp://data-vocabulary.org/breadcrumb<span itemprop=title>html 5</span> itemscopehttp://data-vocabulary. HTML-5.com HTML-5.com is an HTML User's Guide and quick reference of HTML elements and attributes for web developers who code HTML web pages, not only for HTML 5 but for HTML coding in general, with demos

More information

CITS3403 Agile Web Development 2018, Semester 1

CITS3403 Agile Web Development 2018, Semester 1 Cascading Style Sheets CITS3403 Agile Web Development 2018, Semester 1 What is CSS? CSS stands for Cascading Style Sheets stylesheet language for web used to specify the presentation (layout and style)

More information

CSS مفاهیم ساختار و اصول استفاده و به کارگیری

CSS مفاهیم ساختار و اصول استفاده و به کارگیری CSS مفاهیم ساختار و اصول استفاده و به کارگیری Cascading Style Sheets A Cascading Style Sheet (CSS) describes the appearance of an HTML page in a separate document : مسایای استفاده از CSS It lets you separate

More information

To link to an external stylesheet, the link element is placed within the head of the html page:

To link to an external stylesheet, the link element is placed within the head of the html page: CSS Basics An external style sheet is simply a text file (use BBEdit or Textwrangler) containing style rules, saved with the.css extension. It s best practice to keep style sheets for a site grouped within

More information

COMP519 Web Programming Lecture 6: Cascading Style Sheets: Part 2 Handouts

COMP519 Web Programming Lecture 6: Cascading Style Sheets: Part 2 Handouts COMP519 Web Programming Lecture 6: Cascading Style Sheets: Part 2 Handouts Ullrich Hustadt Department of Computer Science School of Electrical Engineering, Electronics, and Computer Science University

More information

CSC309 Programming on the Web week 3: css, rwd

CSC309 Programming on the Web week 3: css, rwd CSC309 Programming on the Web week 3: css, rwd Amir H. Chinaei, Spring 2017 Office Hours: M 3:45-5:45 BA4222 ahchinaei@cs.toronto.edu http://www.cs.toronto.edu/~ahchinaei/ survey 1 in survey 1, you provide

More information

GoSquared Equally Rounded Corners Equally Rounded Corners -webkit-border-radius -moz-border-radius border-radius Box Shadow Box Shadow -webkit-box-shadow x-offset, y-offset, blur, color Webkit Firefox

More information

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

Make a Website. A complex guide to building a website through continuing the fundamentals of HTML & CSS. Created by Michael Parekh 1 Make a Website A complex guide to building a website through continuing the fundamentals of HTML & CSS. Created by Michael Parekh 1 Overview Course outcome: You'll build four simple websites using web

More information

Web Design and Development Tutorial 03

Web Design and Development Tutorial 03 Table of Contents Web Design & Development - Tutorial 03... 2 Using and Applying CSS to XHTML... 2 Conventions... 2 What you need for this tutorial... 2 Common Terminology... 3 Parent / Child Elements...

More information

INTRODUCTION TO CSS. Mohammad Jawad Kadhim

INTRODUCTION TO CSS. Mohammad Jawad Kadhim INTRODUCTION TO CSS Mohammad Jawad Kadhim WHAT IS CSS Like HTML, CSS is an interpreted language. When a web page request is processed by a web server, the server s response can include style sheets,

More information

Cascading Style Sheets

Cascading Style Sheets 4 TVEZEWXYHMNR LSTVSKVEQY-RJSVQEXMOENITSHTSVSZ RETVSNIOXIQ RERGSZER Q^)ZVSTWO LSWSGM PR LSJSRHYEVS^TS XYLPEZR LSQ WXE4VEL] 4VELE)9-RZIWXYNIQIHSZE% FYHSYGRSWXM CSS Cascading Style Sheets Lukáš Bařinka barinkl@fel.cvut.cz

More information

COMS 359: Interactive Media

COMS 359: Interactive Media COMS 359: Interactive Media Agenda Review CSS Preview Review Transparent GIF headline Review JPG buttons button1.jpg button.psd button2.jpg Review Next Step Tables CSS Introducing CSS What is CSS? Cascading

More information

Data Visualization (CIS/DSC 468)

Data Visualization (CIS/DSC 468) Data Visualization (CIS/DSC 468) Web Programming Dr. David Koop Definition of Visualization Computer-based visualization systems provide visual representations of datasets designed to help people carry

More information

Introduction to CSS (CSS2) Cascading Style Sheets. CSS Example. CSS Rules

Introduction to CSS (CSS2) Cascading Style Sheets. CSS Example. CSS Rules Introduction to CSS (CSS2) Cascading Style Sheets A style sheet is a collection of formatting rules that can be applied to multiple HTML documents it acts as a template, allows the same look for each occurrence

More information

Unveiling the Basics of CSS and how it relates to the DataFlex Web Framework

Unveiling the Basics of CSS and how it relates to the DataFlex Web Framework Unveiling the Basics of CSS and how it relates to the DataFlex Web Framework Presented by Roel Fermont 1 Today more than ever, Cascading Style Sheets (CSS) have a dominant place in online business. CSS

More information

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

ADDING CSS TO YOUR HTML DOCUMENT. A FEW CSS VALUES (colour, size and the box model) INTRO TO CSS RECAP HTML WHAT IS CSS ADDING CSS TO YOUR HTML DOCUMENT CSS IN THE DIRECTORY TREE CSS RULES A FEW CSS VALUES (colour, size and the box model) CSS SELECTORS SPECIFICITY WEEK 1 HTML In Week

More information

CSS: Beyond the Code. Karen Perone Rodman Public Library.

CSS: Beyond the Code. Karen Perone Rodman Public Library. CSS: Beyond the Code Karen Perone Rodman Public Library peroneka@oplin.org HTML vs. CSS vs. Javascript HTML for content (text, images, sound) CSS for presentation (layout, color) Javascript for behavior

More information

[MS-CSS21]: Internet Explorer Cascading Stylesheets (CSS) 2.1 Standards Support Document

[MS-CSS21]: Internet Explorer Cascading Stylesheets (CSS) 2.1 Standards Support Document [MS-CSS21]: Internet Explorer Cascading Stylesheets (CSS) 2.1 Standards Support Document Intellectual Property Rights Notice for Open Specifications Documentation Technical Documentation. Microsoft publishes

More information

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

8/19/2018. Web Development & Design Foundations with HTML5. Learning Objectives (1 of 2) Learning Objectives (2 of 2) Web Development & Design Foundations with HTML5 Ninth Edition Chapter 3 Configuring Color and Text with CSS Slides in this presentation contain hyperlinks. JAWS users should be able to get a list of links

More information

CSS. Shan-Hung Wu CS, NTHU

CSS. Shan-Hung Wu CS, NTHU CSS Shan-Hung Wu CS, NTHU CSS Zen Garden 2 Outline The Basics Selectors Layout Stacking Order 3 Outline The Basics Selectors Layout Stacking Order 4 Grammar selector { property: value; 5 Example /* for

More information

Data Visualization (DSC 530/CIS )

Data Visualization (DSC 530/CIS ) Data Visualization (DSC 530/CIS 602-01) HTML, CSS, & SVG Dr. David Koop Data Visualization What is it? How does it differ from computer graphics? What types of data can we visualize? What tasks can we

More information

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

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 Index Numbers & Symbols (angle brackets), in HTML, 47 : (colon), in CSS, 96 {} (curly brackets), in CSS, 75, 96. (dot), in CSS, 89, 102 # (hash mark), in CSS, 87 88, 99 % (percent) font size, in CSS,

More information

CSS Data Types. One of Those Things You Have To Know

CSS Data Types. One of Those Things You Have To Know CSS Data Types One of Those Things You Have To Know R. Scott Granneman r Jans Carton 1.4 2013 R. Scott Granneman Last updated 2018-09-02 You are free to use this work, with certain restrictions. For full

More information

Tutorial 3: Working with Cascading Style Sheets

Tutorial 3: Working with Cascading Style Sheets Tutorial 3: Working with Cascading Style Sheets College of Computing & Information Technology King Abdulaziz University CPCS-665 Internet Technology Objectives Review the history and concepts of CSS Explore

More information

To Ponder. Which one wins? .draft div.warning li { }.draft div #main li {!important; } div #main ul li { }.draft.warning ul li { }

To Ponder. Which one wins? .draft div.warning li { }.draft div #main li {!important; } div #main ul li { }.draft.warning ul li { } To Ponder Which one wins?.draft div.warning li { }.draft div #main li {!important; } div #main ul li { }.draft.warning ul li { } CSS Cont'd: Cascading Style Sheets Computer Science and Engineering College

More information

Cascading Style Sheets. Overview and Basic use of CSS

Cascading Style Sheets. Overview and Basic use of CSS Cascading Style Sheets Overview and Basic use of CSS What are Style Sheets? A World Wide Web Consortium (W3C) defined standard A way for web page designers to separate the formatting of a document from

More information

Cascading Style Sheets CSCI 311

Cascading Style Sheets CSCI 311 Cascading Style Sheets CSCI 311 Learning Objectives Learn how to use CSS to style the page Learn to separate style from structure Styling with CSS Structure is separated from style in HTML5 CSS (Cascading

More information

Web Design and Development ACS-1809

Web Design and Development ACS-1809 Web Design and Development ACS-1809 Chapter 4 Cascading Style Sheet Cascading Style Sheets A style defines the appearance of a document A style sheet - a file that describes the layout and appearance of

More information

INFS 2150 Introduction to Web Development

INFS 2150 Introduction to Web Development Objectives INFS 2150 Introduction to Web Development Create a media query Work with the browser viewport Apply a responsive design Create a pulldown menu with CSS Create a flexbox 5. Mobile Web INFS 2150

More information

INFS 2150 Introduction to Web Development

INFS 2150 Introduction to Web Development INFS 2150 Introduction to Web Development 5. Mobile Web Objectives Create a media query Work with the browser viewport Apply a responsive design Create a pulldown menu with CSS Create a flexbox INFS 2150

More information

CSS Cont'd: Cascading Style Sheets

CSS Cont'd: Cascading Style Sheets CSS Cont'd: Cascading Style Sheets Computer Science and Engineering College of Engineering The Ohio State University Lecture 15 Recall: Example body.warning p.draft em h2 span.university.warning h2.university

More information

HTML/XML. HTML Continued Introduction to CSS

HTML/XML. HTML Continued Introduction to CSS HTML/XML HTML Continued Introduction to CSS Entities Special Characters Symbols such as +, -, %, and & are used frequently. Not all Web browsers display these symbols correctly. HTML uses a little computer

More information

CSS - Cascading Style Sheets

CSS - Cascading Style Sheets CSS - Cascading Style Sheets As a W3C standard, CSS provides a powerful mechanism for defining the presentation of elements in web pages. With CSS style rules, you can instruct the web browser to render

More information

First Name Last Name CS-081 March 23, 2010 Midterm Exam

First Name Last Name CS-081 March 23, 2010 Midterm Exam First Name Last Name CS-081 March 23, 2010 Midterm Exam Instructions: For multiple choice questions, circle the letter of the one best choice unless the question explicitly states that it might have multiple

More information

Styles, Style Sheets, the Box Model and Liquid Layout

Styles, Style Sheets, the Box Model and Liquid Layout Styles, Style Sheets, the Box Model and Liquid Layout This session will guide you through examples of how styles and Cascading Style Sheets (CSS) may be used in your Web pages to simplify maintenance of

More information

CS7026 CSS3. CSS3 Graphics Effects

CS7026 CSS3. CSS3 Graphics Effects CS7026 CSS3 CSS3 Graphics Effects What You ll Learn We ll create the appearance of speech bubbles without using any images, just these pieces of pure CSS: The word-wrap property to contain overflowing

More information

escuela técnica superior de ingeniería informática

escuela técnica superior de ingeniería informática Tiempo: 2h escuela técnica superior de ingeniería informática Previous versions: David Benavides and Amador Durán Toro (noviembre 2006) Manuel Resinas (october 2007) Last revision:pablo Fernandez, Cambios

More information

Data Visualization (DSC 530/CIS )

Data Visualization (DSC 530/CIS ) Data Visualization (DSC 530/CIS 60201) CSS, SVG, and JavaScript Dr. David Koop Definition of Visualization Computerbased visualization systems provide visual representations of datasets designed to help

More information

Friday, January 18, 13. : Now & in the Future

Friday, January 18, 13. : Now & in the Future : Now & in the Future CSS3 is Modular Can we use it now? * Use it for non-critical things on the experience layer. * Check sites that maintain tables showing browser support like http://www.findmebyip.com/litmus

More information

ITNP43: HTML Lecture 4

ITNP43: HTML Lecture 4 ITNP43: HTML Lecture 4 Niederst, Part III (3rd edn) 1 Style versus Content HTML purists insist that style should be separate from content and structure HTML was only designed to specify the structure and

More information

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

Learning Objectives. Review html Learn to write a basic webpage in html Understand what the basic building blocks of html are HTML CSCI311 Learning Objectives Review html Learn to write a basic webpage in html Understand what the basic building blocks of html are HTML: Hypertext Markup Language HTML5 is new standard that replaces

More information

Introduction to Multimedia. MMP100 Spring 2016 thiserichagan.com/mmp100

Introduction to Multimedia. MMP100 Spring 2016 thiserichagan.com/mmp100 Introduction to Multimedia MMP100 Spring 2016 profehagan@gmail.com thiserichagan.com/mmp100 Troubleshooting Check your tags! Do you have a start AND end tags? Does everything match? Check your syntax!

More information

Martin Kruliš by Martin Kruliš (v1.1)

Martin Kruliš by Martin Kruliš (v1.1) Martin Kruliš 1 Scripting JavaScript, Flash, Structure & Semantics Presentation & Design HTML HTML 4.01 CSS XHTML SVG CSS 3.0 HTML5 data-* attributes MathML Multimedia time 2 css Introduction

More information

Programmazione Web a.a. 2017/2018 HTML5

Programmazione Web a.a. 2017/2018 HTML5 Programmazione Web a.a. 2017/2018 HTML5 PhD Ing.Antonino Raucea antonino.raucea@dieei.unict.it 1 Introduzione HTML HTML is the standard markup language for creating Web pages. HTML stands for Hyper Text

More information

CSS3 Basics. From & CSS Visual Dictionary Learning Curve Books, LLC

CSS3 Basics. From   & CSS Visual Dictionary Learning Curve Books, LLC CSS3 Basics From www.w3schools.com & CSS Visual Dictionary Learning Curve Books, LLC CSS Box Model Margin (top, right, bottom, left) Shorthand property, equivalent to Border-width border-style border-color

More information

Tutorial 02: Getting Started with CSS

Tutorial 02: Getting Started with CSS True / False 1. The most common way of accepting user input is through a web form. a. True b. False True REFERENCES: HTML 86 QUESTION TYPE: True / False LEARNING OBJECTIVES: 02.01 - Explore the history

More information

UNIT -II. Language-History and Versions Introduction JavaScript in Perspective-

UNIT -II. Language-History and Versions Introduction JavaScript in Perspective- UNIT -II Style Sheets: CSS-Introduction to Cascading Style Sheets-Features- Core Syntax-Style Sheets and HTML Style Rle Cascading and Inheritance-Text Properties-Box Model Normal Flow Box Layout- Beyond

More information

Creating and Building Websites

Creating and Building Websites Creating and Building Websites Stanford University Continuing Studies CS 21 Mark Branom branom@alumni.stanford.edu Course Web Site: http://web.stanford.edu/group/csp/cs21 Week 6 Slide 1 of 28 Week 6 Agenda

More information

GIMP WEB 2.0 MENUS. Web 2.0 Menus: Horizontal Navigation Bar with Dynamic Background Image

GIMP WEB 2.0 MENUS. Web 2.0 Menus: Horizontal Navigation Bar with Dynamic Background Image GIMP WEB 2.0 MENUS Web 2.0 Menus: Horizontal Navigation Bar with Dynamic Background Image WEB 2.0 MENUS: HORIZONTAL NAVIGATION BAR DYNAMIC BACKGROUND IMAGE Before you begin this tutorial, you will need

More information

The Scope of This Book... xxii A Quick Note About Browsers and Platforms... xxii The Appendices and Further Resources...xxiii

The Scope of This Book... xxii A Quick Note About Browsers and Platforms... xxii The Appendices and Further Resources...xxiii CONTENTS IN DETAIL FOREWORD by Joost de Valk PREFACE xvii xix INTRODUCTION xxi The Scope of This Book... xxii A Quick Note About Browsers and Platforms... xxii The Appendices and Further Resources...xxiii

More information

CSS WHAT IS IT? HOW DOES IT WORK? (LOOK N GOOD)

CSS WHAT IS IT? HOW DOES IT WORK? (LOOK N GOOD) CSS (LOOK N GOOD) CSS is short for Cascading Style Sheets. This is the stuff that allows you to add formatting and styling your web pages. WHAT IS IT? Let me show you HOW DOES IT WORK? If you have a headline

More information

Unit 10 - Client Side Customisation of Web Pages. Week 5 Lesson 1 CSS - Selectors

Unit 10 - Client Side Customisation of Web Pages. Week 5 Lesson 1 CSS - Selectors Unit 10 - Client Side Customisation of Web Pages Week 5 Lesson 1 CSS - Selectors Last Time CSS box model Concept of identity - id Objectives Selectors the short story (or maybe not) Web page make-over!

More information

CE419 Web Programming. Session 3: HTML (contd.), CSS

CE419 Web Programming. Session 3: HTML (contd.), CSS CE419 Web Programming Session 3: HTML (contd.), CSS 1 Forms 2 Forms Provides a way to interact with users. Not useful without a server-side counterpart. 3 From Elements

More information

Creating HTML files using Notepad

Creating HTML files using Notepad Reference Materials 3.1 Creating HTML files using Notepad Inside notepad, select the file menu, and then Save As. This will allow you to set the file name, as well as the type of file. Next, select the

More information

CSS MOCK TEST CSS MOCK TEST III

CSS MOCK TEST CSS MOCK TEST III http://www.tutorialspoint.com CSS MOCK TEST Copyright tutorialspoint.com This section presents you various set of Mock Tests related to CSS. You can download these sample mock tests at your local machine

More information

Introduction to Cascading Style Sheets

Introduction to Cascading Style Sheets Introduction to Cascading Style Sheets Welcome to the CSS workshop! Before you begin this workshop you should have some basic understanding of HTML and building web pages. What is CSS anyway and what will

More information

APPLIED COMPUTING 1P01 Fluency with Technology

APPLIED COMPUTING 1P01 Fluency with Technology APPLIED COMPUTING 1P01 Fluency with Technology Cascading Style Sheets (CSS) APCO/IASC 1P01 Brock University Brock University (APCO/IASC 1P01) Cascading Style Sheets (CSS) 1 / 39 HTML Remember web pages?

More information

CSS 1: Introduction. Chapter 3

CSS 1: Introduction. Chapter 3 CSS 1: Introduction Chapter 3 Textbook to be published by Pearson Ed 2015 in early Pearson 2014 Fundamentals of Web http://www.funwebdev.com Development What is CSS? You be styling soon CSS is a W3C standard

More information

COSC 2206 Internet Tools. CSS Cascading Style Sheets

COSC 2206 Internet Tools. CSS Cascading Style Sheets COSC 2206 Internet Tools CSS Cascading Style Sheets 1 W3C CSS Reference The official reference is here www.w3.org/style/css/ 2 W3C CSS Validator You can upload a CSS file and the validator will check it

More information