IDM 222. Web Design II. IDM 222: Web Authoring II 1

Size: px
Start display at page:

Download "IDM 222. Web Design II. IDM 222: Web Authoring II 1"

Transcription

1 IDM 222 Web Design II IDM 222: Web Authoring II 1

2 PSA: Web Hos,ng IDM 222: Web Authoring II 2 Public service announcement. Anyone who cancelled their Bluehost hosting plan and is now using github.io Github's built in hosting - you will not be able to do so next term for IDM232 Scripting II. If you need the Drexel affiliate link to sign up for a new account at the discounted rate send me an .

3 Week 7 Preprocessors IDM 222: Web Authoring II 3 Does anyone know what a preprocessor is or how it is used? Preprocessors can greatly accelerate development when used correctly. A preprocessor takes an arbitrary source file and converts it into something that the browser understands. There are preprocessor tools for CSS and JavaScript.

4 CSS Preprocessors Demaree, 2011 html { font-size: 100%; body { background-color: #333; color: #fff; margin: 3rem; h1 { font-size: 3rem; margin: 1.5rem 0.95rem; Demaree, 2011 Ge,ng Started with Sass. IDM 222: Web Authoring II 4 CSS' simplicity has always been one of its defining, most welcome features. CSS style sheets are just long lists of rules, each consisting of a selector and some styles to apply. But as our websites and applications get bigger and become more complex, and target a wider range of devices and screen sizes, this simplicity has become a liability.

5 body.home {.media-unit { border: 1px solid #ccc; background-color: #fff;.right { border-left: 1px solid #ccc; h1 { font-size: 24px; IDM 222: Web Authoring II 5 Since browsers arenʼt ready for a new CSS, developers have designed a new style sheet syntax with features to help make their increasingly complex CSS easier to write and manage, then use a preprocessor (a program that runs on your computer or server) to translate the new smart syntax (next slide)

6 body.home.media-unit { border: 1px solid #ccc; background-color: #fff; body.home.media-unit.right { border-left: 1px solid #ccc; body.home.media-unit.right h1 { font-size: 24px; IDM 222: Web Authoring II 6 into the old, dumb CSS that browsers understand.

7 SASS (syntac(cally awesome style sheets) IDM 222: Web Authoring II 7 The new stylesheet syntax they developed is called Sass, which stands for "syntactically awesome style sheets."

8 SASS Syntax #main color: blue font-size: 0.3em IDM 222: Web Authoring II 8 The original versions of Sass looked very different from regular CSS; there were no curly braces, and properties had to be indented with a specific number of spaces or else the compiler would raise an error. Because Sassʼ indented syntax wasnʼt compatible with regular CSS, it was difficult for people with large existing websites to start taking advantage of it without spending time converting their old code to Sass.

9 SASS 3.0 (SCSS) Sassy CSS IDM 222: Web Authoring II 9 So in Sass 3.0 the developers introduced a new, more CSS-like syntax called SCSS (or "Sassy CSS"). SCSS is what the nerds call a "strict superset" of regular CSS, which means anything thatʼs valid CSS is also valid SCSS. In other words, all of your existing style sheets should work with the Sass processor with no problems, allowing you to get your feet wet by playing with some Sass features without learning every facet of the new language.

10 nav { ul { margin: 0; padding: 0; list-style: none; li { display: inline-block; a { display: block; padding: 6px 12px; text-decoration: none; IDM 222: Web Authoring II 10 Unlike regular CSS, Sassʼ SCSS is a real scripting language, with expressions, functions, variables, conditional logic, and loops. You donʼt have to use all of these features to get some benefit out of Sass, but theyʼre there if you need them, and on large projects they can make complex or repetitive CSS much easier to write.

11 Ge#ng Started # install sass gem gem install sass # run Sass from the command line sass input.scss output.css # watch a Sass file sass --watch input.scss:output.css IDM 222: Web Authoring II 11 Sass is written in Ruby; if you're familiar with Ruby and your computer's command prompt, you can find instructions for installing and running the Sass gem on the Sass website.

12 IDM 222: Web Authoring II 12 For those who are less handy on the command line, or who just want a fast and easy way to work with Sass, thereʼs various desktop applications available for Mac and Windows that come with Ruby and has the Sass compiler built in.

13 my_project/ index.html css/ main_style.css scss/ main_style.scss _mixins.scss _colors.scss IDM 222: Web Authoring II 13 Both the Sass command line tool and the desktop applications work by watching your SCSS style sheets for changes as you work on them, then automatically compiling them into regular CSS when you save. The directory where your Sass files live is called the input folder. Your processed CSS files are saved to the output file.

14 build/ index.html css/ styles.css src/ scss/ components/ _buttons.scss _header.scss global/ _settings.scss vendor/ _font-awesome.scss styles.scss IDM 222: Web Authoring II 14 Here's another project structure. The files whose names start with underscores are called partials. As the name would imply they contain "partial" style sheets, chunks of SCSS code to be imported into one of of your main SCSS files.

15 Using Par*als url('/pages/blog.css'); IDM 222: Web Authoring II 15 CSS already provides directive for linking to additional, external style sheets, and some developers like to use it to break up a large projectʼs styles into smaller logical chunks. For example, our main_style.css file might contain nothing statements linking to a bunch of page-specific style sheets. This isnʼt considered the best practice however, because each of these imports is one more file that has to be requested and loaded by the browser, which can make your site load more slowly.

16 Using Par*als 'pages/blog'; IDM 222: Web Authoring II 16 Sass helps out by letting you break large style sheets into partials. You still refer to them using directive (in a new, briefer form), and when your SCSS files are processed, the contents of the partial are inserted directly into the output CSS. The result is one file containing all of your styles. Sass can also automatically minify its CSS output, stripping out unnecessary white space or line breaks to optimize loading times.

17 DRY (don't repeat yourself) body.home.media-unit { border: 1px solid #ccc; background-color: #fff; body.home.media-unit.right { border-left: 1px solid #ccc; body.home.media-unit.right h1 { font-size: 24px; IDM 222: Web Authoring II 17 Now that our style sheets are better organized, let's try to make them less repetitive. One of Sass's nicest features is nested rules. In a regular CSS file, rules must be listed sequentially, and every rule's selector must include all of its elements. Apart from being really, really repetitive, this code doesnʼt do anything to help us understand how the HTML elements weʼre styling relate to each other.

18 DRY Nes(ng body.home {.media-unit { border: 1px solid #ccc; background-color: #fff;.right { border-left: 1px solid #ccc; h1 { font-size: 24px; IDM 222: Web Authoring II 18 With nesting, we can write SCSS code that is both less redundant and easier to follow: After processing this will result in the same CSS as above. Unfortunately, the shorter syntax wonʼt make your CSS files any smaller or load any faster. But nesting will help keep your code clean, logical, and well-organized, which should also make it easier to manage over time.

19 Nes$ng.container { width: 100%; /* If the device is wider than 940px, incorporate a max-width. screen and (min-width: 58.75em) { max-width: 56.25rem; IDM 222: Web Authoring II 19 Another cool nesting trick: Sass allows you to nest media queries inside other rules, making it easier to see which styles are applied to a given object on your page:

20 Nes$ng.container { width: screen and (min-width: 58.75em) {.container { max-width: 56.25rem; IDM 222: Web Authoring II 20 When processing this file, Sass knows how to convert this back into valid CSS, copying the.container selector inside the media query like so:

21 Variables $variable_name: "value"; IDM 222: Web Authoring II 21 Sass variables are great for two reasons. First, and most importantly, they make code easier to change by reducing duplication. But they also allow you to assign names to special property values like colors, which helps you understand the intent behind a given style.

22 Variables button { background-color: #99cc00; h1, h2 { color: #99cc00; div { border: 3px solid #99cc00; IDM 222: Web Authoring II 22 Let's pretend we're working on a large scale site where a number of elements in the UI use a specific green color, #99cc00, or "Brand green" for short. This color appears hundreds of times in the CSS, used on everything from buttons to headline colors; if we ever changed the branding colors away from this shade of green it would be a lot of work to change every instance of this color code.

23 Variables $branding-green: "#99cc00"; $branding-link-color: $branding-green; a { color: $branding-link-color; IDM 222: Web Authoring II 23 By using variables instead of the raw hex code, it's easy - just change the variable and the new color appears everywhere, instantly. You can even set variables to other variables, which helps keep your style sheets semantic:

24 Variables $sans-serif-font: 'ff-dagny-web-pro', 'Helvetica Neue', Arial, sans-serif; $serif-font: 'ff-tisa-web-pro', Georgia, Times, serif;.banner h1 { font-family: $sans-serif-font; IDM 222: Web Authoring II 24 You can assign almost any kind of value to a variable; apart from color hex values, they're especially good for font-family stacks:

25 Mixins $highlight-color: highlighted-bold-text { font-weight: bold; background-color: $highlight-color;.result-with-highlights { span highlighted-bold-text; IDM 222: Web Authoring II 25 Mixins are reusable sets of properties or rules that you include, or "mix", into other rules. You define them using keyword and include them using keyword.

26 Mixins.result-with-highlights { span highlighted-bold-text;.highlighted highlighted-bold-text; IDM 222: Web Authoring II 26 Once youʼve defined a mixin, you can reuse it anywhere else in the same file. Here Iʼm saying that elements with a class named highlighted should also have the color and font weight properties specified by the mixin:

27 transition($args) { -webkit-transition: $args; -moz-transition: $args; -ms-transition: $args; -o-transition: $args; transition: $args; a { color: transition(color.3s ease); &:hover { color: black; IDM 222: Web Authoring II 27 This is really useful for applying new CSS3 properties to elements, while ensuring wide cross-browser compatibility via vendor prefixes and fallback stacks. In regular CSS, vendor fallbacks can be annoying to use because theyʼre so verbose, which leads to a lot of boring copy-and-pasting. Sass mixins let us use new kinds of styles in a bulletproof way without writing a lot of code. Here Iʼve defined a mixin that builds a simple transition using vendor-prefixed properties for WebKit, Firefox, and IE, followed by the standard transition property from the CSS3 spec. The argument we pass includes which property, the duration and timing function of the transition, which can be unique every time we use the mixin.

28 Mixins $color: button { background-color: $color; border: 1px solid mix(black, $color, 25%); border-radius: 5px; padding:.25em.5em; &:hover { cursor: pointer; background-color: mix(black, $color, 15%); border-color: mix(black, $color, 40%); IDM 222: Web Authoring II 28 Mixins can also contain whole nested rules, not just properties.

29 headline ($color, $size) { color: $color; font-size: $size; IDM 222: Web Authoring II 29 Using mixins to apply simple styles is cool, but what makes mixins awesome is that they can take arguments, just like a function in JavaScript or PHP. And you can use them in combination with more advanced features like expressions and functions to go far beyond organization to implement some great, complex styles. [^Dawson, 2015]

30 headline ($color, $size) { color: $color; font-size: $size; h1 headline(green, 12px); IDM 222: Web Authoring II 30 A mixin can take Sass data values as arguments. These values are specified when you define the mixin and given when the mixin. The arguments are then passed to the mixin as variables. Arguments are included in a comma separated list enclosed in parentheses after the mixin name.

31 Arguments (compiled CSS) h1 { color: green; font-size: 12px; IDM 222: Web Authoring II 31 Here's the compiled CSS.

32 Arguments Order h1 headline(12px, green); /* Compiles to... */ h1 { color: 12px; font-size: green; IDM 222: Web Authoring II 32 As you can see, this doesnʼt work. The mixin just delivers the arguments in the order given.

33 Arguments $base-color: headline($color, $size) { color: $color; font-size: $size; h1 headline($base-color, 12px); IDM 222: Web Authoring II 33 You can also pass Sass variables as arguments. For example lets say we set a $base-color variable in the above example.

34 Arguments (compiled CSS) h1 { color: pink; font-size: 12px; IDM 222: Web Authoring II 34 Here's the compiled CSS.

35 Default headline($size, $color: red) { color: $color; font-size: $size; h1 headline(12px); h1 headline(12px, blue); IDM 222: Web Authoring II 35 When creating your mixin you can specify default values for your arguments. When default values are included you can omit passing that value when calling your mixin. The default value will be used. For example if I update the headline mixin from above with a default value.

36 Default Values (compiled CSS) h1 { color: red; font-size: 12px; h1 { color: blue; font-size: 12px; IDM 222: Web Authoring II 36 In the first h1 we specified a pixel size, so the default value of red was used. In the second example the default value was replaced by the provided color of blue we used in

37 IDM 222: Web Authoring II 37 lets you share a set of CSS properties from one selector to another. It helps keep your Sass very DRY. [Demaree, 2011]

38 .message { border: 1px solid #ccc; padding: 10px; color: #333;.success border-color: green;.error border-color: red;.warning border-color: yellow; IDM 222: Web Authoring II 38

39 Operators.container { width: 100%; article { float: left; width: 600px / 960px * 100%; // 62.5% aside { float: right; width: 300px / 960px * 100%; // 31.25% IDM 222: Web Authoring II 39 Doing math in your CSS is very helpful. Sass has a handful of standard math operators like addition, subtraction, multiplication, division and percentages.

40 Example Time IDM 222: Web Authoring II 40 SCSS example JavaScript example

41 Other Languages (CSS) SCSS Sass Less Stylus IDM 222: Web Authoring II 41

42 Other Languages (Javascript) CoffeeScript TypeScript IDM 222: Web Authoring II 42

43 Other Languages (HTML) Pug (Jade) Haml Slim Kit Nunjucks IDM 222: Web Authoring II 43

44 For Next Week... IDM 222: Web Authoring II 44 Work on your projects. No specific assignment to turn in.

45 Sources [-Demaree, 2011]: Ge1ng Started with Sass. [-Dawson, 2015]: Sass Basics: The Mixin DirecCve [-Richard, 2014]: DRY-ing Out Your Sass Mixins IDM 222: Web Authoring II 45

IN4MATX 133: User Interface Software

IN4MATX 133: User Interface Software IN4MATX 133: User Interface Software Lecture 21: SASS and Styling in Ionic Professor Daniel A. Epstein TA Jamshir Goorabian TA Simion Padurean 1 Class notes Quiz 4 (Tuesday) will cover November 5th s lecture

More information

CSS worksheet. JMC 105 Drake University

CSS worksheet. JMC 105 Drake University CSS worksheet JMC 105 Drake University 1. Download the css-site.zip file from the class blog and expand the files. You ll notice that you have an images folder with three images inside and an index.html

More information

Zen Garden. CSS Zen Garden

Zen Garden. CSS Zen Garden CSS Patrick Behr CSS HTML = content CSS = display It s important to keep them separated Less code in your HTML Easy maintenance Allows for different mediums Desktop Mobile Print Braille Zen Garden CSS

More information

{WebCodeChicks} </spartanburg> Beginning Sass. sass-lang.com/guide

{WebCodeChicks} </spartanburg> Beginning Sass. sass-lang.com/guide {WebCodeChicks Beginning Sass sass-lang.com/guide We will be using the website: codepen.io to write our code. A great resource to see how others write code. Sign up for a free account. CSS

More information

SASS Variables and Mixins Written by Margaret Rodgers. Variables. Contents. From Web Team. 1 Variables

SASS Variables and Mixins Written by Margaret Rodgers. Variables. Contents. From Web Team. 1 Variables SASS Variables and Mixins Written by Margaret Rodgers From Web Team Contents 1 Variables o 1.1 Nested Variables 2 Mixins 3 Inheritance Variables A variable in SASS works exactly the same as a variable

More information

Introduction to WEB PROGRAMMING

Introduction to WEB PROGRAMMING Introduction to WEB PROGRAMMING Web Languages: Overview HTML CSS JavaScript content structure look & feel transitions/animation s (CSS3) interaction animation server communication Full-Stack Web Frameworks

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

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

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

Sass. The Future of Stylesheets.

Sass. The Future of Stylesheets. Sass. The Future of Stylesheets. Chris Eppstein Follow me @chriseppstein Architect - Caring.com Creator - Compass Stylesheet Framework Core Contributor - Sass A website for caregivers of the sick and elderly.

More information

Beginner s Guide to SASS

Beginner s Guide to SASS Beginner s Guide to SASS WordCamp Norrköping 2015 28.08.2015 Bernhard Kau @2ndkauboy kau-boys.de 1 Who am I? Bernhard Kau Berlin, Germany PHP Developer WordPress Plugin Developer CSS Tinkerer Organizer

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

<body bgcolor=" " fgcolor=" " link=" " vlink=" " alink=" "> These body attributes have now been deprecated, and should not be used in XHTML.

<body bgcolor=  fgcolor=  link=  vlink=  alink= > These body attributes have now been deprecated, and should not be used in XHTML. CSS Formatting Background When HTML became popular among users who were not scientists, the limited formatting offered by the built-in tags was not enough for users who wanted a more artistic layout. Netscape,

More information

Welcome Please sit on alternating rows. powered by lucid & no.dots.nl/student

Welcome Please sit on alternating rows. powered by lucid & no.dots.nl/student Welcome Please sit on alternating rows powered by lucid & no.dots.nl/student HTML && CSS Workshop Day Day two, November January 276 powered by lucid & no.dots.nl/student About the Workshop Day two: CSS

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

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

READSPEAKER ENTERPRISE HIGHLIGHTING 2.5

READSPEAKER ENTERPRISE HIGHLIGHTING 2.5 READSPEAKER ENTERPRISE HIGHLIGHTING 2.5 Advanced Skinning Guide Introduction The graphical user interface of ReadSpeaker Enterprise Highlighting is built with standard web technologies, Hypertext Markup

More information

CREATE SASSY WEB PARTS. Developer Guide to SASS usage in SPFx

CREATE SASSY WEB PARTS. Developer Guide to SASS usage in SPFx CREATE SASSY WEB PARTS Developer Guide to SASS usage in SPFx !!! WARNING!!! YOU WILL SEE SOURCE CODE!!! WARNING!!! OUR GOALS Sketch and develop web parts Create your own reusable CSS Handle external

More information

Reading 2.2 Cascading Style Sheets

Reading 2.2 Cascading Style Sheets Reading 2.2 Cascading Style Sheets By Multiple authors, see citation after each section What is Cascading Style Sheets (CSS)? Cascading Style Sheets (CSS) is a style sheet language used for describing

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

Introduction to HTML & CSS. Instructor: Beck Johnson Week 2

Introduction to HTML & CSS. Instructor: Beck Johnson Week 2 Introduction to HTML & CSS Instructor: Beck Johnson Week 2 today Week One review and questions File organization CSS Box Model: margin and padding Background images and gradients with CSS Make a hero banner!

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

- 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

HTML and CSS a further introduction

HTML and CSS a further introduction HTML and CSS a further introduction By now you should be familiar with HTML and CSS and what they are, HTML dictates the structure of a page, CSS dictates how it looks. This tutorial will teach you a few

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

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

Cascading Style Sheets for layout II CS7026

Cascading Style Sheets for layout II CS7026 Cascading Style Sheets for layout II CS7026 Understanding CSS float The CSS float property is also a very important property for layout. It allows you to position your Web page designs exactly as you want

More information

Microsoft Expression Web Quickstart Guide

Microsoft Expression Web Quickstart Guide Microsoft Expression Web Quickstart Guide MS-Expression Web Quickstart Guide Page 1 of 24 Expression Web Quickstart Guide (20-Minute Training) Welcome to Expression Web. When you first launch the program,

More information

APEX Developers - Do More With Less!!

APEX Developers - Do More With Less!! APEX Developers - Do More With Less!! Roel Hartman Copyright 2014 APEX Consulting 2 LESS Leaner CSS SASS Syntactically Awesome StyleSheets SCSS Sassy CSS OOCSS Object Oriented CSS Issue 1 You need a CSS

More information

Cascading Style Sheets Level 2

Cascading Style Sheets Level 2 Cascading Style Sheets Level 2 Course Objectives, Session 1 Level 1 Quick Review Chapter 6 Revisit: Web Fonts Chapter 8: Adding Graphics to Web Pages Chapter 9: Sprucing Up Your Site s Navigation Begin

More information

CSS BASICS. selector { property: value; }

CSS BASICS. selector { property: value; } GETTING STARTED 1. Download the Juice-o-Rama 11-01 zip file from our course dropbox. 2. Move the file to the desktop. You have learned two ways to do this. 3. Unzip the file by double clicking it. You

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

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

Client-Side Web Technologies. CSS Part I

Client-Side Web Technologies. CSS Part I Client-Side Web Technologies CSS Part I Topics Style declarations Style sources Selectors Selector specificity The cascade and inheritance Values and units CSS Cascading Style Sheets CSS specifies the

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

Taking Fireworks Template and Applying it to Dreamweaver

Taking Fireworks Template and Applying it to Dreamweaver Taking Fireworks Template and Applying it to Dreamweaver Part 1: Define a New Site in Dreamweaver The first step to creating a site in Dreamweaver CS4 is to Define a New Site. The object is to recreate

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

Cascading Style Sheet

Cascading Style Sheet Extra notes - Markup Languages Dr Nick Hayward CSS - Basics A brief introduction to the basics of CSS. Contents Intro CSS syntax rulesets comments display Display and elements inline block-level CSS selectors

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

Web Development & Design Foundations with HTML5

Web Development & Design Foundations with HTML5 Web Development & Design Foundations with HTML5 KEY CONCEPTS Copyright Terry Felke-Morris 1 Learning Outcomes In this chapter, you will learn how to... Describe the evolution of style sheets from print

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

Introduction to Web Design CSS Reference

Introduction to Web Design CSS Reference Inline Style Syntax: Introduction to Web Design CSS Reference Example: text Internal Style Sheet Syntax: selector {property: value; Example:

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

Web Development & Design Foundations with HTML5

Web Development & Design Foundations with HTML5 1 Web Development & Design Foundations with HTML5 CHAPTER 3 CSS BASICS Copyright Terry Felke-Morris 2 Learning Outcomes In this chapter, you will learn how to... Describe the evolution of style sheets

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

Introduction to Web Design CSS Reference

Introduction to Web Design CSS Reference Inline Style Syntax: Introduction to Web Design CSS Reference Example: text Internal Style Sheet Syntax: selector {property: value; Example:

More information

WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5

WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 3 Key Concepts 1 LEARNING OUTCOMES In this chapter, you will learn how to... Describe the evolution of style sheets from print media to the Web List

More information

HTML5: Adding Style. Styling Differences. HTML5: Adding Style Nancy Gill

HTML5: Adding Style. Styling Differences. HTML5: Adding Style Nancy Gill HTML5: Adding Style In part 2 of a look at HTML5, Nancy will show you how to add CSS to the previously unstyled document from part 1 and why there are some differences you need to watch out for. In this

More information

Multimedia Systems and Technologies Lab class 6 HTML 5 + CSS 3

Multimedia Systems and Technologies Lab class 6 HTML 5 + CSS 3 Multimedia Systems and Technologies Lab class 6 HTML 5 + CSS 3 Instructions to use the laboratory computers (room B2): 1. If the computer is off, start it with Windows (all computers have a Linux-Windows

More information

FEWD START SCREENCAST!!!!

FEWD START SCREENCAST!!!! FEWD START SCREENCAST!!!! LET'S GET EVERYTHING SET UP! 1. Navigate to the FEWD 51 Dashboard (saraheholden.com/fewd51) and download the Lesson 5 starter code and slides. You'll want to keep the dashboard

More information

Media Types & Media Features

Media Types & Media Features Media Types & Media Features Same HTML, Different CSS R. Scott Granneman r Jans Carton 1.6 2008 R. Scott Granneman Last updated 2018-08-21 You are free to use this work, with certain restrictions. For

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 using HTML to design webpages

Introduction to using HTML to design webpages Introduction to using HTML to design webpages #HTML is the script that web pages are written in. It describes the content and structure of a web page so that a browser is able to interpret and render the

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

The building block of a CSS stylesheet. A rule consists of a selector and a declaration block (one or more declarations).

The building block of a CSS stylesheet. A rule consists of a selector and a declaration block (one or more declarations). WDI Fundamentals Unit 4 CSS Cheat Sheet Rule The building block of a CSS stylesheet. A rule consists of a selector and a declaration block (one or more declarations). Declaration A declaration is made

More information

Controlling Appearance the Old Way

Controlling Appearance the Old Way Webpages and Websites CSS Controlling Appearance the Old Way Older webpages use predefined tags - - italic text; - bold text attributes - Tables (and a few other elements) use specialized

More information

Downloads: Google Chrome Browser (Free) - Adobe Brackets (Free) -

Downloads: Google Chrome Browser (Free) -   Adobe Brackets (Free) - Week One Tools The Basics: Windows - Notepad Mac - Text Edit Downloads: Google Chrome Browser (Free) - www.google.com/chrome/ Adobe Brackets (Free) - www.brackets.io Our work over the next 6 weeks will

More information

Web Structure and Style. MB2030 Section 2 Class 4

Web Structure and Style. MB2030 Section 2 Class 4 Web Structure and Style MB2030 Section 2 Class 4 Web Site Hierarchies The Structure of the Web How the Internet Works Computers connected to the Web are called clients and servers. A simplified diagram

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

How to lay out a web page with CSS

How to lay out a web page with CSS Activity 2.6 guide How to lay out a web page with CSS You can use table design features in Adobe Dreamweaver CS4 to create a simple page layout. However, a more powerful technique is to use Cascading Style

More information

APEX Developers Do More With Less!! How do YOU manage your APEX CSS? Storage Options 1. Web server 2. APEX repository 3. In line 4.

APEX Developers Do More With Less!! How do YOU manage your APEX CSS? Storage Options 1. Web server 2. APEX repository 3. In line 4. APEX Developers Do More With Less!! Roel Hartman Copyright 2016 APEX Consulting 2 How do YOU manage your APEX CSS? Storage Options 1. Web server 2. APEX repository 3. In line 4. Attribute 3 How do YOU

More information

CSS Module in 2 Parts

CSS Module in 2 Parts CSS Module in 2 Parts So as to familiarize yourself with the basics of CSS before moving onto Dreamweaver, I d like you to do the 2 following Modules. It is important for you to AT LEAST do Part 1. Part

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

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

.hedgehog { background-image: url(backyard.jpg); color: #ffff99; height: 6in; width: 12in; } .tube {

.hedgehog { background-image: url(backyard.jpg); color: #ffff99; height: 6in; width: 12in; } .tube { .hedgehog { background-image: url(backyard.jpg); color: #ffff99; height: 6in; width: 12in;.tube { color: #996600; height: 3in; width: 12in; position: fixed; What is CSS? Cascading Style Sheets CSS is responsible

More information

Responsive web design (RWD) CSS3 Media queries. Mobile vs desktop web sites. Web Development 1 CS1115/CS5002

Responsive web design (RWD) CSS3 Media queries. Mobile vs desktop web sites. Web Development 1 CS1115/CS5002 1 of 13 CS1115/CS5002 Web Development 1 Dr Derek Bridge School of Computer Science & Information Technology University College Cork Mobile vs desktop web sites A few organization have two web sites, one

More information

Lab 1: Introducing HTML5 and CSS3

Lab 1: Introducing HTML5 and CSS3 CS220 Human- Computer Interaction Spring 2015 Lab 1: Introducing HTML5 and CSS3 In this lab we will cover some basic HTML5 and CSS, as well as ways to make your web app look and feel like a native app.

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

Designing the Home Page and Creating Additional Pages

Designing the Home Page and Creating Additional Pages Designing the Home Page and Creating Additional Pages Creating a Webpage Template In Notepad++, create a basic HTML webpage with html documentation, head, title, and body starting and ending tags. From

More information

/* ========================================================================== PROJECT STYLES

/* ========================================================================== PROJECT STYLES html { box-sizing: border-box; *, *:before, *:after { box-sizing: inherit; img { max-width: 100%; border: 0; audio, canvas, iframe, img, svg, video { vertical-align: middle; /* Remove gaps between elements

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

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

How Behance went responsive with Sass and RequireJS. Jackie

How Behance went responsive with Sass and RequireJS. Jackie How Behance went responsive with Sass and RequireJS Jackie Balzer @jackiebackwards July 25, 2013 1 is going How Behance went responsive with Sass and RequireJS Jackie Balzer @jackiebackwards July 25, 2013

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

Media-Specific Styles

Media-Specific Styles Media-Specific Styles Same HTML, Different CSS R. Scott Granneman r Jans Carton 1.5 2008 R. Scott Granneman Last updated 2017-06-13 You are free to use this work, with certain restrictions. For full licensing

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

week8 Tommy MacWilliam week8 October 31, 2011

week8 Tommy MacWilliam week8 October 31, 2011 tmacwilliam@cs50.net October 31, 2011 Announcements pset5: returned final project pre-proposals due Monday 11/7 http://cs50.net/projects/project.pdf CS50 seminars: http://wiki.cs50.net/seminars Today common

More information

CSS. MPRI : Web Data Management. Antoine Amarilli Friday, December 7th 1/43

CSS. MPRI : Web Data Management. Antoine Amarilli Friday, December 7th 1/43 CSS MPRI 2.26.2: Web Data Management Antoine Amarilli Friday, December 7th 1/43 Overview Cascading Style Sheets W3C standard: CSS 1 1996 CSS 2 1998 CSS 2.1 2011, 487 pages CSS 3.0 Ongoing (various modules),

More information

Data Visualization on the Web with D3

Data Visualization on the Web with D3 Data Visualization on the Web with D3 Bowen Yu April 11, 16 Big Data Analysis Interactive Analysis After dataprocessingwith BD techniques, itis necessary to visualize the data so that human analyst can

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

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

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

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

CS 1100: Web Development: Client Side Coding / Fall 2016 Lab 2: More HTML and CSS

CS 1100: Web Development: Client Side Coding / Fall 2016 Lab 2: More HTML and CSS Goals CS 1100: Web Development: Client Side Coding / Fall 2016 Lab 2: More HTML and CSS Practice writing HTML Add links and images to your web pages Apply basic styles to your HTML This lab is based on

More information

Guidelines for doing the short exercises

Guidelines for doing the short exercises 1 Short exercises for Murach s HTML5 and CSS Guidelines for doing the short exercises Do the exercise steps in sequence. That way, you will work from the most important tasks to the least important. Feel

More information

Web Application Styling

Web Application Styling 1 PRESENTED BY ORYX Web Application Styling Presented by Roel Fermont & Harm Wibier 2 Todays goals is to learn how to make your highly functional applications look great! We ll show you where to start

More information

CSS Design and Layout Basic Exercise instructions. Today's exercises. Part 1: Arrange Page into Sections. Part 1, details (screenshot below)

CSS Design and Layout Basic Exercise instructions. Today's exercises. Part 1: Arrange Page into Sections. Part 1, details (screenshot below) CSS Design and Layout Basic Exercise instructions You may want to bring your textbook to Exercises to look up syntax and examples. Have a question? Ask for help, or look at the book or lecture slides.

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

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

Unit 20 - Client Side Customisation of Web Pages. Week 2 Lesson 4 The Box Model

Unit 20 - Client Side Customisation of Web Pages. Week 2 Lesson 4 The Box Model Unit 20 - Client Side Customisation of Web Pages Week 2 Lesson 4 The Box Model So far Looked at what CSS is Looked at why we will use it Used CSS In-line Embedded (internal style-sheet) External

More information

Session 4. Style Sheets (CSS) Reading & References. A reference containing tables of CSS properties

Session 4. Style Sheets (CSS) Reading & References.   A reference containing tables of CSS properties Session 4 Style Sheets (CSS) 1 Reading Reading & References en.wikipedia.org/wiki/css Style Sheet Tutorials www.htmldog.com/guides/cssbeginner/ A reference containing tables of CSS properties web.simmons.edu/~grabiner/comm244/weekthree/css-basic-properties.html

More information

Block & Inline Elements

Block & Inline Elements Block & Inline Elements Every tag in HTML can classified as a block or inline element. > Block elements always start on a new line (Paragraph, List items, Blockquotes, Tables) > Inline elements do not

More information

Create a Web Page with Spry Navigation Bar. March 30, 2010

Create a Web Page with Spry Navigation Bar. March 30, 2010 Create a Web Page with Spry Navigation Bar March 30, 2010 Open a new web page by selecting File on the Menu bar, and pick Open. Select HTML as the page type and none from the layout list. Finally, we press

More information

CSS: Responsive Design, CSS3 and Fallbacks

CSS: Responsive Design, CSS3 and Fallbacks CSS: Responsive Design, CSS3 and Fallbacks CISC 282 October 4, 2017 What is a Mobile Browser? Browser designed for a not-desktop display Phones/PDAs, tablets, anything handheld Challenges and constraints

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

HTML & CSS for Library Professionals

HTML & CSS for Library Professionals These slides are online at http://bit.ly/html_lib_slides HTML & CSS for Library Professionals Robin Camille Davis Emerging Technologies & Online Learning Librarian, John Jay College of Criminal Justice

More information

NAVIGATION INSTRUCTIONS

NAVIGATION INSTRUCTIONS CLASS :: 13 12.01 2014 NAVIGATION INSTRUCTIONS SIMPLE CSS MENU W/ HOVER EFFECTS :: The Nav Element :: Styling the Nav :: UL, LI, and Anchor Elements :: Styling the UL and LI Elements CSS DROP-DOWN MENU

More information

How to create and edit a CSS rule

How to create and edit a CSS rule Adobe Dreamweaver CS6 Project 3 guide How to create and edit a CSS rule You can create and edit a CSS rule in two locations: the Properties panel and the CSS Styles panel. When you apply CSS styles to

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