WEEK 3 Lecture 2 CSS TEXT AND FONT PROPERTY Copyright © 2015. Corporate Health and Consultancy Services Limited Web Developmen t 15.WD.1 Mildred Fakoya.

Slides:



Advertisements
Similar presentations
HTML popo.
Advertisements

Cascading Style Sheets
Cascading Style Sheets: Basics I450 Technology Seminar Copyright 2003, Matt Hottell.
Chapter 6 More CSS Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
INTRODUCTION TO HYPERTEXT MARKUP LANGUAGE 1. Outline  Introduction  Markup Languages  Editing HTML  Common Tags  Headers  Text Styling  Linking.
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.
End User Computing An Introduction to CSS Sujana Jyothi Research Lab1, Callan Building, Department of Computer Science
Web Pages and Style Sheets Bert Wachsmuth. HTML versus XHTML XHTML is a stricter version of HTML: HTML + stricter rules = XHTML. XHTML Rule violations:
กระบวนวิชา 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.
CSS normally control the html elements. Three Ways to Insert CSS There are three ways of inserting a style sheet: External style sheet Internal style.
Session Objectives What is CSS? Define CSS syntax Learn about the authoring options Add comments to a CSS Defining color in CSS.
Basics of Web Design Chapter 6 More CSS Basics Key Concepts.
Design, Formatting, CSS, & Colors 27 February, 2011.
Web Workshop: CSS Objectives: - “What is CSS?” - Structure of CSS - How to use CSS in your webpage.
Workshop: CSS-Part I Cascading Style Sheets add style to your HTML web pages.
4.01 Cascading Style Sheets
Using color and fonts in HTML and XHTML Please use speaker notes for additional information!
HTML BASIC
Primaries: magenta, yellow, and cyan This color system is called subtractive because: each primary color absorbs (subtracts) a certain part of the color.
Chapter 4 Cascading Style Sheets Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
COLORS & BACKGROUNDS CHAPTER 13. SPECIFYING COLORS Three common places where you specify color 1.Text color.box { color: blue; } 2.Background color.box.
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.
More Basic HTML. Add spacing (single & double space) Save Refresh Add horizontal rule Add comments Add styles Add headings Add features Add alignments.
(CSS) More Details Instructor: Mr. Ahmed Al Astal ITGD4104 Department Requirement for senior student University of Palestine Faculty of IT.
More Basic XHTML Module 2: XHTML Basics LESSON 2.
Introduction To CSS.. HTML Review What is HTML used for? Give some examples of formatting tags in HTML? HTML is the most widely used language on the Web.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
Web Foundations TUESDAY, OCTOBER 1, 2013 LECTURE 4: HTML COLOR CODES, INTRO TO CSS STYLES.
HTML Basic IST2101. Keep In Mind Programming can be time consuming. Plan ahead!
Cascade Style Sheet Introduction. What is CSS?  CSS stands for Cascading Style Sheets  Styles define how to display HTML elements  Styles were added.
COMP213 – Web Interface Design
Web Design and Development for Business Lecture 4 Cascading Style Sheet (CSS)
Unit I Applying Advanced Styling CSS. CSS3 can style many aspects that in the past required integration of images New features are not supported by all.
Colors & Fonts Building a Website Lesson 7. Font Font The tag specifies the font face, font size, and color of text. The tag can have any or all of these.
HTML GUIDE Press F5 and then Click on the links on the left to get to the section you want Section 1: Getting Started Section 2: Moving Banner Section.
Quick Questions 1. What does HTML stand for? 2. What are the three main languages of the Web? 3. What is the purpose of the tags? 4. Why do we indent different.
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.
12/20/20151 Color Fall, 2010 Modified by Linda Kenney 10/26/10.
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 7: CSS Building Blocks.
Paper 3 Unit 15 – Web Authoring Software Choices Graphics Exporting Graphics Creating CSS RGB Colour CSS – Body, Table and TD Border Collapse Tables -
Spiderman ©Marvel Comics Creating Web Pages (part 1)
Introduction To CSS by: Alexandra Vlachakis Sandy Creek High School, Fayette County Schools Content and Resources Used With Permission: Interact With Web.
Your HTML website creating your first html file. Creating an HTML FIle Open note pad from accessories, programs. Write code. Save and view. In 3 Steps.
CSS Cascading Style Sheets *referenced from
Introduction To CSS. Lesson 1: History of CSS CSS was proposed in 1994 as a web styling language. To helps solve some of the problems HTML 4. There were.
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
Basics of Web Design Chapter 4 Cascading Style Sheets Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D.
Tutorial 4 Topic: CSS 3.0 Li Xu
Basics of Web Design Chapter 4 Cascading Style Sheets Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D.
Chapter 6 More CSS Basics Key Concepts
FOREGROUND COLOR h1 { color: DarkCyan;} h2 { color: #ee4e80;} p { color: rgb(100, 100, 90);} The three traditional ways to specify colors: Color name.
Website Design 3
Programming for webpages
CSS – Properties & Values
Basics of Web Design Chapter 6 More CSS Basics Key Concepts
Basics of Web Design Chapter 4 Cascading Style Sheets Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D.
Basics of Web Design Chapter 6 More CSS Basics Key Concepts
Cascading Style Sheets Color and Font Properties
Basics of Web Design Chapter 6 More CSS Basics Key Concepts
Web Development & Design Foundations with H T M L 5
SEEM4570 Tutorial 3: CSS + CSS3.0
Programming for webpages
Tutorial 3 Working with Cascading Style Sheets
Web Design and Development
4.01 Cascading Style Sheets
Presentation transcript:

WEEK 3 Lecture 2 CSS TEXT AND FONT PROPERTY Copyright © Corporate Health and Consultancy Services Limited Web Developmen t 15.WD.1 Mildred Fakoya OCA, OCP, MCITP, MCSA, MCTS, MCPS Course Instructor

TEXT COLOR To set the color of a text, the color property is used. The values can however be specified in three different ways. a.By using the name of the color like this:- color: red b.By using the Hexadecimal value of the color like this:- color:#ff0000 c.By using the RGB value like this:- color: rgb(255,0,0) Copyright © Corporate Health and Consultancy Services Limited Web Developmen t 15.WD.1 Mildred Fakoya OCA, OCP, MCITP, MCSA, MCTS, MCPS Course Instructor

All these values red, #ff0000 and rgb(255,0,0) are all different ways to write the color red. Don’t worry, you do not need to have the values in your head. You could just get a list of color names what they look like, with their HEX and RGB values downloaded and always Make reference to them. You can go to to get a list of colors and their values. Copyright © Corporate Health and Consultancy Services Limited Web Developmen t 15.WD.1 Mildred Fakoya OCA, OCP, MCITP, MCSA, MCTS, MCPS Course Instructor Mildred Fakoya OCA, OCP, MCITP, MCSA, MCTS, MCPS Course Instructor Web Developmen t 15.WD.1 Mildred Fakoya OCA, OCP, MCITP, MCSA, MCTS, MCPS Course Instructor Copyright © Corporate Health and Consultancy Services Limited Web Developmen t 15.WD.1 Mildred Fakoya OCA, OCP, MCITP, MCSA, MCTS, MCPS Course Instructor Copyright © Corporate Health and Consultancy Services Limited Web Developmen t 15.WD.1 Mildred Fakoya OCA, OCP, MCITP, MCSA, MCTS, MCPS Course Instructor

PRACTICAL TIME let’s open up the main file which we created in lecture 1. Remember we saved it in the css folder of the school of programming folder. Copyright © Corporate Health and Consultancy Services Limited Web Developmen t 15.WD.1 Mildred Fakoya OCA, OCP, MCITP, MCSA, MCTS, MCPS Course Instructor

PRACTICAL : COLORS Now lets try using the other values for the color red to test it. Change the value of the color property to rgb(255,0,0); Open with a browser to see if it works. Then change the value again this time, using thehexadecimal value of the color like this color:#ff0000; Test to see how it looks. Copyright © Corporate Health and Consultancy Services Limited Web Developmen t 15.WD.1 Mildred Fakoya OCA, OCP, MCITP, MCSA, MCTS, MCPS Course Instructor

The color property is used to change the color of the text. To change the color of the background or page, we use the background-color property like this: background-color: red; Copyright © Corporate Health and Consultancy Services Limited Web Developmen t 15.WD.1 Mildred Fakoya OCA, OCP, MCITP, MCSA, MCTS, MCPS Course Instructor

New to CSS 3 Colors With CSS3, four new features where introduced. 1.RGBA colors: this is just an extension of the RGB. The A stands for alpha and it specifies how transparent or opaque a color should be. The value of A can be between 0.0(fully transparent ) and 1.0 (fully opaque). It is written thus for the color red color:rgba(255,0,0,0.1) Copyright © Corporate Health and Consultancy Services Limited Web Developmen t 15.WD.1 Mildred Fakoya OCA, OCP, MCITP, MCSA, MCTS, MCPS Course Instructor

New to CSS 3 2. HSL : Hue, Saturation, and Lightness. Hue is the degree on the color wheel. 0 degree is red, 120 is green and 240 is blue. Saturation and Lightness are measured in percentage. 100% saturation is the full color. 0% lightness is black and 100% is white. hsl(0, 100%, 30%); Copyright © Corporate Health and Consultancy Services Limited Web Developmen t 15.WD.1 Mildred Fakoya OCA, OCP, MCITP, MCSA, MCTS, MCPS Course Instructor

New to CSS 3 3. Just like RGB, HSL also has an alpha channel. HSLA where A defines the opacity. 0.0 is fully transparent and 1.0 is fully opaque. It is used just in the same way the RGBA is used. color: hsla(0, 90%, 20%, 0.2); 4. Opacity: it is used to the set the opacity of a specified RGB value like this color:rgb(255,0,255); opacity:0.5; Copyright © Corporate Health and Consultancy Services Limited Web Developmen t 15.WD.1 Mildred Fakoya OCA, OCP, MCITP, MCSA, MCTS, MCPS Course Instructor

TEXT ALIGNMENT The text-alignment property is used to set the horizontal alignment of a text. The values it takes are center, right and left. The default is left. So if you don’t specify an alignment, it will be aligned left. Open your main.css file again to see how this works. This time, we want to give the body a Heading. Write this code just below the p style. H1{ text-align: center; } Copyright © Corporate Health and Consultancy Services Limited Web Developmen t 15.WD.1 Mildred Fakoya OCA, OCP, MCITP, MCSA, MCTS, MCPS Course Instructor

Now open your index.html file and type the following code in the body part just above the p tag. the story of the fox Run your code to see if the style is applied. If all is well, the text between the h1 tags should be centered and the text between the p tags should still be in color red.

Now lets do an example of aligning to the right. Lets write another p style this time with a class. And here is how to do it..date { text-align:right; color :#000000; } Copyright © Corporate Health and Consultancy Services Limited Web Developmen t 15.WD.1 Mildred Fakoya OCA, OCP, MCITP, MCSA, MCTS, MCPS Course Instructor

Now to properly reference a class style we do it like this. Note that the link tag must be present in the head section and the file holding all your style is properly referenced. At the body tag, add the following code just after the body start tag June 2015 Copyright © Corporate Health and Consultancy Services Limited Web Developmen t 15.WD.1 Mildred Fakoya OCA, OCP, MCITP, MCSA, MCTS, MCPS Course Instructor