1 Web Development CSS (Cascading Style Sheet). 2 1.Setting rules for multiple elements To decrease the amount of typing for setting rules for multiple.

Slides:



Advertisements
Similar presentations
Session Objectives Setting the font family Setting the font size Working with Web fonts Setting font faces and sizes Setting font and text appearances.
Advertisements

Stylin’ with CSS. 2 Topics What is CSS? Why CSS? CSS Examples.
Tutorial 4 Formatting Text. XP New Perspectives on Blended HTML, XHTML, and CSS2 Objectives Create a spread heading Indent text Change the line spacing.
CASCADING STYLE SHEETS CSS. 2 What CSS means?  CSS is an extension to basic HTML that allows you to style your web pages.  It separates the part that.
Week 7 Web Typography. 2 Understanding Type Design Principles.
INTRODUCTORY Tutorial 3 Using CSS to Format Multiple Pages.
Text Properties, Line Box, CSS. Text Properties Properties related to the display of text. Text-align : left, right, center I like FSU!
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: Cascading Style Sheets. What are Style Sheets A style sheet is a mechanism that allows to specify how HTML (/XHTML/XML) pages should look The style.
Using Cascading Style Sheets CSS Structure. Goals Understand how contextual, class and ID selectors work Understand how contextual, class and ID selectors.
Chapter 1 Introducing Cascading Style Sheets. Chapter 1 Topics History of HTML and CSS Browser support for CSS Importance of structure/style separation.
© 2007 D. J. Foreman CSS-1 Cascading Style Sheets Styles.
3.1 Cascading Style Sheets. Motto Fashions fade, style is eternal. —Yves Saint Laurent.
+ Text & Font Styles Unit 3 Lesson Different Font Categories Sans Serif – block style fonts Example - Rockwell Easy to read and good to use when.
Stylin’ with CSS. 2 Topics What is CSS? Why CSS? CSS Examples.
CSS The Definitive Guide Chapter 6.  Text is the content, and fonts are used to display that content. By using text properties you can affect the position.
Formatting Text (Plus More Selectors) Learning Web Design: Chapter 12.
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.
CSS1-1 Cascading Style Sheets (CSS) Xingquan (Hill) Zhu
HIGHER COMPUTING CSS. WHAT IS CSS? CSS: Cascaded Style Sheets used to separate a web site’s content(information) from its style(how it looks).
1 Working with Cascading Style Sheet (CSS). 2 Cascading Style Sheets (CSS)  a style defines the appearance of a document element. o E.g., font size,
Using Cascading Style Sheets. Introduction to Styles and Properties  Cascading Style Sheets (CSS) are a standard set by the World Wide Web Consortium.
Cascading Style Sheets Example
CSS Dvijesh Bhatt.
INTRODUCTION TO WEB DEVELOPMENT AND HTML Lecture 09: Cascade Style Sheets - Spring 2011.
Chapter 7 Web Typography Principles of Web Design, 4 th Edition.
Cascading Style Sheet (CSS)
Tutorial #3 Cascading Style Sheets. Review: Last Class Image sizing Pathnames Project Default Path Relative Path Absolute Path Blackboard Homework Submission.
Cascading Style Sheets, pt 2 ECA 225 Applied Online Programming.
New Perspectives on XML, 2nd Edition Tutorial 5 1 TUTORIAL 5 WORKING WITH CASCADING STYLE SHEETS.
XP New Perspectives on XML Tutorial 5 1 TUTORIAL 5 CSS Tutorial – Carey ISBN
WDV 101 Intro to Website Development
CSS: Cascading Style Sheets. 2 What are Style Sheets A style sheet is a mechanism that allows to specify how HTML (/XHTML/XML) pages should look The style.
Cascading Style Sheets by Pavlovic Nenad by. Presentation Contents  What is CSS?  Why CSS?  Types of Style Sheets  Style Sheets Syntax  Box Formatting.
Today’s objectives  Review  CSS | Rules | Declarations  HTML Structure document  Class asignment.
 A style sheet is a single page of formatting instructions that can control the appearance of many HTML pages at once.  If style sheets accomplished.
CSS My favourite ICT lesson By Federico Boschi Cascading Style Sheets.
Tutorial #4 Formatting Text and Links. Tutorial #3 Review - CSS CSS format Selector { property1: value1; /* Comments */ } Embedded, In-Line, and External.
CASCADING STYLE SHEETS. Chapter 3 Objectives Customize HTML elements Specify Font characteristics Classes Tag style Inline and block-level elements External.
Cascading Style Sheets Chapter Four. What are they? A set of style rules that tell the web browser how to present a web page or document. Cascading Style.
Tutorial 5 Formatting with CSS. Objectives Session 5.1 – Evaluate why CSS styles are used – Determine where to write styles – Create an element selector.
Tutorial #3 Cascading Style Sheets. Tutorial #2 Review - Anchors Links to Site DMACC Internal Links Go to Top Mail To me Local.
MySQL and PHP Review CSS. Cascading Style Sheet (CSS) Style sheets are files or forms that describe the layout and appearance of a document. Cascading.
Stylin’ with CSS Monday October 8 th and Tuesday October 9 th.
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.
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…
INTRODUCTORY Tutorial 3 Using CSS to Format Multiple Pages.
Cascading Style Sheets Eugenia Fernandez IUPUI. CSS Purpose CSS allow you to specify the style in which your XML elements are displayed. CSS were originally.
CS 174: Web Programming September 9 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
1 Working with Cascading Style Sheet (CSS). 2 Cascading Style Sheets (CSS)  a style defines the appearance of a document element. o E.g., font size,
Cascading Style Sheets Web Design Fairport High School.
5 th ed: Chapter 4 4 th ed: Chapter 5 SY306 Web and Databases for Cyber Operations Slide Set #4: CSS.
CSS properties Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 1.
Developing Web Applications with HTML and CSS “Selectors and Properties”
CSS: Cascading Style Sheets Part II. Style Syntax.
Creating Layouts with CSS. Span tag Here is some underlined text. Here is some blinking text. Here's some bold text.
ECA 228 Internet/Intranet Design I Cascading Style Sheets.
Tutorial 3 Designing a Web Page with CSS
ECA 228 Internet/Intranet Design I Cascading Style Sheets.
03 CSS (Cascading StyleSheet) Р.Жавхлан МОНГОЛ УЛСЫН ИХ СУРГУУЛЬ Мэдээллийн технологийн сургууль Интернэт технологийн үндэс 2015 Намар.
CSCE Chapter 3 (Cascading Style Sheets) CSCE General Applications Programming Benito Mendoza 1 By Benito Mendoza Department of Computer.
Chapter 11 & 12 CSS Style Sheets: Intro. Why CSS? Separate presentation from content – more accessible Less work – can change appearance of whole site.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
1 CS428 Web Engineering Lecture 07 Font, Text & Background (CSS - II)
CIS 4004: Web Based IT (CSS) Page 1 © Dr. Mark Llewellyn CIS 4004: Web Based Information Technology Fall 2012 Cascading Style Sheets (CSS) Department of.
Links All CSS properties can be applied on links (i.e. change colors, fonts, underline, etc). The new thing is that CSS allows you to define these properties.
Cascading Style Sheets Robin Burke ECT 270. Outline CSS properties Fonts Alignment Color CSS selection selectors.
CONFIGURING COLOR AND TEXT WITH CSS Chapter 3. Cascading Style Sheets (CSS) Used to configure text, color, and page layout. Launched in 1996 Developed.
Presentation transcript:

1 Web Development CSS (Cascading Style Sheet)

2 1.Setting rules for multiple elements To decrease the amount of typing for setting rules for multiple tags, it is possible to group them. Separate them with commas (,). h1, h2, h3 { background : yellow; color : black ;}

3 2. Id Rules Without inline styles, how particular style is applied to one occurrence of the element. This is done by applying id rules.

4 2. Id Rules cont. We can name particular tag with id attribute so that it can be accessed or made a destination for example by a link. Welcome to---- LINK Go To Heading1 Ids of different elements should be unique.

5 2. Id Rules cont. id of an element is used to refer it from a style rule. Example: RULE: #FirstHeading {backgroung-color :green;} IMPLEMENTATION:

6 3. Class Rules If we want to affect multiple elements, a class rule should be employed instead of id. Class attribute defines the name of the class, an element belongs to. They don’t need to be unique for all elements. Many elements can be member of same class.

7 3. Class Rules cont. Class Example paragraph contents…

8 Pseudo Classes A special pre-defined class grouping, called pseudo-classes is mainly used to deal with states of links. 1.a:link {color:blue; text-decoration:none;} 2.a:active {color:red;} 3.a:visited {color:purple;} 4.a:hover {color:red;}

9 Pseudo Elements These elements are used with common block level text elements such as to effect the first letter or first line of enclosed text. There are two pseudo-elements:  First-Letter  First-Line

10 Pseudo Elements cont. Example:

11 Contextual Selection Contextual selections are treated by showing the order in which element must be nested for the rule to be applied. Example: p strong { background-color : yellow;}  All occurrences of element within element must be yellow while others not necessarily have to be yellow.

12 Inheritance HTML documents have an implicit structure. title h1 b head html body p

13 Inheritance cont. Test File Test This is a Test

14 Inheritance cont. In the example element is enclosed within the element, which is in the, which is in the element. What happens if you set a style rule to the element like so? p {color : red;} Would the tag’s contents also be red? The answer is yes because the color is inherited from the parent element.

15 Inheritance cont. The general idea of the cascade, in effect, is that it provides a system to sort out which rules apply to a document that has many styles. A rule for a specific element using an id attribute is more powerful than a class rule applied to. A class rule applied to in turn is more powerful than a rule for element itself.

16 Inheritance cont. In the instance that a particular rule should never be overridden by another rule ‘!important’ indication should be used. p { color : red !important; font-size : 12pt;}

17 Font Properties font-family font-size  xx-small  x-small  small  medium  large  x-large  xx-large  %age  physical sizes

18 Font Properties cont. font-style  Normal  Italic  Oblique font-weight: sets the darkness of font. . Its value ranges from in increments of 100.  Keywords are also supported like;  normal  normal=400  bold  bold=700  light

19 Font Properties cont. font “provides a concise way to specify all the font properties with one style rule.“  Each font attribute can be indicated in the line separated by space except for line-height which is used with font-size and separated by a slash.  line-height specify the distance between two lines of text. p {font: italic 18pt/24pt;}

20 Font Properties cont.  All these must be in the same sequence as given below. We can also skip any one of them. ElementName {font : font-style font-varient font-weight fontsize/line-height font-family; }  We can also use list of families for font-family. p { font : italic “arial,helvitica” ;}

21 Text Properties text-transform  capitalize Capitalize words e.g. add  Add  uppercase e.g. add  ADD  lowercase e.g. Add  add  none is default value

22 Text Properties cont. text-decoration  line-through e.g. Example  overline e.g. Example  underline e.g. Example  none

23 Text Properties cont. word-spacing letter-spacing vertical-align controls the positioning of text and images with respect to the baseline currently in effect.  Baseline it is default value  Super  Text-top

24 Text Properties cont.  Bottom  Sub  Top  Middle  Text-bottom  %age values

25 Text Properties cont. text-align  justify  center  right text-indent line-height

26 Text Properties cont. white-space  normal collapses extra spaces.  pre same effect as tag  nowrap will not wrap the text if exceed context width.