CSS – CASCADING STYLE SHEETS Making your XHTML webpage look good.

Slides:



Advertisements
Similar presentations
CSS Digital Media: Communication and design 2007.
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} //
Measurement Many CSS properties (values within the declaration) require that you specify a unit of measurement, such as spacing between elements, border.
Tutorial 3 Introducing Cascading Style Sheets. XP New Perspectives on Blended HTML, XHTML, and CSS2 Objectives Learn about Cascading Style Sheets Write.
Week 7 Web Typography. 2 Understanding Type Design Principles.
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.
Beginning Web Site Creation: Dreamweaver CS4. XHTMLCSS  Describes the structure  Content  Collection of styles  Formatting body { background-color:
CS428 Web Engineering Lecture 06 Introduction (Cascading Style Sheet) 1.
1 CSS Styling with Fonts and Colors. 2 CSS Cascading Style Sheets and fonts CSS provides Style or Presentation options for our html pages CSS properties.
Cascading Style Sheets Cyndi Hageman. Applying a Style Sheet  In-line style – used within the HTML tag  Embedded Style Sheet – located in the HTML document.
Using Cascading Style Sheets CSS Structure. Goals Understand how contextual, class and ID selectors work Understand how contextual, class and ID selectors.
Cascading Style Sheets1. 2 n Style sheets are a means of controlling the way HTML tags are formatted n IE introduced style sheets in IE 3.0 release n.
CSS Properties on Parade PropertyValid valuesExample font-familylist of fonts (separate with commas, end with generic font: serif, sans-serif, fantasy,
© 2007 D. J. Foreman CSS-1 Cascading Style Sheets Styles.
3.1 Cascading Style Sheets. Motto Fashions fade, style is eternal. —Yves Saint Laurent.
Formatting Text (Plus More Selectors) Learning Web Design: Chapter 12.
CSS1-1 Cascading Style Sheets (CSS) Xingquan (Hill) Zhu
TECH2018 Multimedia and the Internet More about CSS and Page Layouts.
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.
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 CSS. CSS - Structure Declaration block Property: identifies what to change Value: how to change it Selector – example h1{ font-size:
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.
Cascading Style Sheets " Provide means to control and change presentation of HTML documents. " Allow the user to impose a standard style. " Three levels.
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
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 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.
Cascading Style Sheets (CSS). CSS: A New Philosophy Separate content from presentation! Title Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
ALBERT WAVERING BOBBY SENG. Week 2: HTML + CSS  Quiz  Announcements/questions/etc  Some functional HTML elements.
Text and Fonts in CSS. Customizing fonts In CSS, fonts are divided into “font families” Only certain fonts are commonly installed on most computers Therefore.
CSS Cascading Style Sheets. CSS Advantages Greater typography and page layout control Style is separate from structure Styles can be stored in a separate.
CS 142 Lecture Notes: CSSSlide 1 CSS Rule body { font-family: Tahoma, Arial, sans-serif; color: black; background: white; margin: 8px; } Selector Declaration.
Cascading Style Sheets Robin Burke ECT 270. Outline Midterm The Layout Debate CSS properties Fonts Alignment Color CSS selection selectors pseudo-classes.
Advanced Web Development Instructor: Thomas Bombach.
Cascading Style Sheets Objective: Create an external style sheet, embedded style sheet, and an inline style to change the look and feel of a web site.
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.
XP Review 2 New Perspectives on JavaScript, Comprehensive1 Introducing Cascading Style Sheets Formatting Web Pages with CSS.
XHTML Formatting font with a style declaration. Formatting Font HTML uses the font tag to change size and family of font But… the font tag is being deprecated.
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,
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:
OV Copyright © 2008 Element K Content LLC. All rights reserved.  Format Text  Format Lists  Format Images  Modify Page Background Applying Styles.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
CSS Fonts. The Font properties allow you to change the font family, boldness, size, and the style of a text.
CSS Cascading Style Sheets *referenced from
Class & ID Selectors, Font and List Properties. Id Selectors  # followed by Id-name (without space)  Can be used once on a page  Examples: #p1 { color:
Basic Webpage Design Cascading Style Sheet (CSS).
Agenda Cascading Style Sheets Selectors and Declarations Fonts and Font Families Content Flow Positioning Content Overflow.
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.
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.
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.
Internet & World Wide Web How to Program, 5/e 1. 2.
CSS for Styling Text.
The Internet 10/11/11 Fonts and Colors
Introducing :CSS Cascading Style Sheets in 5 Lessons.
Chapter 6 Cascading Style Sheets™ (CSS)
CSS – Properties & Values
The Internet 10/13/11 The Box Model
Cascading Style Sheets
Cascading Style Sheets
Presentation transcript:

CSS – CASCADING STYLE SHEETS Making your XHTML webpage look good.

CSS vs HTML: The difference?  Browsers read your hypertext file (.html file) to figure out WHAT goes on your page. HTML defines your content and where to find it (such as graphics).  They use the CSS to figure out HOW you want that content displayed/formatted.

Painter/Contractor analogy Much like a decorator and a builder work towards finishing your house…  HTML builds your page  CSS decorates your page So if you make the style p{color:blue} you must have tags in your document for it to work. “You have to build it before you can paint it.”

CSS  CSS Rules  Selector and declaration  Declaration = at least one CSS property and related property value. Ex: h1 {color:red;}  Syntax is very different from HTML

CSS style must refer to an HTML tag <html body {background-color: #000000} p {font-weight: bold} h1 {color: blue} #custom {font-family: arial} Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Phasellus lacinia rutrum erat. Integer lobortis, dui eu lobortis laoreet, nunc ligula convallis urna, vel viverra nisl elit ut risus. Integer id enim. Praesent eleifend. Maecenas accumsan pulvinar risus. Aliquam a turpis. Integer velit turpis, venenatis ac, laoreet sit amet, venenatis nec, dolor..

Associating your CSS  For CSS to work in your document it must be linked or embedded into your code.  Since we’re just starting out we’ll use embedded (also called internal) styles  (We’ll talk more about this, later)  In your you need to have the following tags:  All your styles will go between these tags for right now.

color Changes the color of the text in an element p { color: #435678; } color values can be listed many ways: for example p{color:blue;} or p{color: rgb(0,0,255);} orp {color:#0000FF;}

background-color  highlights background of text or entire element body { background-color: #435678; }

font-weight Used to change the thickness of a font used on text.  Value could be numerical:  scale  Value could be a word:  Bold (equals 700)  Bolder (+100 from the container’s font-weight)  Lighter (-100 form the container’s font-weight)  Normal  inherit Example: p { font-weight: 800; }

Font Size  Font size may be defined in points, pixels, inches, or centimeters (pt, px, in, cm) or as a percentage.  Absolute: can be: xx-small, x-small, small, medium, large, x- large, xx-large. mm, in, cm, pc, pt  Relative larger, smaller. em, ex, px,

font-size  Value could be numerical:  12pt, 12em, 12pc, 12px…  Value could be a word:  small  xx-large Example: p { font-size: 12pt; }

CSS shorthand  You can list all the font properties in one list.  Must be in a specific order  Selector { font: style variant weight size family; }  Any values that aren’t listed are set to their default values.

letter-spacing (aka kerning)  Selector { letter-spacing: 12pts; }  Example values for letter-spacing:  Normal – no extra spacing  20px, 30em…- increases spaces between letters  -20px, -30em… - reduces spaces between letters  Inherit – inherits from parent (containg element)

word-spacing  Selector { word-spacing: 12pts; }  Example values for letter-spacing:  Normal – no extra spacing between words  20px, 30em…- increases spaces between words  -20px, -30em… - reduces spaces between words  Inherit – inherits from parent (containg element)

Generic Font families  Serif (flourish fonts: ex. Times New Roman)  Sans-serif (simple character fonts: ex. arial)  Monospace (ex. courier)  Fantasy (zany fonts)  Cursive (cursive aka “script” fonts)

Serif vs sans-serif  Sans-serif simpler, but easier to read  Serif can help distinguish between numbers and letters using “feet” and other flourishes.

Monospace font  Characters that are all the same size  “Typewriter” fonts  Ex. Courier, andale mono, vt102, mishiwaka

Color Units  Many different types of values can be used as long as the format or units are with the value.  body {background-color: blue}  Color names are unreliable at the moment beyond the basic 8 color names.  body {background-color: #0000FF}  #  body {color: rgb (0, 0, 255)}  rgb(,, )  body {color: rgb (0%, 0%, 100%)}  rgb(,, )

Length Units  {margin-right: 24px }  The number can be an integer or a decimal fraction, and can be preceded by + or -.  Units can be absolute or relative:  Absolute: mm, cm, in, pt, pc (millimeters, centimeters, inches, points, picas)  Relative: em, ex, px (the element's font height, the element's x-height, pixels)

Comments in CSS  /* comment goes here */  This will not be part of the web page, or the CSS styles. It is merely a way for you to make notes on the style sheet.  You should use comments like this to organize your content. You should design your site so that another web designer can understand what is what 10 years from now.  USE IT!