Cascading Style Sheets Color and Font Properties

Slides:



Advertisements
Similar presentations
CSS Cascading Style Sheets. What is CSS? CSS stands for Cascading Style Sheets (the page—or sheet—helps you create a style that will cascade across all.
Advertisements

CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
Web Engineering 1 Ishaq Khan Shinwari MCS City University Peshawar.
CSS Digital Media: Communication and design 2007.
CSS CSS stands for Cascading Style Sheets Styles define how to display HTML elements External Style Sheets can save a lot of work External Style Sheets.
Cascading Style Sheets (CSS): Pixel-Level Control with HTML Ease
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.
Cascading Style Sheets By: Valerie Kuna. What are Cascading Style Sheets? Cascading Style Sheets (CSS) are a standard for specifying the presentation.
© 2004, Robert K. Moniot Chapter 6 CSS : Cascading Style Sheets.
Building a Website: Cascading Style Sheets (CSS) Fall 2013.
Recognizing the Benefits of Using CSS 1. The Evolution of CSS CSS was developed to standardize display information CSS was slow to be supported by browsers.
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} //
กระบวนวิชา 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.
Measurement Many CSS properties (values within the declaration) require that you specify a unit of measurement, such as spacing between elements, border.
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.
Using Cascading Style Sheets CSS Structure. Goals Understand how contextual, class and ID selectors work Understand how contextual, class and ID selectors.
Using Cascading Style Sheets. Introduction to Styles and Properties  Cascading Style Sheets (CSS) are a standard set by the World Wide Web Consortium.
Chapter 7 Web Typography Principles of Web Design, 4 th Edition.
Tutorial #3 Cascading Style Sheets. Review: Last Class Image sizing Pathnames Project Default Path Relative Path Absolute Path Blackboard Homework Submission.
XP New Perspectives on XML Tutorial 5 1 TUTORIAL 5 CSS Tutorial – Carey ISBN
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.
(CSS) More Details Instructor: Mr. Ahmed Al Astal ITGD4104 Department Requirement for senior student University of Palestine Faculty of IT.
Tutorial #3 Cascading Style Sheets. Tutorial #2 Review - Anchors Links to Site DMACC Internal Links Go to Top Mail To me Local.
Introduction to CSS. What is CSS?  Cascading Style Sheets  Used for styling HTML  Also important in javascript and jquery for selectors  External.
ALBERT WAVERING BOBBY SENG. Week 2: HTML + CSS  Quiz  Announcements/questions/etc  Some functional HTML elements.
CSS Cascading Style Sheets *referenced from
Tutorial 3 Designing a Web Page with CSS
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.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 10: Formatting Text with Styles.
CONFIGURING COLOR AND TEXT WITH CSS Chapter 3. Cascading Style Sheets (CSS) Used to configure text, color, and page layout. Launched in 1996 Developed.
WebD Introduction to CSS By Manik Rastogi.
CSS.
Cascading Style Sheets
HTML WITH CSS.
CSS for Styling By Jinzhu Gao.
CS3220 Web and Internet Programming CSS Basics
Cascading Style Sheets Color and Font Properties
The Internet 10/11/11 Fonts and Colors
Formatting Text with CSS
Cascading Style Sheets™ (CSS)
( Cascading style sheet )
HTML WITH CSS.
Creating Your Own Webpage
Using Cascading Style Sheets Module B: CSS Structure
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Text Size and typeface of text Bold, italics, capitals, underlines
Cascading Style Sheets (Formatting)
Intro to CSS CS 1150 Fall 2016.
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Objectives Explore the history of CSS
3 Configuring Color & Text With CSS.
Introduction to Web programming
CSS – Properties & Values
The Internet 10/13/11 The Box Model
CSS Style Sheets: Intro
Web Development & Design Foundations with H T M L 5
CS3220 Web and Internet Programming CSS Basics
CSS Styles Fonts and Colors.
Chapter 7 Web Typography
CS3220 Web and Internet Programming CSS Basics
Cascading Style sheet. What is CSS?  CSS stands for Cascading Style Sheets  Cascading: refers to the procedure that determines which style will apply.
Lesson 5 Topic B – Basic Text & Fonts
Cascading Style Sheets
Session IV Chapter 15 - How Work with Fonts and Printing
Introduction to Cascading Style Sheets (CSS)
Cascading Style Sheets™ (CSS)
Cascading Style Sheets
Cascading Style Sheets
Presentation transcript:

Cascading Style Sheets Color and Font Properties CS 1150 Fall 2016

How CSS Rules Cascade If two or more rules apply to the same element, some take precedence If two selectors are identical, the latter of the two will take precedence If one selector is more specific, the more specific rule will take precedence You can add !important after any property value to indicate that it should be considered more important than other rules that apply to the same element Example: cascadingrules.html, cascadingrules.css

Inheritance If you specify the font-family or color properties on the body element, they will apply to most child elements If you specify the background-color or border properties, they are not inherited by child elements You can force most properties to inherit values from their parent elements by using inherit for the value of the properties To have any element with an href attribute inherit from its parent, you must specify inherit Example: parentchild.html, parentchild.css

Foreground Color The color property allows you to specify the color of text inside an element You can specify any color in CSS in one of three ways RGB values – these express colors in terms of how much red, green and blue are used to make it up. For example: color: rgb(255,165,0); Hex codes – these are six-digit codes that represent the amount of red, green and blue in a color, preceded by a hash sign. For example: color: #FFA500; Color names – There are 147 predefined color names that are recognized by browsers. For example: color: orange;

Background Color CSS treats each HTML element as if it appears in a box, and the background-color property sets the color of the background for that box You can specify the background color in one of three ways RGB values – these express colors in terms of how much red, green and blue are used to make it up. For example: color: rgb(128,128,128); Hex codes – these are six-digit codes that represent the amount of red, green and blue in a color, preceded by a hash sign. For example: color: #808080; Color names – There are 147 predefined color names that are recognized by browsers. For example: color: gray;

Opacity The opacity property allows you to specify the opacity of an element and any of its child elements The value is a number between 0.0 and 1.0 (so a value of 0.5 is 50% opacity and 0.15 is 15% opacity) Example: opacity: 0.5; The rgba property allows you to specify a color and an opacity. This value is known as an alpha value. The rgba value will only affect the element on which it is applied, not any child elements Example: background-color: rgba(128,128,128,0.5); Example file: opacity.html, opacity.css

Specifying Fonts The font-family property allows you to specify the font that should be used for any text inside the element The value of this property is the name of the font you want to use You can specify a list of fonts separated by commans so that if the user does not have your first choice of font installed, the browser can try to use an alternative font from the list Example: font-family: Verdana, sans-serif;

Size of Font The font-size property enables you to specify a size for the font There are several ways to specify the size of a font Pixels are commonly used because they allow web designers very precise control over how much space their text takes up. Example: font-size: 32px; Percentages – The default size of text in browsers is 16px. So a size of 75% would be the equivalent of 12px and 200% would be 32px. Example: font-size: 200%; Ems – An em is equivalent to the width of a letter m. Example: font-size: 1.3em;

Bold The font-weight property allows you to create bold text There are two values that this property commonly takes normal – This causes text to appear at a normal weight bold – This causes text to appear bold

Italic The font-style property creates italic text There are three values this property can take normal – This causes text to appear in a normal style italic – This causes text to appear italic oblique – This causes text to appear oblique

Uppercase and Lowercase The text-transform property is used to change the case of text, giving it one of the following values uppercase – This causes text to appear uppercase lowercase – This causes the text to appear lowercase capitalize – This causes the first letter of each word to appear capitalized

Underline and Strike The text-decoration property allows you to specify the following values none – This removes any decoration already applied to the text underline – This adds a line underneath the text overline – This adds a line over the top of the text line-through – This adds a line through words

Line Height In CSS, the line-height property sets the height of an entire line of text Increasing the line-height makes the vertical gap between lines of text larger

Letter and Word Spacing The letter-spacing property controls how much horizontal space occurs between letters The word-spacing property controls how much horizontal space occurs between words The values for these properties should be specified in ems, and will be added on top of the default value specified by the font

Text Alignment The text-align property allows you to control the alignment of text This property can take one of four values left right center justify

Font Examples Example file: text.html, text.css