Intro To Cascading Style Sheets By Mario Yannakakis.

Slides:



Advertisements
Similar presentations
Cascading Style Sheets
Advertisements

1 © Netskills Quality Internet Training, University of Newcastle Introducing Cascading Style Sheets © Netskills, Quality Internet.
HIGH LEVEL OVERVIEW: CSS CSS SYNTAX CONSISTS OF A SET OF RULES THAT HAVE 3 PARTS: A SELECTOR, A PROPERTY, AND A VALUE. IT’S NOT NECESSARY TO REMEMBER THIS.
CSS-Formatting Review Cascading Style Sheets addstyle to your HTML web pages.
CSS Basics Style and format your web site using CSS.
CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
Computer Applications II.  A Style Sheet is a web page development tool that allows the developer to make global changes to a web page (or web site)
Cascading Style Sheets
Cascading Style Sheets: Basics I450 Technology Seminar Copyright 2003, Matt Hottell.
Cascading Style Sheets (CSS) “Styles” for short. Pg. 418.
Cascading Style Sheets
HTML Overview - Cascading Style Sheets (CSS). Before We Begin Make a copy of one of your HTML file you have previously created Make a copy of one of your.
CHAPTER 7 STYLING CONTENT WITH CASCADING STYLE SHEETS.
Introducing CSS CIS 133 mashup Javascript, jQuery and XML 1.
CSS. CSS, or Cascading Styles Sheets, is a way to style HTML. Whereas the HTML is the content, the style sheet is the presentation of that document.
Introduction to CSS.
Cascading Style Sheets. CSS stands for Cascading Style Sheets and is a simple styling language which allows attaching style to HTML elements. CSS is a.
Cascading Style Sheets Basics. Why use Cascading Style Sheets? Allows you to set up a series of rules for all pages in a site. The series may be changed.
Cascading Style Sheets By: Valerie Kuna. What are Cascading Style Sheets? Cascading Style Sheets (CSS) are a standard for specifying the presentation.
© 2004, Robert K. Moniot Chapter 6 CSS : Cascading Style Sheets.
1 Web Developer & Design Foundations with XHTML Chapter 9 Key Concepts.
Recognizing the Benefits of Using CSS 1. The Evolution of CSS CSS was developed to standardize display information CSS was slow to be supported by browsers.
กระบวนวิชา CSS. What is CSS? CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to.
Introduction to Cascading Style Sheets (CSS) Module 2: HTML Basics LESSON 4.
4.01 Cascading Style Sheets
CM143 Week 4 Introducing CSS. Cascading Style Sheets A definition for the style in which an element of the webpage will be displayed Border width, colour,
Computing Concepts: CSS. Aims  To understand the uses of css  To understand the different types of css  To be able to create a css file  To be able.
Chapter 11 Cascading Style Sheets: Part I The Web Warrior Guide to Web Design Technologies.
CSS Style Rules Guang Tong, Zhan L;lo’p[ Css Style Rule Guang Tong Zhan Three ways to insert CSS 1 External style sheet 2 Internal style sheet 3 Inline.
ITCS373: Internet Technology Week 3: Introduction to CSS Dr. Faisal Al-Qaed.
Introduction To CSS.. HTML Review What is HTML used for? Give some examples of formatting tags in HTML? HTML is the most widely used language on the Web.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
Cascading Style Sheets Orientation Learning Web Design: Chapter 11.
INTRODUCTION TO CSS. OBJECTIVES: D EFINE WHAT CSS IS. K NOW THE HISTORY OF CSS. K NOW THE REASON WHY CSS IS USED. CSS SYNTAX. CSS ID AND CLASS.
CSS CSS is short for C ascading S tyle S heets. It is a new web page layout method that has been added to HTML to give web developers more control over.
Introduction to CSS. What is CSS?  Cascading Style Sheets  Used for styling HTML  Also important in javascript and jquery for selectors  External.
Cascading Style Sheets CSS. Source W3Schools
XHTML Formatting font with a style declaration. Formatting Font HTML uses the font tag to change size and family of font But… the font tag is being deprecated.
Microsoft Expression Web 3 – Illustrated Unit D: Structuring and Styling Text.
CSS Hadas Kahsay. Overview  What is CSS  Basic syntax of CSS Rules  How to link CSS style to html documents  Browsers and CSS  Advantages of CSS.
CSS Syntax. Syntax The CSS syntax is made up of three parts: a selector, a property and a value: selector {property: value}
CSS Cascading Style Sheets *referenced from
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
1 Cascading Style Sheet (CSS). 2 Cascading Style Sheets (CSS)  a style defines the appearance of a document element. o E.g., font size, font color etc…
CSS Introductions. Objectives To take control of the appearance of a Web site by creating style sheets. To use a style sheet to give all the pages of.
WEB FOUNDATIONS CSS Overview. Outline  What is CSS  What does it do  Where are styles stored  Why use them  What is the cascade effect  CSS Syntax.
CSS for Styling Text.
Getting Started with CSS
>> Introduction to CSS
Introduction to CSS.
Chapter 6 Cascading Style Sheets™ (CSS)
Intro to CSS CS 1150 Fall 2016.
Cascading Style Sheet (CSS)
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Website Design 3
Cascading Style Sheets - Building a stylesheet
Intro to CSS CS 1150 Spring 2017.
Stylin’ with CSS.
Introduction to Cascading Style Sheets (CSS)
Web Programming– UFCFB Lecture 11
What are Cascading Stylesheets (CSS)?
Cascading Style Sheets™ (CSS)
Tutorial 3 Working with Cascading Style Sheets
Web Design and Development
Introduction to CSS.
Cascading Style Sheets - Building a stylesheet
Stylin’ with CSS.
External Style Sheets.
Stylin’ with CSS.
Presentation transcript:

Intro To Cascading Style Sheets By Mario Yannakakis

Why Use CSS?  Separate form and structure  Control layout  Make smaller, faster pages  Maintain and update many pages at once  Be Browser friendly  Control text sizes and appearance

Separate form and structure  HTML defines the structure  CSS enables us to define the form or appearance within the structure for example, we could use an HTML to display heading text... then use a CSS style to define the specific appearance for the heading where we want it to appear different to the default display for  CSS enables us to define the form or appearance within the structure for example, we could use an HTML to display heading text... then use a CSS style to define the specific appearance for the heading where we want it to appear different to the default display for

Make smaller faster pages  Avoid the need to add attributes to HTML tags every time  Specify the attributes for each tag in the style sheet  Obtain consistency of appearance

Maintain and update pages more efficiently  Link HTML pages to a Style Sheet  Update attributes for a single page or a site or even multiple sites by changing one document only Style Sheet    

Be Browser friendly  Users don’t get code or other errors if using a browser that doesn’t support the style  Browsers that don’t recognise the CSS, simply ignore it.

Methods for using Style Sheets Place the style sheet information directly in the tags of the HTML document. For adding styles one page at a time. Link to an external style sheet from the HTML document. The external file will set the style for all linked pages Obtain style from an external style sheet, similar to Linking, but can’t be combined with other style methods Add the style information inline in the HTML document Embed Link Import Inline

Adding a style  A style tag is added inside the tags and includes the type attribute with a value of text/css as follows: <style type= " text/css " > tagattributevalue This is then followed by the Rules for the styles. The Rules cab be placed between Comment marks.

Adding a style (cont.) <!-- h1 { color:green; font-size:37px; font-family:Arial; } --> Comment tags allow Browsers that don’t support CSS to ignore the style sheet code altogether. Otherwise the style sheets code will display. <style type= " text/css " > </style>

Adding a style (cont.)  Rules A simple rule might be: h1 { color:green } This rule tells the Browser that all text surrounded by the tags should be displayed as green

Adding a style (cont.) Each rule consists of:  Selector  Declaration In the example, h1 is the selector – the HTML tag that the style is being attached to. Defines what the style actually is and consists of two parts: Property – in our example this is color and is separated from the value by a colon : Value – in our example this is green The Declaration is enclosed in braces { } Example h1 { color:green }

Adding a style (cont.) When a number of selectors share the same declaration, they can be grouped in one rule. Each selector is separated from the next with a comma h1, p, blockquote { font-family:Arial }

Style Inheritance Style sheet rules are inherited from Parent to Child: b { color:blue } In the above example the italic text will inherit the blue of the bold text because the italic tags are nested within the bold tags: Testing Style Tags

Classes Any HTML tag can serve as a selector. You can also create different classes. The following example uses three classes for Heading 1: <style type= " text/css " > <!-- h1.first {color:red} h1.second {color:orange} h1.third {color:yellow} --> Always place a full-stop before the class

Classes To use these defined class styles within a document: <h1 class="first">Your heading

Styles to be used for class exercises: Selectors: h1 h2 a:visited a:link a:active Declaration Properties: font-weight: font-family: font-size: color: text-align: background-color: Examples of values: bold, bolder, light monospace, sans-serif 22pt, 20px #9933CC, yellow center, right #9933CC, yellow New Tag this is the text New Tag this is the text

CSS Summary  Style sheets allow you to control the appearance of HTML pages, individually or many pages at a time  Style sheets allow you to modify data beyond the normal defaults of HTML tags and attributes  Style tags are placed between tags  Styles are enclosed within comments so that browsers which can’t display them, ignore them  Style Rule components are: Declaration {property:value} Selector