Writing CSS is like directing a film.

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

Appendix D CSS Properties and Values

CSS Cascading Style Sheets

Reading 2.2 Cascading Style Sheets

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

Three Ways to Use CSS:

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

HTML/XML. HTML Continued Introduction to CSS

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

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

CSS means Cascading Style Sheets. It is used to style HTML documents.

Assignments (4) Assessment as per Schedule (2)

**Method 3** By attaching a style sheet to your web page, and then placing all your styles in that new style sheet.


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

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

CSS: The Basics CISC 282 September 20, 2014

INTERNATIONAL UNIVERSITY OF JAPAN Public Management and Policy Analysis Program Graduate School of International Relations

INFORMATICA GENERALE 2014/2015 LINGUAGGI DI MARKUP CSS

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

ICT IGCSE Practical Revision Presentation Web Authoring

IMY 110 Theme 6 Cascading Style Sheets

Adding CSS to your HTML

Introduction to Cascading Style Sheets

CSS. M hiwa ahamad aziz Raparin univercity. 1 Web Design: Lecturer ( m hiwa ahmad aziz)

CSS Tutorial Part 1: Introduction: A. Adding Style to a Web Page (3 options):

Parashar Technologies HTML Lecture Notes-4

Chapter 4 CSS basics

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

CSS stands for Cascading Style Sheets Styles define how to display HTML elements

CSS: Formatting Text. CSS for text processing: font-family. Robert A. Fulkerson

Cascading Style Sheets. Overview and Basic use of CSS

CSS.

Cascading Style Sheets Level 2

Lecture 10. CSS Properties. Mr. Mubashir Ali Lecturer (Dept. of Computer Science)

Web Design and Development Tutorial 03

Introduction to Web Design CSS Reference

Introduction to Web Design CSS Reference

CSS Cascading Style Sheets

Cascading Style Sheets (CSS)

COSC 2206 Internet Tools. CSS Cascading Style Sheets

There are 3 places you can write CSS.

Web Site Design and Development Lecture 6

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

BIM222 Internet Programming

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

CSS Styles Quick Reference Guide

CSS: formatting webpages

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

CASCADING STYLE SHEETS (CSS) BY: RIHAM ALSMARI, PNU. Lab 4

Cascade Stylesheets (CSS)

CSS BASICS. selector { property: value; }

Admin. Midterm 1 on. Oct. 13 th (2 weeks from today) Coursework:

CMPT 165: More CSS Basics

Internet Programming 1 ITG 212 / A

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

CASCADING STYLESHEETS

Wanted! Introduction. Step 1: Styling your poster. Activity Checklist. In this project, you ll learn how to make your own poster.

Using Dreamweaver. 6 Styles in Websites. 1. Linked or Imported Stylesheets. 2. Embedded Styles. 3. Inline Styles

Basic CSS Lecture 17

By Ryan Stevenson. Guidebook #3 CSS

Introduction to Web Tech and Programming

Building Page Layouts

AN INTRODUCTION TO WEB PROGRAMMING. Dr. Hossein Hakimzadeh Department of Computer and Information Sciences Indiana University South Bend, IN

CSS. Lecture 16 COMPSCI 111/111G SS 2018

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

Web Engineering CSS. By Assistant Prof Malik M Ali

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

Using CSS in Web Site Design

Web Site Design and Development Lecture 7. CS 0134 Fall 2018 Tues and Thurs 1:00 2:15PM

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

2005 WebGUI Users Conference

CSE 154 LECTURE 3: MORE CSS

CSS: Cascading Style Sheets

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

CSS: Layout Part 2. clear. CSS for layout and formatting: clear

CSS Lecture 16 COMPSCI 111/111G SS 2018

Let s start with the document tree

CSS Futures. Web Development

Cascading Style Sheets CSCI 311

Networks and Web for Health Informatics (HINF 6220) Tutorial 8 : CSS. 8 Oct 2015

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

Using Dreamweaver CC. 6 Styles in Websites. Exercise 1 Linked Styles vs Embedded Styles

Chapter 2 CSS for Style

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

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

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

Tutorial 3: Working with Cascading Style Sheets

Module 2 (VII): CSS [Part 4]

Creating A Website - Part 1: Web Design principles, HTML & CSS. CSS Color Values. Hexadecimal Colors. RGB Color

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

Web Development & Design Foundations with HTML5

CSS: Responsive Design, CSS3 and Fallbacks

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

CSS CSS how to display to solve a problem External Style Sheets CSS files CSS Syntax

Web Development & Design Foundations with HTML5

CSS exercise - Part 1

CSS: Cascading Style Sheets

APPLIED COMPUTING 1P01 Fluency with Technology

ICT IGCSE Practical Revision Presentation Web Authoring

Transcription:

INTRO TO CSS3. #3

3.1 What is CSS? 2

3 Writing CSS is like directing a film. The actors and spoken words are the HTML content. The set, costume and style are controlled by CSS. You can tell the content where to go and what it should look like. Like a director you can say specify different people or groups to do different things "I want all extras over here" or "We need the lead wearing black here". It's written completely differently to HTML. There are no similarities in their syntax.

4 CSS separates content from design. Before CSS styling was done inline with the HTML and tables were used to lay out the page. There are many problems with this approach, the biggest is that your style rules needed to be replicated across multiple pages. With CSS you can set a style rule in a.css file, then reuse that throughout your website. If you change that one rule, it will update each page loading that CSS.

5 Not all browsers support all CSS rules. Like HTML, CSS has different versions. The newest supported version is CSS3. Older browsers won't support new features of CSS3. New features include: - Drop and Text Shadow - Rounded Corners - Transitions and Animations - Gradients - Webfonts - Screen size dependent rules (Responsive websites) As CSS relates to style, a site will generally still be readable in older browsers that don't support all features. This is called degrading gracefully.

6 You can write CSS in 3 locations. The best place to write CSS is in a separate.css file. You then link that file to your HTML file in the head of your document: <link rel="stylesheet" href="css/screen.css"> You can also write CSS in the <head> of each HTML page. <style> p{ color:red; </style> Or the last option is to write CSS inline within a HTML element. To do that you add an attribute to the opening tag: <p style="color:red;">this will be red</p> You can use all 3 variations simultaneously if you wish. You can also load mulitple external CSS files.

7 CSS files use the extension.css You should save the CSS files in their own subfolder. Like html files, the filename should use only lower case characters and avoid spaces. To link the CSS file you need to add a <link> element in the head of each HTML page that will use that CSS. In this case the CSS file is called screen.css and is in the css subfolder. <link rel="stylesheet" href="css/screen.css">

3.2 Writing CSS

9 There are 3 parts to a CSS rule. selector, property and value. The selector is the HTML element you want to style. The property is the feature of that element you want to style. These are predefined, you can see the list at http://www. w3schools.com/cssref/ The value is the specification of that style you want. The actor's suit color should be navy. selector property value! CSS uses US english spelling for color and center!

10 selector p { property value color: red; The punctuation is very important. - Each selector is followed by a set of curly brackets. - Each property is followed by a colon - and the value is followed by a semi-colon.

11 Each pair of property and value is called a declaration. You can write infinite declarations inside a selector. p { color:red; declaration #1 background:black; declaration #2

3.3 Selectors

13 There are 3 ways to select a HTML element. 1. The general element name: add style rules to all HTML elements of that type. e.g. p{ color:red; styles all paragraphs red. 2. An id selector: used to set style rules for one specific element. You cannot use the same id twice on one HTML page. 3. A class selector: can be applied to multiple elements. There is a hierarchy to how these rules are weighted and applied, in CSS it's called specificity.

14 The general selector simply uses the HTML element name. p{ color:red; h1{ color:blue; h2{ color:green; ul{ color:orange;

15 CSS: To style using an id selector, use a hash symbol followed by the id name (you define this). #intro{ font-size:20px; HTML: In your HTML, set the id attribute in the opening tag. <p id="intro"> this is the intro and will be bigger</p>

16 CSS: For a class selector, use a full stop symbol, then the class name (you define this)..bigger{ font-size:20px; HTML: Set a class attribute in the opening tag. <p class="bigger"> this is the intro and will be bigger</p> <p>this is not the intro</p>

3.4 CSS properties

18 color will change the text color. To write a color value you can use pre-defined color names or use a hexidecimal RGB color code like #ff9900. p { color:orange; h1 color:#ff9900;

19 background will change the background. Again you can use pre-defined color names or use a hexidecimal color code. p { background:black; h1 background:#000000;

20 background allows you to use an image as a background. The default behaviour is to tile the image over and over if it is smaller than the element. body { background:url("../images/back.jpg");

21 You can turn off repeating, position the image and change it's size as well. You can group them into one declaration or use separate properties background-repeat, background-position and background-size. body { background:url("../images/back.jpg") no-repeat center; background-size:cover;

22 text-align allows you to align text. p { text-align:center;

23 text-decoration allows you to decorate text. Options include overline, underline, line-through. p { text-decoration:underline;

24 text-transform allows you to change the case. The options are lowercase, uppercase and capitalize. h1{ text-transform:uppercase;

25 font-size allows you to set the font size. You can set the font-size using px units (for pixels) or em. 1em is equal to the current font size. The default text size in browsers is 16px. h1{ font-size:32px; p { font-size:1em;

26 line-height sets the space between lines of text. You can set the line-height using px units or a number which will be multiplied that elements font-size. h1{ line-height:32px; p { line-height:1.5;

27 font-style allows you to italicise text. h1{ font-style:italic;

28 font-weight sets the weight of the text. You can define this with the words: normal, bold, bolder and lighter or the figures 100, 200, 300, 400, 500, 600, 700, 800, 900 where 400 is normal. h1{ font-weight:700; Not all fonts will have all weights.

29 font-family sets the font family of the text You can specify multiple families simultaneously. The browser will attempt to load the left most one first, then the next. You can use serif or sans-serif as a last catch-all option. h1{ font-family:gotham, Helvetica, sans-serif; Traditionally the font needed to be on the users machine. Defining more than one allowed you to use fall backs for different scenarios.

30 border allows you to set a border around an element. It's value is split into 3, the thickness of the line, the style of the line and the color of the line. The styles you can use include solid, dotted, dashed, double, groove, ridge and outset. h1{ border:10px solid #ff9900;

31 border-top, border-left, border-right and border-bottom allow you to define one side's border at a time. h1{ border-left:20px solid #ff9900;

32 opacity defines an element's transparency. The range is from 0 to 1 0 is completely transparent (invisible) and 1 is completely opaque. h1{ opacity:.5;

3.5 Selectors and specificity

34 You can select more than one HTML element You can group more than one selector together to style multiple items simultaneously. Just separate them with commas. p, h1, h2{ font-family:"comic Sans";

35 Pseudo classes target different states There are many pseudo classes, the most common is to used to target a link when it is hovered. To write a pseudo class, write your selector as before, then use a colon, :, then the pseudo class, in this case hover a:hover{ color:#000000;

36 You can target children elements. Write the parent selector first, leave a space then write the child element. footer p{ font-size:11px; This rule will only affect paragraphs in the footer. You can combine this behaviour with classes and ids. footer p.intro{ font-size:11px

37 There is a hierarchy to how CSS rules are applied. It's a bit like a game of poker, the way a certain rule is written can over rule another way. #1 Inline styles This is where the style is written in the opening tag of the element. #2 ID selectors This where you use an ID selector. #3 Class selectors This where you use a Class selector. #4 General element selectors This where you use a general selector like p{ If the rules have the same weight or level, the last written one will be applied.

38 The rules of specificity can be confusing and frustrating. You may be writing CSS rules that aren't being applied to your HTML elements as there are other rules with a higher rank. You can use your browser to see what rules are being used or ignored. In Chrome, right click on the element and choose 'Inspect element'.

3.6 CSS3 properties

40 Useful new CSS3 properties. text-shadow: 2px 2px 2px #ff0000; horizontal vertical blur color box-shadow: 2px 2px 2px #ff0000; horizontal vertical blur color border-radius: 20px; transition: all.5s; properties duratio

41 CSS3 supports gradients. They are quite complicated to write but there are online generators: www.colorzilla.com/gradient-editor/ background: linear-gradient(to bottom, rgba(0,0,0,0.65) 0%,rgba(0,0,0,0) 100%);

For next week. Create an HTML page using the following content. Use a header, footer and aritcle element to structure the page and include a mockup of a navigaion. Using an external stylesheet, style the page to be to use a dark background with light text in a contemporary style. In your CSS file use at least: - a parent child selector - a grouping of selectors - try a CSS3 property - use a background image Duplicate the HTML page and create a link to it from the first page and vice-versa.

For next week. <h1>interaction design</h1> <h2> In design, human computer interaction, and software development, interaction design, often abbreviated IxD, is defined as "the practice of designing interactive digital products, environments, systems, and services." Like many other design fields interaction design also has an interest in form but its main focus is on behavior.[1]:1 What clearly marks interaction design as a design field as opposed to a science or engineering field is that it is synthesis and imagining things as they might be, more so than focusing on how things are.</h2> <h3>history</h3> <p>the term interaction design was first coined by Bill Moggridge and Bill Verplank in the mid-1980s. It would be another 10 years before other designers rediscovered the term and started using it. To Verplank, it was an adaptation of the computer science term user interface design to the industrial design profession. To Moggridge, it was an improvement over soft-face, which he had coined in 1984 to refer to the application of industrial design to products containing software.</p> <p>the first academic program officially named as Interaction Design was established at Carnegie Mellon University in 1994 as Master of Design in Interaction Design. When the program started it focused mostly on screen interfaces, but today more on the big picture aspects of interaction people, organizations, culture, service, and system.</p> <p>in 1990, Gillian Crampton Smith founded the Computer-related Design MA at the Royal College of Art (RCA) in London, which changed to Design Interactions in 2005, headed by Professor Anthony Dunne. In 2001, Crampton Smith helped found the Interaction Design Institute Ivrea, a small institute in Northern Italy dedicated solely to interaction design; the institute moved to Milan in October 2005 and merged courses with Domus Academy. In 2007, some of the people originally involved with IDII set up the Copenhagen Institute of Interaction Design (CIID). In 1998, the Swedish Foundation for Strategic Research founded The Interactive Institute - a Swedish research institute in the field of interaction design.</p>