What is CSS? NAME: INSERT OPENING GRAPHIC HERE:

Similar documents
INFORMATICA GENERALE 2014/2015 LINGUAGGI DI MARKUP CSS

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

Assignments (4) Assessment as per Schedule (2)

Web Programming HTML CSS JavaScript Step by step Exercises Hans-Petter Halvorsen

BIM222 Internet Programming

CREATING A WEBSITE USING CSS. Mrs. Procopio CTEC6 MYP1

Cascading style sheets, HTML, DOM and Javascript

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

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

Three Ways to Use CSS:

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

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

CITS1231 Web Technologies. Introduction to Cascading Style Sheets

INTRODUCTION TO HTML5! CSS Styles!

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

HTML Hyperlinks (Links)

Comp-206 : Introduction to Software Systems Lecture 23. Alexandre Denault Computer Science McGill University Fall 2006

CSS Scripting and Computer Environment - Lecture 09

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

Markup Language SGML: Standard Generalized Markup Language. HyperText Markup Language (HTML) extensible Markup Language (XML) TeX LaTeX

The internet is a worldwide collection of networks that link millions of computers. These links allow the computers to share and send data.

Cascading Style Sheet KAVERI KAR (ASSISTANT PROFESSOR) SSIPMT, RAIPUR

Document Structure. Document Appearance. Interactivity

Overview. Part I: Portraying the Internet as a collection of online information systems HTML/XHTML & CSS

Introduction to Cascading Style Sheet (CSS)

Web Programming and Design. MPT Junior Cycle Tutor: Tamara Demonstrators: Aaron, Marion, Hugh

Navigation. Websites need a formalized system of links to allow users to navigate the site

Introduction to Web Programming and Design

Comm 244 Week 3. Navigation. Navigation. Websites need a formalized system of links to allow users to navigate the site

COMS 359: Interactive Media

CISC1600-SummerII2012-Raphael-lec3 1

Introduction to using HTML to design webpages

Scripting for Multimedia LECTURE 5: INTRODUCING CSS3

INTRODUCTION TO CSS. Mohammad Jawad Kadhim

CSS: The Basics CISC 282 September 20, 2014

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

CSS Cascading Style Sheets

Web Programming and Design. MPT Senior Cycle Tutor: Tamara Week 2

Introduction to HTML and CSS. Arts and Humanities in the Digital Age 2018 CHASE DTP Dr. Paul Gooding

Web Design and Development ACS-1809

Introduction to Cascading Style Sheets

Dreamweaver CS6. Level 1. Topics Workspaces Basic HTML Basic CSS

Methods for configuring Cascading Style Sheets. Applying style to element name selectors. Style Rule Basics. CMPT 165: Cascading Style Sheets

COMP519 Web Programming Autumn Cascading Style Sheets

Shane Gellerman 10/17/11 LIS488 Assignment 3

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

Using Dreamweaver CS6

Chapter 4 CSS basics

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

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

Which is why we ll now be learning how to write in CSS (or cascading sheet style)

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

CSS is applied to an existing HTML web document--both working in tandem to display web pages.

Reading 2.2 Cascading Style Sheets

HTML/XML. HTML Continued Introduction to CSS

HTML. Mohammed Alhessi M.Sc. Geomatics Engineering. Internet GIS Technologies كلية اآلداب - قسم الجغرافيا نظم المعلومات الجغرافية

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

Basic CSS Lecture 17

MEXICO 2015, ilab XALAPA

Skill Area 323: Design and Develop Website. Multimedia and Web Design (MWD)

Cascading Style Sheets Level 2

CSS: Cascading Style Sheets

CSS - Cascading Style Sheets

Module 2 (VI): CSS [Part 3]

Syllabus - July to Sept

SCP53) (Web Technology) Unit-2 (Introduction to Style Sheet) Type: 100% Theory Question Bank

Chapter 3 Style Sheets: CSS

Lab Introduction to Cascading Style Sheets

Cascading Style Sheets. Overview and Basic use of CSS

Appendix D CSS Properties and Values

Web Publishing with HTML

CSS for Styling CS380

CSS: formatting webpages

Objective % Select and utilize tools to design and develop websites.

Using Dreamweaver CC. Logo. 4 Creating a Template. Page Heading. Page content in this area. About Us Gallery Ordering Contact Us Links

HTML, CSS, JavaScript

Lesson 5 Introduction to Cascading Style Sheets

CASCADING STYLE SHEET CSS

ITNP43: HTML Lecture 4

Introduction to WEB PROGRAMMING

COSC 2206 Internet Tools. CSS Cascading Style Sheets

Creating and Building Websites

CSC9B1: Essential Skills WWW 1

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

MRK260. Week Two. Graphic and Web Design

Block & Inline Elements

HTMLnotesS15.notebook. January 25, 2015

Introduction to Web Design CSS Reference

Introduction to Web Design CSS Reference

Programmazione Web a.a. 2017/2018 HTML5

With HTML you can create your own Web site. This tutorial teaches you everything about HTML.

1. Cascading Style Sheet and JavaScript

Cascading Style Sheets (CSS)

CSS Cascading Style Sheets

CSS: Cascading Style Sheets

E , Fall 2007 More with stylesheets

Step 1- Creating a new XHTML Website (2points)

ID1354 Internet Applications

INTRODUCTION TO WEB USING HTML What is HTML?

Unit 20 - Client Side Customisation of Web Pages. Week 2 Lesson 3 Introduction to CSS

Transcription:

What is CSS? NAME: INSERT OPENING GRAPHIC HERE: Highlight VOCABULARY WORDS that you need defined. Put a? mark in any area that you need clarified. 1 What is CSS? CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to solve a problem External Style Sheets can save a lot of work External Style Sheets are stored in CSS files. 2 Styles Solved a Big Problem HTML was never intended to contain tags for formatting a document. HTML was intended to define the content of a document, like: <h1>this is a heading</h1> <p>this is a paragraph.</p> When tags like <font>, and color attributes were added to the HTML 3.2

specification, it started a nightmare for web developers. Development of large web sites, where fonts and color information were added to every single page, became a long and expensive process. To solve this problem, the World Wide Web Consortium (W3C) created CSS. In HTML 4.0, all formatting could be removed from the HTML document, and stored in a separate CSS file. All browsers support CSS today. 3 CSS Saves a Lot of Work! CSS defines HOW HTML elements are to be displayed. Styles are normally saved in external.css files. External style sheets enable you to change the appearance and layout of all the pages in a Web site, just by editing one single file! 4 CSS Syntax A CSS rule set consists of a selector and a declaration block:

The selector points to the HTML element you want to style. The declaration block contains one or more declarations separated by semicolons. Each declaration includes a property name and a value, separated by a colon. 5 CSS Example A CSS declaration always ends with a semicolon, and declaration groups are surrounded by curly braces: p {color:red;text-align:center;} To make the CSS code more readable, you can put one declaration on each line, like this: Example p { color: red; text-align: center;

} 6 CSS Selectors CSS selectors allow you to select and manipulate HTML element(s). CSS selectors are used to "find" (or select) HTML elements based on their id, classes, types, attributes, values of attributes and much more. 7 The element Selector The element selector selects elements based on the element name. You can select all <p> elements on a page like this: (all <p> elements will be center-aligned, with a red text color) Example p { text-align: center; color: red; } 8 Three Ways to Insert CSS

There are three ways of inserting a style sheet: External style sheet Internal style sheet Inline style 9 External Style Sheet An external style sheet is ideal when the style is applied to many pages. With an external style sheet, you can change the look of an entire Web site by changing just one file. Each page must include a link to the style sheet with the <link> tag. The <link> tag goes inside the head section: <head> <link rel="stylesheet" type="text/css" href="mystyle.css"> </head> An external style sheet can be written in any text editor. The file should not contain any html tags. The style sheet file must be saved with a.css extension. An example of a style sheet file is shown below: "mystyle.css": body { background-color: lightblue; } h1 {

} color: navy; margin-left: 20px; 10 Internal Style Sheet An internal style sheet should be used when a single document has a unique style. You define internal styles in the head section of an HTML page, inside the <style> tag, like this: Example <head> <style> body { background-color: linen; } h1 { color: maroon; margin-left: 40px; } </style> </head> 11 Inline Styles An inline style loses many of the advantages of a style sheet (by mixing content with presentation). Use this method sparingly!

To use inline styles, add the style attribute to the relevant tag. The style attribute can contain any CSS property. The example shows how to change the color and the left margin of a h1 element: Example <h1 style="color:blue;margin-left:30px;">this is a heading.</h1> 12 Multiple Style Sheets If some properties have been set for the same selector in different style sheets, the values will be inherited from the more specific style sheet. For example, assume that an external style sheet has the following properties for the h1 selector: h1 { color: navy; margin-left: 20px; } then, assume that an internal style sheet also has the following property for the h1 selector: h1 { color: orange; } If the page with the internal style sheet also links to the external style

sheet the properties for the h1 element will be: color: orange; margin-left: 20px; The left margin is inherited from the external style sheet and the color is replaced by the internal style sheet. 13 Multiple Styles Will Cascade into One Styles can be specified: inside an HTML element inside the head section of an HTML page in an external CSS file 14 Cascading order What style will be used when there is more than one style specified for an HTML element? Generally speaking we can say that all the styles will "cascade" into a new "virtual" style sheet by the following rules, where number four has the highest priority: 1. Browser default 2. External style sheet

3. Internal style sheet (in the head section) 4. Inline style (inside an HTML element) So, an inline style (inside an HTML element) has the highest priority, which means that it will override a style defined inside the <head> tag, or in an external style sheet, or in a browser (a default value). INSERT SMART ART VENN DIAGRAM HERE. GIVE AT LEAST 3 WAYS CSS AND HTML ARE DIFFERENT, AND 3 WAYS THEY ARE ALIKE.

Try CSS: Go to the CSS tutorial on the W2Schools site. http://www.w3schools.com/css/default.asp Click on 3 of the TRY IT links to try out CSS. Use the snipping tool to complete the following table. Original CSS example from TRY IT: Edit the code and click submit. Then, snip example with the CHANGES you made to the code: 1 2 3

Use the notes you took from the article and your experience with the TRY IT activities to answer the following questions. 1. What is CSS? 2. How did CSS Styles Solve a Big Problem? 3. How does CSS Save a Lot of Work? 4. What is standard CSS Syntax? 5. Give an example of CSS code. 6. What are CSS Selectors? 7. What is an html element? What is an element Selector? 8. What are the Three Ways to Insert CSS? 9. How do you link an External Style Sheet to an HTML document?

10. Where to you put the CSS code for an Internal Style Sheet? 11. Give an example of an Inline Style. 12. What does the phrase Multiple Style Sheets mean? 13. What does the phrase Multiple Styles Will Cascade into One mean? 14. What is the Cascading order?