CSS Color & Text Cascading Style Sheets. Advantages of CSS Typography and page layout can be better controlled Style is separate from structure Documents.

Slides:



Advertisements
Similar presentations
Cascading Style Sheets
Advertisements

Cascading Style Sheets. CSS stands for Cascading Style Sheets and is a simple styling language which allows attaching style to HTML elements. CSS is a.
กระบวนวิชา CSS. What is CSS? CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to.
Stylin’ with CSS. 2 Topics What is CSS? Why CSS? CSS Examples.
XP Introducing Cascading Style Sheets With Cascading Style Sheets (CSS), you can create one or more documents that control the appearance of some or all.
CIS 1310 – HTML & CSS 4 Visual Elements and Graphics.
Chapter 6 Web Typography
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.
Basics of Web Design Chapter 6 More CSS Basics Key Concepts 1.
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.
1 Cascading Style Sheets C S S. 2 What is CSS? A simple mechanism for controlling the style of a Web document without compromising its structure. It allows.
Using Cascading Style Sheets CSS Structure. Goals Understand how contextual, class and ID selectors work Understand how contextual, class and ID selectors.
4.01 Cascading Style Sheets
Lecture CSS: Cascading Style Sheets. What are Styles? Cascading Style Sheets (CSS) is a style sheet language used to describe the presentation semantics.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
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.
Cascading Style Sheets 1 Color and Backgrounds. Cascading Style Sheets 2 Color and Backgrounds Computer color basics Expression of color values using.
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.
Using Cascading Style Sheets. Introduction to Styles and Properties  Cascading Style Sheets (CSS) are a standard set by the World Wide Web Consortium.
Chapter 4 Cascading Style Sheets Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
Cascaded Style Sheets Implementing web pages using only html/xhtml is tedious and awkward With CSS, you can design a component to be used in a web page.
Cascading Style Sheets Billy Toy Cascading Style Sheets Syntax review How to Implement style sheets Background properties Text properties.
CSS Dvijesh Bhatt.
HTML - Quiz #2 Attendance CODE:
Cascading style sheets (CSS)
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
Cascading Style Sheets CSS. CSS - Structure Declaration block Property: identifies what to change Value: how to change it Selector – example h1{ font-size:
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
Chapter 12 Cascading Style Sheets: Part II The Web Warrior Guide to Web Design Technologies.
Doman’s Sections Information in this presentation includes text and images from
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
Cascading Style Sheets
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
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.
CO1552 – Web Application Development Cascading Style Sheets.
Class three: CSS review, backgrounds, font formatting, the box model.
Tutorial #3 Cascading Style Sheets. Tutorial #2 Review - Anchors Links to Site DMACC Internal Links Go to Top Mail To me Local.
Cascading Style Sheet Bayu Priyambadha, S.Kom. Definition Cascading Style Sheets (CSS) form the presentation layer of the user interface. –Structure (HTML)
Introduction to CSS. What is CSS?  Cascading Style Sheets  Used for styling HTML  Also important in javascript and jquery for selectors  External.
CHAPTER 3 CSS & CSS3 อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา 1.
COMP213 – Web Interface Design
CSS Cascading Style Sheets. CSS Advantages Greater typography and page layout control Style is separate from structure Styles can be stored in a separate.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Tutorial 7.
 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.
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:
3.2 Cascading Style Sheets. 2 Positioning Elements Normally, elements are laid out on the page in the order that they are defined in the XHTML document.
CSS – Cascading Style Sheets
5 th ed: Chapter 4 4 th ed: Chapter 5 SY306 Web and Databases for Cyber Operations Slide Set #4: CSS.
Web Technologies Beginning Cascading Style Sheets (CSS) 1Copyright © Texas Education Agency, All rights reserved.
Developing Web Applications with HTML and CSS “Selectors and Properties”
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
Basic Webpage Design Cascading Style Sheet (CSS).
Tutorial #5 Working with the Box Model. Tutorial #4 Review - CSS Create a homework page Final Project Discussion Exam on Blackboard Styling Lists (List-style-type,
PERSPECTIVES: TUTORIAL 4 CREATING PAGE LAYOUTS WITH CSS.
CS 120: Introduction to Web Programming Lecture 10: Extra Features and Website Design Part 1 Tarik Booker CS 120 California State University, Los Angeles.
Blended HTML and CSS Fundamentals 3 rd EDITION Tutorial 3 Introducing Cascading Style Sheets.
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.
HTML & CSS Contents: the different ways we can use to apply CSS to The HTML documents CSS Colors and Background CSS Fonts CSS Text CSS box model: padding,
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.
4.01 Cascading Style Sheets
Web Development & Design Foundations with HTML5
4.01 Cascading Style Sheets
Presentation transcript:

CSS Color & Text Cascading Style Sheets

Advantages of CSS Typography and page layout can be better controlled Style is separate from structure Documents are potentially smaller Site maintenance is easier

Configuring CSS Commenting CSS = /*comment goes here*/ Inline Styles (coded in body, apply to one element only) Embedded Styles (coded in head, apply to entire document) External Styles (coded in separate.css file, can be applied to multiple documents) Imported Styles (similar to external, external can be imported directive)

CSS Selectors and Declarations CSS Style Rule Selector Can be an HTML element, a class name, or an id name CSS Style Rule Declaration Indicates the CSS property you are setting body{color:blue;}Selector{Declaration:Value;}

A Few CSS Properties background-color, color font-family, font-size, font-style, font-weight line-height margin, margin-left, margin-right text-align, text-decoration width

Color Values (Hex and Name) Hexadecimal Number System Base , A-F (must begin with #) #FFFFFF (white), # (black) CSS Color Syntax p{color:red;} = p{color:#FF0000;} = p{color:#F00;} = p{color:rgb(255,0,0);}

Inline CSS with Style This is displayed as a red heading This is displayed as a red heading This is displayed as a red heading on a gray background This is displayed as a red heading on a gray background

Embedded CSS With Style Embedded styles are placed within a element located in the head section of a web page XHTML requires XHTML requires HTML5 requires HTML5 requires body{background-color:#CCFFFF; color:#000033;} body{background-color:#CCFFFF; color:#000033;}

Configuring Text with CSS Font-Family Category serif, sans-serif, monospace, cursive, fantasy p{font-family:Arial, Helvetica, sans-serif;} Not all computers have the same font installed. Or a list of web-safe fonts, visit

More CSS Font Properties font-size Text Value (xx-small, x-small, small, medium, large, x-large, xx-large) Pixel Unit (px), Point Unit (pt), Em Unit (em), Percentage Value (%) font-weight, font-style, line-height, text-align, text- indent, text-decoration Configuring selectors (h1, h2, ul, p)

CSS Class and id Selectors Class Selector (used when you need to apply a CSS declaration to certain elements).feature{color:#FF0000;} Usability Studies Usability Studies I’ll have the feature CSS properties I’ll have the feature CSS properties id Selector (used when you want to apply a CSS declaration to a single area) #footer{color:#333333; font-size:.75em; font-style:italic;} Usability Studies Usability Studies This is the footer This is the footer

Contextual Selectors Used when you want to specify an element within the context of its container (parent) element aka: descendent selectors To specify a green text color only for anchor tags located within the footer id declared earlier… #footer a {color:#00ff00;}

Span Element defines areas separate, with empty space above and below defines areas separate, with empty space above and below defines a section that is not physically separated from other areas defines a section that is not physically separated from other areas Use the tag if you need to format an area that is contained within another, such as within,,, or tag.

External Style Sheets Best method (in my opinion) Link to external style sheet from HEAD Link to external style sheet from HEAD

Centering with CSS Wrap the entire document in a to encompass centering all content #wrapper {width:700px; margin-left:auto; margin-right:auto;} #wrapper {width:80%; margin-left:auto; margin-right:auto;}

The “Cascade” Browser Defaults External Styles Embedded Styles Inline Styles HTML Attributes

CSS Validation Similar to HTML5 validation

Horizontal Rule Element Visually separates areas of the page XHTML = XHTML = HTML5 = HTML5 = Use CSS to specify width, height, color, & style

Border & Padding Property Border = configure the border around an element (default width set to 0 to be invisible) border-width, border-color, border-style Padding = configures the empty space between the content of the element and the border padding-bottom, padding-left, padding-right, padding-top

Other CSS Properties background- attachment, clip, image, origin, position, repeat, size box-shadow, height, linear- gradient, min-width, opacity, radial-gradient, text-shadow border- bottom, bottom-left- radius, bottom-right- radius, color, left, radius, right, style, top, top-left-radius, top- right-radius, width

Types of Graphics GIF, JPEG, PNG

Image Element Image Element = src attribute + alt attribute Attributes: align, alt, border, height, hspace, id, name, src, title, vspace, width Image Hyperlinks

HTML5 Figure Element Figure includes image and caption (figcaption) Create image element, add alternate text, set figcaption in CSS Open element, create image element with, use Caption Here, close element

HTML5 Meter & Progress Meter = displays a visual gauge of a numeric value within a known rage, typically part of a bar chart Progress = displays a bar that depicts a numeric value within a specified range

Background Images Use CSS whenever possible for background images body{background-image: url(pic.jpg);} background-repeat (repeat-y, repeat-x, no-repeat) background-position (left, top, center, bottom, right) background-attachment (fixed, scroll) = configure whether the background image remains fixed in place or scrolls along with the page

Image Maps Create “hotspots” on images that are links Certainly not something you want to code by hand. Use GIMP, Fireworks, Coffee Cup HTML Editor

Favorites Icon favicon.ico Either 16x16 or 32x32 pixels favicongenerator.com, favicon.cc, freefavicon.com For IE compatibility: For IE compatibility:

CSS3 Visual Effects background-clip (content-box, padding-box, border- box) background-origin (content-box, padding-box, border- box) background-size (%w%h, px w px h, auto, contain, cover)

Multiple Background Images Progressive Enhancement In CSS, configure a standard background-image property Continue by adding background: url(….); within body CSS

CSS3 Rounded Corners border-radius property border-bottom-left-radiusborder-top-left-radiusborder-bottom-right-radiusborder-top-right-radius

Shadow Properties CSS3 box-shadow property CSS3 text-shadow property CSS3 opacity property Gradients (filter and linear)