Cascading Style Sheets CSS by Pavlovic Nenad by. 2Cascading Style Sheets Presentation Contents What are CSS? What are CSS? History of CSS History of CSS.

Slides:



Advertisements
Similar presentations
CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
Advertisements

Cascading Style Sheets
Cascading Style Sheets (CSS) “Styles” for short. Pg. 418.
Today CSS HTML A project.
CSS CSS Precise Aesthetic Control. Cascading Style Sheets Though they can be put in HTML header, usually a separate page that the HTML links to Contains.
CHAPTER 8 ADVANCED CSS. LEARNING OBJECTIVES Assign formatting styles to a CSS class definition Use a tag’s class attribute to apply the styles defined.
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.
Introduction to Cascading Style Sheets (CSS) Module 2: HTML Basics LESSON 4.
Cascading Style Sheets Scripting with Style. CSS versus HTML  Ways to format in HTML –HTML Tag extensions –Converting Text to images –Page Layout with.
CSS Basics LIS Webteam April 8, Why CSS? What’s wrong with HTML? Structure vs Style Early web design used hacks to style webpages with HTML – like.
XP 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
Controlling Page Style: Cascading Style Sheets (CSS) References: 1.Wang, P.S & Katila, S. (2004). A Introduction to Web Design and Programming. CA: Thomson.
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,
Working with Cascading Style Sheets. 2 Objectives Introducing Cascading Style Sheets Using Inline Styles Using Embedded Styles Using an External Style.
 Missing (or duplicate) semicolons can make the browser completely ignore the style rule.  You may add extra spaces between the properties/values to.
CSS: Cascading Style Sheets. 2 History HTML tags were originally designed to define the content of a document. The layout of the document was supposed.
Principles of Web Design 6 th Edition Chapter 4 – Cascading Style Sheets.
Working with Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of a document.
1 Web Developer Foundations: Using XHTML Chapter 9 Cascading Style Sheet Concepts.
Chapter 11 Cascading Style Sheets: Part I The Web Warrior Guide to Web Design Technologies.
Cascading Style Sheets Dreamweaver. Styles Determine how the HTML code will display Determine how the HTML code will display Gives designers much more.
XP Tutorial 7New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks.
Cascading style sheets (CSS)
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
CSS Cascading Style Sheets By Garrett Garman. CSS Why use Style Sheets? Separates Appearance and Structure Modularity Quick and Easy changes Flexibility.
Using Styles and Style Sheets for Design
Cascading Style Sheets CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
Cascading Style Sheets. Defines the presentation of one or more web pages Similar to a template Can control the appearance of an entire web site giving.
Today’s objectives  Presentational | Inline | Block | Validate  CSS | Rules | Declarations.
Cascading Style Sheets Class 1, Lecture 1 Rachel A Ober
Cascading Style Sheets by Pavlovic Nenad by. Presentation Contents  What is CSS?  Why CSS?  Types of Style Sheets  Style Sheets Syntax  Box Formatting.
ITCS373: Internet Technology Week 3: Introduction to CSS Dr. Faisal Al-Qaed.
XP Dreamweaver 8.0 Tutorial 3 1 Adding Text and Formatting Text with CSS Styles.
Today’s objectives  Review  CSS | Rules | Declarations  HTML Structure document  Class asignment.
Cascading Style Sheets Orientation Learning Web Design: Chapter 11.
CO1552 – Web Application Development Cascading Style Sheets.
Introduction to Programming the WWW I CMSC Winter 2003 Lecture 7.
Cascading Style Sheets Part 1. CSS vs HTML HTML: Originally intended to markup structure of a document (,...,,,,,...) CSS Developing technology, CSS1,
Cascading Style Sheets Dreamweaver. Styles Determine how the HTML code will display Determine how the HTML code will display Gives designers much more.
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.
Chapter 6 Introducing Cascading Style Sheets Principles of Web Design, 4 th Edition.
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.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
Cascading Style Sheets CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
Tutorial 3 Adding and Formatting Text with CSS Styles.
Cascading Style Sheets CSS. Source W3Schools
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.
HTML with Style!. What is a Style Sheet? CSS? Style Sheet CSSCascading Style Sheets A “language” for defining style rules. Rules that tell the browser.
CNIT 132 – Week 4 Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of.
Cascading Style Sheets
Are You Smarter Than a 5 th Grader? 1,000,000 5th Grade HTML 5th Grade Syntax 4th Grade HTML 4th Grade Syntax 3rd Grade HTML 3rd Grade Syntax 2nd Grade.
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.
CSS: Cascading Style Sheets Part II. Style Syntax.
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.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
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.
Working with Cascading Style Sheets
CSS: Cascading Style Sheets
Cascading Style Sheets
Web Developer & Design Foundations with XHTML
Cascading Style Sheets
Cascading Style Sheets
HTML / CSS Mai Moustafa Senior Web Designer eSpace eSpace.
Cascading Style Sheets III B. Com (Paper - VI) & III B
Presentation transcript:

Cascading Style Sheets CSS by Pavlovic Nenad by

2Cascading Style Sheets Presentation Contents What are CSS? What are CSS? History of CSS History of CSS Why CSS? Why CSS? Types of Style Sheets Types of Style Sheets Style Sheets Syntax Style Sheets Syntax Cascading Model Cascading Model Box Formatting Model Box Formatting Model CSS Syntax CSS Syntax Inheritance Inheritance Classes, Pseudo Classes & IDs Classes, Pseudo Classes & IDs Groups of elements (DIV & SPAN) Groups of elements (DIV & SPAN) Benefits Benefits Disadvantages Disadvantages Conclusion Conclusion

3Cascading Style Sheets What are CSS? Cascading Style Sheets are formatting information that is applied to HTML. Cascading Style Sheets are formatting information that is applied to HTML. Cascading Style Sheets enable a Web site's presentation (design) to be separated from its content and structure. Cascading Style Sheets enable a Web site's presentation (design) to be separated from its content and structure. Using the CSS every existing HTML tag (element) can be formatted as we desire. Using the CSS every existing HTML tag (element) can be formatted as we desire.

4Cascading Style Sheets History First version of CSS (CSS1) is forged by W3C (World Wide Web Consortium) in First version of CSS (CSS1) is forged by W3C (World Wide Web Consortium) in It was partially supported by Browsers. It was partially supported by Browsers. In 1998 CSS2 have been released. In 1998 CSS2 have been released. Fully supported by Browsers. Fully supported by Browsers.

5Cascading Style Sheets Types of Style Sheets Style sheets can be delivered to an HTML in three ways: Style sheets can be delivered to an HTML in three ways: Inline (add a style to an element): Text Text Embedded (add a style to specific page): <HEAD><STYLE> P { font: 13pt verdana; } </STYLE></HEAD> Linked (add an external style definition): <HEAD> </HEAD>

6Cascading Style Sheets Cascading Model

7Cascading Style Sheets Box Formatting Model Element Padding Border Margin 4 th 1 st 2 nd 3 rd

8Cascading Style Sheets Style Sheet Syntax Whatever method we use to deliver style to HTML (inline, embedded or linked), the syntax will going to be similar in all cases. Whatever method we use to deliver style to HTML (inline, embedded or linked), the syntax will going to be similar in all cases. CSS syntax contains of three parts: CSS syntax contains of three parts: SELECTOR | PROPERTY | VALUE BODY { color: yellow; } BODY { color: yellow; }

9Cascading Style Sheets Selectors are usually standard HTML elements (H1, P, BODY, TABLE, etc.). Selectors are usually standard HTML elements (H1, P, BODY, TABLE, etc.). Properties are names of attributes that are used to describe an object (color, text, font- face, font-size, etc.). Properties are names of attributes that are used to describe an object (color, text, font- face, font-size, etc.). Values are “describing” properties(yellow, bold, fixed, Arial, etc.). Values are “describing” properties(yellow, bold, fixed, Arial, etc.).

10Cascading Style Sheets Classes, Pseudo Classes and IDs Classes are the instances of style definitions. Classes are the instances of style definitions. If we want to brake down our style rules into small very precise peaces, we will use classes. If we want to brake down our style rules into small very precise peaces, we will use classes. Everything that is not redefined in a class is inherited from the higher level class or element. Everything that is not redefined in a class is inherited from the higher level class or element. P.highlight { background-color: yellow; color: red; } P.highlight { background-color: yellow; color: red; }

11Cascading Style Sheets Pseudo-classes are predefined classes that already mean something to the browser. Pseudo-classes are predefined classes that already mean something to the browser. They can’t be defined by user, but user can apply values to them! They can’t be defined by user, but user can apply values to them! A:link A:visited {{ color: blue; color: red; color: blue; color: red; }}

12Cascading Style Sheets List of pseudo classes: List of pseudo classes::first-child :link (A) :visited (A) :hover (A) :active (A) :focus (A) :lang :first-line (P) :first-letter (P) :before:after

13Cascading Style Sheets IDs are groups of style definitions that can be applied to any HTML element (tag). IDs are groups of style definitions that can be applied to any HTML element (tag). If ID is applied to an element that is already defined in the style sheet, the definition will be overridden. If ID is applied to an element that is already defined in the style sheet, the definition will be overridden. IDs are defined as follows: IDs are defined as follows: #important { font-weight : bold; color : Yellow; }

14Cascading Style Sheets Advanced page look CSS gives us much more flexibility in layout designing. CSS gives us much more flexibility in layout designing. The advantage is that we can place “objects” (words, paragraphs, pictures, lines, etc.) exactly where we want on the page (positioning and Z- index). The advantage is that we can place “objects” (words, paragraphs, pictures, lines, etc.) exactly where we want on the page (positioning and Z- index). Also, we can group elements and then control them as a group. For this purpose DIV tag is used. Also, we can group elements and then control them as a group. For this purpose DIV tag is used. On the same way we can control parts of text which is “bounded” with SPAN tag. On the same way we can control parts of text which is “bounded” with SPAN tag.

15Cascading Style Sheets Groups of elements (DIV & SPAN) DIV provides means for grouping elements and assigning attributes to the group. It is nested within the BODY! DIV provides means for grouping elements and assigning attributes to the group. It is nested within the BODY! SPAN encloses text within generic inline element that you can define with style sheet. It is nested within any BLOCK element. SPAN encloses text within generic inline element that you can define with style sheet. It is nested within any BLOCK element.

16Cascading Style Sheets Z-index Z-index enables us to position elements in the third dimension (depth). Z-index enables us to position elements in the third dimension (depth). It orders the elements with the lower index on the top of elements with higher index. It orders the elements with the lower index on the top of elements with higher index. Z = 100 Z = 50 Z=70

17Cascading Style Sheets Benefits of Using CSS Separation of the document from the presentation. Separation of the document from the presentation. Easier coding and maintenance. Site control. Consistency (Uniformity). Consistency (Uniformity). All pages in the site looks the same. Rich design and layout. Rich design and layout. Avoidance of tag misuse. Avoidance of tag misuse. Solves speech synthesizer problems.

18Cascading Style Sheets Benefits of Using CSS (2) Avoidance of images misuse. Avoidance of images misuse. Increases download time ( a lot! ). Text on images is not searchable!!! CSS allow user to override authors style. CSS allow user to override authors style. Personalization of the page. Auto generated content. Auto generated content. First letter, numbered lists, before and after elements, etc…

19Cascading Style Sheets Benefits of Using CSS (3) Aural style. Aural style. Define how the text synthesizer will read the content. Accessibility. Accessibility. PC browsers, mobiles, PDAs, tty terminals, printers, TVs, users with disabilities, etc… No browser specific requirements, such as plug-ins.

20Cascading Style Sheets Compatibility Issue CSS1 was partially supported by browsers Internet Explorer 3, Internet Explorer 4, and Netscape Navigator 4.7. CSS2 is fully supported by all new versions of popular Web browsers like: Internet Explorer 6, Netscape 6, Opera 5, and Micro Browsers for Mobiles. If browser does not support CSS it will display page in HTML formatted form, ignoring the styles.

21Cascading Style Sheets Disadvantages The only disadvantage that can be assigned to CSS is non-compatibility with all internet browsers. Surveys says that today 85% of users are able to see pages that uses CSS, while the others are not.

22Cascading Style Sheets Conclusion As you can see, CSS can be useful for everyone, starting from Web designers to the ordinary users. The fact is that today’s Web Sites can not be imagined without CSS.

23Cascading Style Sheets Thank you for participating in the presentation Thank you for participating in the presentation For any further questions, you may contact me at