Cascading Style Sheets " Provide means to control and change presentation of HTML documents. " Allow the user to impose a standard style. " Three levels.

Slides:



Advertisements
Similar presentations
Chapter 3 © 2003 by Addison-Wesley, Inc Introduction - HTML is primarily concerned with content, rather than style - However, tags have presentation.
Advertisements

Part 3 Introduction to CSS. CSS Text Text Styles h1 {color: green} // rgb(0,255,0), #00ff00 h2{letter-spacing: 0.5cm} // 2px h3 {text-align: right} //
Dr. Ahmet Cengizhan Dirican BIL 374 Internet Technologies 3. CSS.
Stylin’ with CSS. 2 Topics What is CSS? Why CSS? CSS Examples.
CS4370/6370 Web Development Cascading Style Sheets (CSS)
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 SP.772 May 6, CSS Useful for creating one unified look for an entire web site. Helps to seperate style from content. Can.
Web Design & Development Cascading Style Sheets (CSS)
CS134 Web Design & Development Cascading Style Sheets (CSS) Mehmud Abliz.
Cascading Style Sheet (CSS) Instructor: Dr. Fang (Daisy) Tang
Cascading style sheets - CSS
COS 381 DAY 3. © 2006 Pearson Addison-Wesley. All rights reserved. 3-2 Agenda Questions? Assignment 1 due January 31 Discussions on CSS –
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
Lecture 7 Cascading Style Sheets (CSS) Boriana Koleva Room: C54
3.1 Cascading Style Sheets. Motto Fashions fade, style is eternal. —Yves Saint Laurent.
Stylin’ with CSS. 2 Topics What is CSS? Why CSS? CSS Examples.
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).
TECH2018 Multimedia and the Internet More about CSS and Page Layouts.
CP476 Internet Computing Lecture 7 HTML & CSS 1 HTML HyperText Markup Language (HTML) is an application of Standard Generalized Markup Language (SGML)
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
Tutorial #3 Cascading Style Sheets. Review: Last Class Image sizing Pathnames Project Default Path Relative Path Absolute Path Blackboard Homework Submission.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3 Cascading Style Sheets.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3 Cascading Style Sheets.
INTRODUCTION TO HTML5 Styling Text. Change the Font Size  You can use the font-size property to change the font size for a document’s text.  Instead.
Chapter 3 Cascading Style Sheets Introduction  The CSS1 specification was developed in 1996  CSS2 was released in 1998  CSS3 is on its way 
Chapter 3 © 2012 by Addison Wesley Longman, Inc Introduction - The CSS1 specification was developed in CSS2 was released in CSS2.1.
Chapter 3 © 2010 by Addison Wesley Longman, Inc Introduction - The CSS1 specification was developed in CSS2 was released in CSS3 is.
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.
CSS – Cascading Style Sheets Fred Durao
ITCS373: Internet Technology Week 3: Introduction to CSS Dr. Faisal Al-Qaed.
Cascading Style Sheet(CSS). Introduction The CSS 1 specification was developed in 1996 CSS 2 was released in 1998 CSS 3 is on its way CSSs provide the.
Using Cascading Style Sheet As you create more web pages, you may wish to impose a consistent look for all of your web pages or for group of related pages.
Cascading Style Sheets (CSS) ICS213, 1 / 2011 Dr. Seung Hwan Kang.
Chapter 3 © 2005 by Addison Wesley Longman, Inc Introduction - The CSS1 specification was developed in CSS2 was released in CSS3 is.
Chapter 3 Cascading Style Sheets. © 2006 Pearson Addison-Wesley. All rights reserved Introduction - The CSS1 specification was developed in 1996.
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 #3 Cascading Style Sheets. Tutorial #2 Review - Anchors Links to Site DMACC Internal Links Go to Top Mail To me Local.
Cascading Style Sheets Class 2, Lecture 2 Rachel A Ober
Stylin’ with CSS Monday October 8 th and Tuesday October 9 th.
CSS Cascading Style Sheets. CSS Advantages Greater typography and page layout control Style is separate from structure Styles can be stored in a separate.
Creating Your Own Webpage COSC Cascading Stylesheets Think of: HTML: content of your webpage HTML has tags CSS: presentation and appearance of your.
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.
5 th ed: Chapter 4 4 th ed: Chapter 5 SY306 Web and Databases for Cyber Operations Slide Set #4: CSS.
CSS for Styling CS The good, the bad and the… ugly!  Tags such as b, i, u, and font are discouraged in strict XHTML  Why is this bad? CS380 2.
Web Design (14) CSS Formatting Text. Formatting Text In Brackets, go to your ‘externalcss’ website and find the ‘formattingtext’ page. Use the ‘main’
Chapter 3 Cascading Style Sheets. © 2006 Pearson Addison-Wesley. All rights reserved Introduction - The CSS1 specification was developed in 1996.
CSS: Cascading Style Sheets Part II. Style Syntax.
CSS Cascading Style Sheets *referenced from
Font-Family, Color and Background. Basics  CSS rule: Selector (multiple separated by, ) Declaration (multiple separated by ; ) Example: p { color: red;
Chapter 11 & 12 CSS Style Sheets: Intro. Why CSS? Separate presentation from content – more accessible Less work – can change appearance of whole site.
Blended HTML and CSS Fundamentals 3 rd EDITION Tutorial 3 Introducing Cascading Style Sheets.
CSS Details Cascading Style Sheets. Lesson Overview  In this lesson, you will learn:  To use CSS properties for fonts  Evaluate whether to use pts,
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.
CONFIGURING COLOR AND TEXT WITH CSS Chapter 3. Cascading Style Sheets (CSS) Used to configure text, color, and page layout. Launched in 1996 Developed.
3.1 Introduction - HTML is primarily concerned with content, rather
HTML WITH CSS.
HTML WITH CSS.
Creating Your Own Webpage
3.1 Introduction - The CSS1 specification was developed in 1996
CHAPTER 4 CASCADING STYLE SHEETS (CSS)
3.5 Property Value Forms - There are 60 different properties in 7 categories: - Fonts - Lists - Alignment of text - Margins - Colors - Backgrounds - Borders.
3.1 Introduction - The CSS1 specification was developed in 1996
CSS Style Sheets: Intro
Stylin’ with CSS.
3.1 Introduction - The CSS1 specification was developed in 1996
Stylin’ with CSS.
Stylin’ with CSS.
Cascading Style Sheets
Presentation transcript:

Cascading Style Sheets " Provide means to control and change presentation of HTML documents. " Allow the user to impose a standard style. " Three levels of specification: – Inline level -- embeded in tag invocation. – Document level -- applied to a whole document. – External level -- Apply to a number of documents. " Inline level has precedence over document level, which has precedence over external level.

Cascading Style Sheets " HTML primarily concerned with content rather than style. " HTML tags have presentation properties for which browsers have default values. " Cascading Style Sheets are not technically HTML, but can be embedded in HTML documents.

Cascading Style Sheets " Cascading Style Sheet specification developed in > CSS1 " CSS2 followed in " Current browsers do not implement all of CSS2. " Style is specified for a tag by the values of its presentation properties. " Browsers can ignore style sheets or use their own default values for presentation properties.

Level of Style Sheets " Inline style sheets appear in the tag itself. " Document level style sheets appear within the head of the document. " External style sheets are in separate files, potentially on any server on the internet. " Format depends on the level of the style sheet

Inline Style Specification Format " Style sheets appears as the value of the style attribute – style ="property_1:value_1; property_2: value-2;... property_n: value-n;” – Scope of inline style sheet is the content of the tag.

Document Style Specification Format " List of rules that are the content of the tag. " The type attribute of the tag must be set to "text/css" " The list of rules are not HTML. – Hence, they must be placed in an HTML comment. " Documentation comments for the rule must use a different form -- use C comments: /*... */ External style sheets format is a list as in document style

External Style Sheets " Written with the MIME type text/css – A tag is used to specify that the browser is to fetch and use external style sheet file: – " Can be validated /validator-upload.html

Style Classes " Style classes allow different occurrences of the same tag to use different style specifications " A style class has a name attached to a tag name: p.narrow (property:value list) p.wide (property:value list) " A class on an occurrence of a tag is specified with its class attribute...

Generic Style Classes " To apply style to more than one tag " Defined using a generic tag (which must have a name beginning with a period).really-big(... ) " It is used as if it were a normal style class...

Properties/Property Values " There are 56 different properties in 6 categories – Fonts – Colors & backgrounds – Text – Boxes and Layouts – Lists – Tags " Will not discuss all. For more details go to:

Property Value Format " Keywords: left, small,... (Not case sensitive) " Length: numbers (may be with decimal points)  px -pixels  in -inches  cm -centimiters,  pt -points  pc -picas (12 points)  em -height of the letter " m "  x-height -height of the letter "x" – No space is allowed between number and unit specs.

Property Value Format Font Properties <!-- /* Document-level style sheet*/ p.big {font-size: 14pt; font-style: italic; font-family: 'Times New Roman'; } p.small {font-size: 10pt; font-weight: bold; font-family: 'Courier New'; } -->

Property Value Format If a job is worth doing, it ’ s worth doing right. Two wrongs don't make a right, but they certainly can get you in a lot of trouble. <h2 style = "font-family: 'Times New Roman'; font-size: 24pt; font-weight: bold"> Chapter 1 Introduction <h3 style = "font-family: 'Courier New'; font-size: 18pt"> 1.1 The Basics of Computer Networks

Property Value Format (cont) " Percentage -just a number followed by the percent sign  URL value: url(protocol://server/pathname) " Color – Color name  rgb(n1, n2, n3)  Hex form: #XXXXXX " Property values inhereted by nested tags unless overridden

Font Properties  Font-family list of font names (browser picks 1 st )  Font-family: Arial, Helvetica, Courrier  Generic fonts: serif, sans-serif, cursive, fantasy, and monospace (defined in CSS) – If font name has more than one word, single-quoted  Font-size lenght number of a name  Font-style: italic, normal  Font-weight: bolder, lighter, bold, normal

Font Properties Font used to specify list of font properties order must be: style, weight, size, name(s) font: bolder 14pt Arial Helvetica

Font Properties Font Properties <!-- /* Document-level style sheet*/ p.big {font-size: 14pt; font-style: italic; font-family: 'Times New Roman'; } p.small {font-size: 10pt; font-weight: bold; font-family: 'Courier New'; } -->

Font Properties If a job is worth doing, it ’ s worth doing right. Two wrongs don't make a right, but they certainly can get you in a lot of trouble. <h2 style = "font-family: 'Times New Roman'; font-size: 24pt; font-weight: bold"> Chapter 1 Introduction <h3 style = "font-family: 'Courier New'; font-size: 18pt"> 1.1 The Basics of Parallel Programming

Colors & backgrounds " Complications: – Monitors vary widely – Browser vary widely " There are three color collections: – Set of 16 colors garanteed to be dispalyable by all graphical browsers on all color monitors – The web palette of 216 colors – One of 16 million different colors

Garanteed set of 16 colors:  Black  Silver C0C0C0  Gray  White FFFFFF  Marron  Red FF0000  Purple  Fuchia FF00FF  Green  Lime 00FF00  Olive  Yellow FFFF00  Navy  Blue 0000FF  Teal  Aqua 00FFFF

The web palette " Consist of 216 colors " Use hex color value of: (look on back of book)  00  33  66  99  CC  FF

Colors & backgrounds " The color property specifies forground of color elements Apple " The background-color property specifies the backgound color elements <p style="font-size:24; color:blue; background-color:aqua"> To make it softer, use aqua background!

Colors & backgrounds " The background-image property use with care

Alignment of Text " Property text-indent allows indentation. Use length of % " Property text-align has possible values: left (default), center, right, or justify " Property float allows text to flow arround another element: left, right, or none (default) An element on the right with text flowing on its left can be obtained with default text-align value (left) for the text and right value for float on the element on the right.

Alignment of Text " Property margin-left allows to set margins arround an object.

Lists properties Unordered list: " List-style-type – Bullets can be: disk (default), square, circle – Setting it on the tag applies to all items:... – Setting it on the it applies to just that item: First item second item

Lists properties Unordered list: " List-style-image:  Could use an image for bullets in an unordered list <li style = "List-style-image: url(bigbird.gif)">

Lists properties Ordered list: " List-style-type: – Use to change the sequence values: Property valueSequence typeFirst four decimal Arabic numerals 1, 2, 3, 4 upper-alpha Uc letters A, B, C, D lower-alpha Lc letters a, b, c, d upper-roman Uc Roman I, II, III, IV lower-romanLc Romani, ii, iii, iv

The Tag " Used to define an element in the content of a larger element " The default is to leave content as it is " Use to apply an inline style sheet to its content Now is the most opportune time! " Can be nested and can have id and class attributes

The Tag " Usefull for style applications " Used to create sections (or divisions) for which style can be specified – e.g. A section of four paragraphs for wich a particular style is warranted.