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.

Slides:



Advertisements
Similar presentations
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} //
Advertisements

Cascading Style Sheets (Formatting. Slide 2 Lecture Overview At this point, you have learned how and where to create styles You have not learned much.
CS4370/6370 Web Development Cascading Style Sheets (CSS)
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.
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.
Tutorial 3 Working with Cascading Style Sheets. XP Objectives Review the history and concepts of CSS Explore inline styles, embedded styles, and external.
Using Cascading Style Sheets CSS Basics. Goals Understand basic syntax of Cascading Style Sheets (CSS) Understand basic syntax of Cascading Style Sheets.
Workshop: CSS-Part I Cascading Style Sheets add style to your HTML web pages.
Using Cascading Style Sheets CSS Structure. Goals Understand how contextual, class and ID selectors work Understand how contextual, class and ID selectors.
More HTML Chapter 4. 2 Nesting Tags How do you write the following in HTML? The wrong way: This is really, REALLY fun ! Tags must be correctly nested.
3.1 Cascading Style Sheets. Motto Fashions fade, style is eternal. —Yves Saint Laurent.
Selectors thru Borders. CSS – Cascading Style Sheets – is a way to style HTML HTML is the content base of a web page CSS provides the presentation qualities.
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 (CSS)
Chapter 7 Web Typography Principles of Web Design, 4 th Edition.
1.NET Web Forms CSS: Style Sheets © 2002 by Jerry Post.
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 CSS. CSS - Structure Declaration block Property: identifies what to change Value: how to change it Selector – example h1{ font-size:
WORKING WITH CASCADING
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
Today’s objectives  Presentational | Inline | Block | Validate  CSS | Rules | Declarations.
1 Cascading Style Sheets (CSS) Part 2. 2 The Sources of 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 12 Cascading Style Sheets: Part II The Web Warrior Guide to Web Design Technologies.
Tutorial 3 Working with Cascading Style Sheets (CSS)
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
 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.
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.
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.
 2008 Pearson Education, Inc. All rights reserved Cascading Style Sheets™ (CSS)
Cascading Style Sheets Robin Burke ECT 270. Outline Midterm The Layout Debate CSS properties Fonts Alignment Color CSS selection selectors pseudo-classes.
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 (CSS) ◦ Used to specify the presentation of elements separately from the structure of the document.  Inline style ◦ declare.
XP Review 2 New Perspectives on JavaScript, Comprehensive1 Introducing Cascading Style Sheets Formatting Web Pages with CSS.
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.
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,
Copyright © 2006, Jumail, FSKSM, UTM Slide 1 Cascading Style Sheets (CSS)
CIS234A Lecture 5 Instructor Greg D’Andrea. Font Styles Review Font-Family: generic family, font family Font-Size: em, pt, px, %, mm, cm, in Font-Style:
©SoftMoore ConsultingSlide 1 Introduction to HTML: Cascading Style Sheets.
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.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
Web Design (14) CSS Formatting Text. Formatting Text In Brackets, go to your ‘externalcss’ website and find the ‘formattingtext’ page. Use the ‘main’
CSS: Cascading Style Sheets Part II. Style Syntax.
CSS Cascading Style Sheets *referenced from
Basic Webpage Design Cascading Style Sheet (CSS).
Font-Family, Color and Background. Basics  CSS rule: Selector (multiple separated by, ) Declaration (multiple separated by ; ) Example: p { color: red;
03 CSS (Cascading StyleSheet) Р.Жавхлан МОНГОЛ УЛСЫН ИХ СУРГУУЛЬ Мэдээллийн технологийн сургууль Интернэт технологийн үндэс 2015 Намар.
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.
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.
CSS Layouts CH 13.
Creating Your Own Webpage
CSS Rule Selector Declaration Block Value Attribute Name body {
Cascading Style Sheets
Cascading Style Sheets
Cascading Style Sheets™ (CSS)
Presentation transcript:

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 designed for use with HTML, but work for XML as well. Supports the separation of structure from presentation.

CSS Versions CSS1 Adopted by W3C in December 1996 CSS2 Became a W3C Recommendation in May 1998 Adds support for media-specific style sheets (e.g. printers and aural devices), downloadable fonts, element positioning and tables. CSS3 Currently under development

Browser Support for CSS Currently most browsers support CSS1. Few support CSS2. For a review of what is supported by each browser, go to WebReview.coms Style Sheet Reference GuideWebReview.coms Style Sheet Reference Guide

Creating a Stylesheet A stylesheet is a text document with a.css extension that contains a list of style rules. You can create a stylesheet using Notepad FrontPage Visual InterDev (GUI Interface)

Linking a Stylesheet To attach a stylesheet to an XML document, add the following processing instruction:

CSS Syntax A style sheet is made up of style rules. Each style rule has this syntax: selector { declaration } The selector identifies which XML element the rule applies to. The declaration specifies how the element’s content is to be displayed.

Declarations A declaration has two parts: a property a value e.g. color: red; font-size: 14pt; Properties and values are separated by : Declarations end with a ; Valid properties and values are given in the CSS specification.

Flow & Box Objects A browser normally places text and elements on the screen in the order they appear in the XML document. These elements flow from the top of the screen to the bottom. Every element has a rectangular box drawn around it. The content of the element is displayed in its box.

Inheritance Flow objects inherit properties from their parents. XML documents have a hierarchical structure. Any property specified for a parent element is automatically inherited by its child elements. Rules attached to client elements override inherited properties, i.e., more specific rules override more general rules.

Box Properties margin (transparent) padding element contents border element width box width

Types of Boxes Block has line break before and after it, i.e. appears on its own line Inline no line breaks, i.e., appears in single line

Box Properties display margin padding border border-style, border-width, border-color width height Useful for images, but can be used with text

Color & Background Properties foreground color background color background image

Font Properties font-style font-variant: small-caps font-weight font-size font-family list several in case not available on the client, separate by commas font shorthand for font-style font-variant font-weight font-size, line-height and font-family, in that order.

Text Properties text-align vertical-align text-indent line-height word-spacing addition to the default space between words letter-spacing addition to the default space between characters text-decoration underline | overline | line-through | blink text-transform capitalize | uppercase | lowercase | none

Property Values: Length Used for widths, heights, and sizes em: relative height of element’s font ex: relative to height of letter “x” px: pixels in: inches cm: centimeters mm: millimeters pt: points, where point is 1/72 inch pc: picas, 1 pica = 12 points

Property Values: Color Hexadecimal RGB value e.g. #00FF00 RGB values with integers or % Integer range e.g., rgb(0,0,255) Percentage range 0%-100% e.g., rgb(0%, 0%, 255) Keywords e.g., black, maroon, green, navy, silver, red, lime, blue, gray, purple, olive, teal, white, fuchsia, yellow, aqua

Property Values Percentage Used for width, height and position Format 50% URL Used for images Format url(image.gif)

The End