Controlling Page Style: Cascading Style Sheets (CSS) References: 1.Wang, P.S & Katila, S. (2004). A Introduction to Web Design and Programming. CA: Thomson.

Slides:



Advertisements
Similar presentations
Cascading Style Sheets (CSS). Cascading Style Sheets With the explosive growth of the World Wide Web, designers and programmers quickly explored and reached.
Advertisements

CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
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.
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.
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.
กระบวนวิชา 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.
Beginning Web Site Creation: Dreamweaver CS4. XHTMLCSS  Describes the structure  Content  Collection of styles  Formatting body { background-color:
Prepared by ackoo Styli n g your page (font type, font size, colors, text decoration, alignment, set margin, table padding, etc.) References: W3Schools.
SM5312 week 6: basic CSS syntax1 An Introduction to Cascading Style Sheets Basic CSS Syntax Nick Foxall.
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.
CSSMR.Mostafa badr1. Lesson 3 Creating an Style Sheet Lesson 2 Structure of the Style Lesson 1: What Cascading Style Sheets are?
1 Web Developer Foundations: Using XHTML Chapter 9 Cascading Style Sheet Concepts.
Cascading Style Sheets (CSS) Instructor: Mr. Ahmed Al Astal ITGD4104 Department Requirement for senior student University of Palestine Faculty of IT.
Cascading Style Sheets Example
Cascading Style Sheets Part 1 Library and Information Services, University of St Andrews.
CSS Dvijesh Bhatt.
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.
HTML - Quiz #2 Attendance CODE:
CSS Cascading Style Sheets By Garrett Garman. CSS Why use Style Sheets? Separates Appearance and Structure Modularity Quick and Easy changes Flexibility.
1 What is CSS?  CSS stands for Cascading Style Sheets  Styles define how to display HTML elements  Styles are normally stored in Style Sheets  Styles.
Cascading Style Sheets by Pavlovic Nenad by. Presentation Contents  What is CSS?  Why CSS?  Types of Style Sheets  Style Sheets Syntax  Box Formatting.
HTML, Third Edition--Illustrated Introductory 1 HTML, Third Edition Illustrated Introductory Unit E Formatting with Cascading Style Sheets.
ITCS373: Internet Technology Week 3: Introduction to CSS Dr. Faisal Al-Qaed.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
Working with Cascading Style Sheets (CSS) Module 2: HTML Basics LESSON 5.
CO1552 – Web Application Development Cascading Style Sheets.
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.
CSS Basic (cascading style sheets)
Introduction to Programming the WWW I CMSC Winter 2003 Lecture 7.
Cascade Style Sheet Introduction. What is CSS?  CSS stands for Cascading Style Sheets  Styles define how to display HTML elements  Styles were added.
Cascading Style Sheets Part 1. CSS vs HTML HTML: Originally intended to markup structure of a document (,...,,,,,...) CSS Developing technology, CSS1,
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Tutorial 7.
Css. Definition Cascading style sheet (CSS)  It is a simple mechanism for adding style (e.g. fonts, colors, spacing) to Web documents.
HTML - Quiz #2 Attendance CODE:
Web Design and Development for Business Lecture 4 Cascading Style Sheet (CSS)
CSS Tutorial 1 Introduction Syntax How to use style specifications. Styles.
Cascading Style Sheets Robin Burke ECT 270. Outline Midterm The Layout Debate CSS properties Fonts Alignment Color CSS selection selectors pseudo-classes.
ECA225 Applied Interactive Programming Cascading Style Sheets, pt 1 ECA 225 Applied Online Programming.
The Web Wizard’s Guide To DHTML and CSS Chapter 1 A Review of CSS1.
DIV, Span, CSS.
Cascading Style Sheets Creating a Uniform Site. Style Sheets  Style sheets are used for conformity on a web page or web site.  Style sheets eliminate.
Cascading Style Sheets
Cascading Style Sheets CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
CSS Cascading Style Sheets. Cascading Style Sheet (CSS) A cascading style sheet (CSS) is a set of rules that define styles to be applied to entire Web.
Cascading Style Sheets (CSS). A style sheet is a document which describes the presentation semantics of a document written in a mark-up language such.
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.
Web Technologies Beginning Cascading Style Sheets (CSS) 1Copyright © Texas Education Agency, All rights reserved.
Designing Web Pages The case for CSS. The Power of CSS css Zen Garden
How to… Cascading Style Sheets. How to Insert a Style Sheet When a browser reads a style sheet, it will format the document according to it. There are.
1 CSS محمد احمدی نیا 2 Of 21 What is CSS?  CSS stands for Cascading Style Sheets  Styles define how to display HTML elements 
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
NASRULLAHIBA.  It is time to take your web designing skills to the next level with Cascading Style Sheets (CSS). They are a way to control the look and.
Company LOGO In the Name of Allah,The Most Gracious, The Most Merciful King Khalid University College of Computer and Information System Web pages Development.
ECA 228 Internet/Intranet Design I Cascading Style Sheets.
CASCADING STYLE SHEET 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.
Cascading Style Sheets Using HTML. What are they? A set of style rules that tell the web browser how to present a web page or document. In earlier versions.
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.
1 Cascading Style Sheets
Cascading Style Sheet.
4.01 Cascading Style Sheets
Introduction to web design discussing which languages is used for website designing
CASCADING STYLE SHEET CSS.
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Website Design 3
What are Cascading Stylesheets (CSS)?
4.01 Cascading Style Sheets
Presentation transcript:

Controlling Page Style: Cascading Style Sheets (CSS) References: 1.Wang, P.S & Katila, S. (2004). A Introduction to Web Design and Programming. CA: Thomson Brooks/Cole. 2.W3Schools ( Prepared by ackoo

The two important aspects of xhtml web page:- A web page = XHTMLCSS +

The two important aspects of xhtml web page:- For document structure, e.g. …, …, …, etc. A web page = XHTMLCSS + For presentation style, e.g. font- size, font-family, body color, border, background, etc.

About CSS:- CSS To determine the Presentation style of the following: 1.The display styles in browser (mostly used.) 2.The print formats to printers 3.The device-dependent styles such as for aural browser.

About CSS: (Do this example in class) Take a look at these CSS codes for formatting the heading elements: h1 {font-size: large; color:#000099} h2 {font-size: medium; color:#000099} h3 {font-size: small; color:#000099} Save this as myfile.css (in notepad, etc), and then …. How to attach these codes to the web document? [Guess how?]

About CSS:- (Do this example in class) CSS code: h1 {font-size: large; color:#000099} h2 {font-size: medium; color:#000099} h3 {font-size: small; color:#000099} myfile.css Very simple, just put a link to “myfile.css” in your web document, inside the element, like this:

About CSS:- (General SYNTAX) CSS code has two important parts: 1)Selector(s) e.g. h1, h2, body, a:link, td.try1, td.try2 2)Style declaration(s) property : value e.g. font-size : small color : # padding-left:1.5cm In all, the general syntax for style rule is like this: selector {property1 : value1 property2 : value2 … }

About CSS:- (General SYNTAX) CSS code has two important parts: 1)Selector(s) e.g. h1, h2, body, a:link, td.try1, td.try2 2)Style declaration(s) property : value e.g. font-size : small color : # padding-left:1.5cm In all, the general syntax for style rule is like this: selector(s) {property1 : value1; property2 : value2; … } For e.g: h1 {font-size: large; color:#009} h2, h3, h4 {color : #009} td.try1 {padding : 2cm} a:link {color : red}

About CSS:- (General SYNTAX) In all, the general syntax for style rule is like this: selector(s) {property1 : value1; property2 : value2; … } For e.g: h1 {font-size: large; color:#009} h2, h3, h4 {color : #009} td.try1 {padding : 2cm} Img.noborder1 {border:none} a:link {color : red} #mileageChart {font-family: Courier} Notice that the selector can have more than just HTML elements. The common type of selectors are: 1)Element Selector (HTML elements) 2)Class selector, write like this tagName.className 3)Pseudoclass selectors. Most widely used for creating hyperlink. 4)Id selector 5)Selectors can be grouped in order to share the same attributes and value.

About CSS:- (Do this example in class) An example of defining hyperlink styles: a:link {color: #00c;} /* shaded blue (ie #0000cc) for unvisited links */ a:visited {color : #300; } /*dark red for visited links */ a:active /* when link is clicked */ { background-image: none; color: #00c; /* keeps the same color */ font-weight: bold; /*but turns font bold */ } a:hover /* when mouse is over link */ { background-color : #def; /*turn background gray-blue */ background-image:none; } selector(s) {property1 : value1 property2 : value2 … }

About attaching CSS to Web Document CSS or style sheet can be applied to a web page through the following THREE approaches / methods: 1.External Style Sheet CSS file(s) externally link to web document (this is mentioned earlier) 2. Internal Style Sheet Internally in web document, placed it inside the element. 3. Inline Styles Internally in web document through the style attribute. Used with Style attribute. For further description, please READ THIS:

About attaching CSS to Web Document 1.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 one file. Each page must link to the style sheet using the tag. The tag goes inside the head section. For further description, please READ THIS: An example of applying external style sheet: The browser will read the style definitions (for example font styles, paragraph styles, etc) from the file mystyle.css, and format the document according to it.

About attaching CSS to Web Document 2. 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 by using the tag. For further description, please READ THIS: An example of applying Internal Style Sheet (try it now) body {background-image: url("images/back40.gif")} p {font-family: Arial, Helvetica, sans-serif; font-size: medium} The browser will now read the style definitions, and format the document according to it.

About attaching CSS to Web Document 3. Inline style An inline style loses many of the advantages of style sheets by mixing content with presentation. Use this method sparingly, such as when a style is to be applied to a single occurrence of an element. To use inline styles you use the style attribute in the relevant tag. The style attribute can contain any CSS property. For further description, please READ THIS: An example of applying Inline Style (try it now) This is a paragraph. This is a paragraph.

About attaching CSS to Web Document For further description, please READ THIS: If these three approaches were used simultaneously for my web documents, which approach has the highest priority to take effect ? The answer is…