Chapter 13 Colors & backgrounds.

Slides:



Advertisements
Similar presentations
Cascading Style Sheets
Advertisements

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.
Links.  Styling Links  Links can be styled with any CSS property (e.g. color, font-family, background-color).  Special for links are that they can.
Cascading Style Sheets By: Valerie Kuna. What are Cascading Style Sheets? Cascading Style Sheets (CSS) are a standard for specifying the presentation.
CSS cont. October 5, Unit 4. Padding We can add borders around the elements of our pages To increase the space between the content and the border, use.
End User Computing An Introduction to CSS Sujana Jyothi Research Lab1, Callan Building, Department of Computer Science
Building a Website: Cascading Style Sheets (CSS) Fall 2013.
With CSS, a color is most often specified by: a HEX value - like "#ff0000" an RGB value - like "rgb(255,0,0)" a color name - like "red“ Example h1.
CSS(Cascading Style Sheets )
Web Pages and Style Sheets Bert Wachsmuth. HTML versus XHTML XHTML is a stricter version of HTML: HTML + stricter rules = XHTML. XHTML Rule violations:
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.
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.
CSS Cascading Style Sheets Brief Introduction
Basics CSS Chapter 3 and chapter 4 Page Sections and the CSS Box Model 1.
Basics of Web Design Chapter 6 More CSS Basics Key Concepts.
Design, Formatting, CSS, & Colors 27 February, 2011.
Design, Formatting, CSS, & Colors September 9, 2010.
Math Further HTML and Web design Gavin Shaddick
Tutorial 3 Designing a Web Page.
RGB color model Skills: none IT concepts: combining red, green and blue light to generate colors This work is licensed under a Creative Commons Attribution-Noncommercial-
Contains 16,777,216 Colors. My Car is red My Car is red How do I add colors to my web page? Notepad Browser Works with the “Standard” colors: Red, Green,
Cascading Style Sheets 1 Color and Backgrounds. Cascading Style Sheets 2 Color and Backgrounds Computer color basics Expression of color values using.
1 HTML/CSS Tutorial. 2 Definitions WWW -- a software infrastructure layered on top of the Internet HTTP -- HyperText Transport Protocol, layered on top.
COLORS & BACKGROUNDS CHAPTER 13. SPECIFYING COLORS Three common places where you specify color 1.Text color.box { color: blue; } 2.Background color.box.
Learning HTML. HTML Attributes HTML elements can have attributes Attributes provide additional information about an element Class – specifies a class.
What are the five colors in the legend? Enter the information below (5 points) 0000FF = = FFFFFF = 00FF00 = FF0000 = Color Theory Legend: income.
Web Colors. Web Colors: Up until now, we have been using only pre- defined color names, such as "orange" and "lightblue". As web designers, we need the.
Colors. Color of HTML Elements You can control the color of the following elements: You can control the color of the following elements: All text within.
Hexadecimal Codes 1. RGB Color Wheel 2 Before we begin Hexadecimal is a number system Based on using 0 – F to represent 0 – 15 Hex is used to represent.
>> More on CSS Selectors. Pre-requisite Open the file called sample.txt Copy the all the text from the file Open your browser and go to codepen.io Paste.
CSU - DCE Introduction to CSS CSS Colors - Fort Collins, CO Copyright © XTR Systems, LLC Cascading Style Sheets - Specifying Color Instructor: Joseph.
HEXADECIMAL NUMBERS.
HTML & Color How to Use Color  Backgrounds-  Usually a light color is best  Should have a color based on a theme or plan  Can have a dark.
Announcements Chapter 8 for today. 2 More Digitization Light, Sound, Magic: Representing Multimedia Digitally © Lawrence Snyder, 2008.
ColorsColors. Color Keywords/Names 140 color keywords/names are defined in the HTML and CSS color specification –17 standard colors (HTML accepts 16 of.
WebD Introduction to CSS By Manik Rastogi.
Create a new stylesheet called Hotel Style
CSS Layouts CH 13.
4.01 Cascading Style Sheets
( Cascading style sheet )
Creating Your Own Webpage
CSS Rule Selector Declaration Block Value Attribute Name body {
Introduction to HTML.
>> The “Box” Model
Cascading Style Sheets
CSS3 Cascading Style Sheet
Cascading Style Sheets (Layout)
Web Systems & Technologies
COMP 101 Review.
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Chapter 6 More CSS Basics Key Concepts
Images Presentation Name Course Name Unit # – Lesson #.# – Lesson Name
Cascading Style Sheets
Basics of Web Design Chapter 6 More CSS Basics Key Concepts
The Internet 10/13/11 The Box Model
Box model, spacing, borders, backgrounds
Cascading Style Sheets
>> Dynamic CSS Selectors
Basics of Web Design Chapter 6 More CSS Basics Key Concepts
Images Presentation Name Course Name Unit # – Lesson #.# – Lesson Name
How to use the CSS box model for spacing, borders, and backgrounds
What Color is it?.
Web Colors.
CS3220 Web and Internet Programming More CSS
4.01 Cascading Style Sheets
CS3220 Web and Internet Programming More CSS
CGS 3066: Web Programming and Design Fall 2019
CS3220 Web and Internet Programming More CSS
Presentation transcript:

Chapter 13 Colors & backgrounds

What can you do with color? Three common places where you specify color Text color .box { color: blue; } Background color .box { background-color: darkgray; } Borders color .box { border: 1px solid red; } Context: <div class=“box> Here is some content that will be in a box with blue text, darkgray background and a red border </div>

Specifying colors Five ways to specify color Color name color: purple; Hexadecimal 3 digit (#RGB) color: #F08; Hexadecimal 6 digit (#RRGGBB) color: #F3008d rgb function color: rgb(255, 0, 128); rgba function color: rgb(255, 0, 128, 0.4);

HEXADECIMAL HEX DECIMAL F 15 E 14 D 13 C 12 B 11 A 10 9 8 7 6 5 4 3 2 HEXADECIMAL color: #000 Min color (black) color: #FFF Max color (white) color: #0F0 Max green color: #00F Max blue color: #FF0 Max yellow color: #CCC Light gray color: #003 Dark blue color: #CCF Light blue color: #000 Min color (black) color: #FFF Max color (white) color: #0F0 Max green color: #00F Max blue color: #FF0 Max yellow color: #CCC Light gray color: #003 Dark blue color: #CCF Light blue

Color depth 16 values of red X 16 values of green X 16 values of blue X --------------------------------------- 4096 different colors

HEXADECIMAL HEX DECIMAL F0 240 E0 224 D0 208 C0 192 B0 176 A0 160 90 144 80 128 70 112 60 96 50 40 64 33 48 20 32 10 16 00 HEXADECIMAL color: #000000 Min color color: #FFFFFF Max color color: #00FF00 Max green color: #0000FF Max blue color: #FFFF00 Max yellow color: #C0C0C0 Light gray color: #000030 Dark blue color: #C0C0F0 Light blue color: #000 Min color (black) color: #FFF Max color (white) color: #0F0 Max green color: #00F Max blue color: #FF0 Max yellow color: #CCC Light gray color: #003 Dark blue color: #CCF Light blue

Color depth 256 values of red X 256 values of green X 256 values of blue X --------------------------------------- 16,777,216 different colors

Best way to specify color* *Dr. B’s opinion Use rgb with percentages: rgb(0%, 50%, 25%) Why? Intuitive and minimal memorization needed Don’t need to remember hexadecimal scale Don’t need to remember 0 – 255 scale Q: Why do you still need to study the other methods?

Pseudo-Classes link visited focus hover active color of unvisited link visited color of visited link focus color when an link is selected hover color if mouse is over the link active color when a link is selected and it is loading the page Must be in that order! “LoVe For Hell’s Angels”

Pseudo-Classes (cont.) first-line The first line of text first-letter The first letter in a specified element [attribute selectors] Select an element based on attribute input[type=text]

Pseudo-Classes (cont.)

Background Images background-image background-repeat background-image: url(location of image); default is to start in upper left hand corner and tile to fill page background-repeat repeat, repeat-x, repeat-y, no-repeat directs the amount and direction of tiling background-position measurement, left, center, right, top, bottom background-position: left bottom; background-position: 15% 100%; background-attachment scroll, fixed