The Internet 10/11/11 Fonts and Colors

Slides:



Advertisements
Similar presentations
Intro To Cascading Style Sheets By Mario Yannakakis.
Advertisements

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.
Web Engineering 1 Ishaq Khan Shinwari MCS City University Peshawar.
CSS The basics { }. CSS Cascading Style Sheets - language used to – describe html appearance & formatting Style Sheet - file that describes – how html.
CSS Digital Media: Communication and design 2007.
Introducing CSS CIS 133 mashup Javascript, jQuery and XML 1.
- Relative and Absolute URLs -HTML and CSS Validation -Caches -3 ways of adding style -Firebug CS110: Computer Science and the Internet.
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.
Building a Website: Cascading Style Sheets (CSS) Fall 2013.
1 Pengantar Teknologi Internet W03: CSS Cascading Style Sheets.
Cascading Style Sheet CSS CS1520 Ali Alanjawi. 2 TA Information Ali Alanjawi Homepage: Office:
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.
Dr. Ahmet Cengizhan Dirican BIL 374 Internet Technologies 3. CSS.
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.
CSS Properties on Parade PropertyValid valuesExample font-familylist of fonts (separate with commas, end with generic font: serif, sans-serif, fantasy,
3.1 Cascading Style Sheets. Motto Fashions fade, style is eternal. —Yves Saint Laurent.
Tutorial #3 Cascading Style Sheets. Review: Last Class Image sizing Pathnames Project Default Path Relative Path Absolute Path Blackboard Homework Submission.
Chapter 12 Cascading Style Sheets: Part II The Web Warrior Guide to Web Design Technologies.
Tutorial #3 Cascading Style Sheets. Tutorial #2 Review - Anchors Links to Site DMACC Internal Links Go to Top Mail To me Local.
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 *referenced from
Font-Family, Color and Background. Basics  CSS rule: Selector (multiple separated by, ) Declaration (multiple separated by ; ) Example: p { color: red;
CIS 228 The Internet 11/1/11 Review HFHTML ch 8-14.
WebD Introduction to CSS By Manik Rastogi.
Cascading Style Sheets
HTML WITH CSS.
CSS for Styling By Jinzhu Gao.
CS3220 Web and Internet Programming CSS Basics
Style Sheets.
Cascading Style Sheets Color and Font Properties
( Cascading style sheet )
HTML WITH CSS.
Creating Your Own Webpage
Cascading Style Sheets
Introducing :CSS Cascading Style Sheets in 5 Lessons.
CSS Rule Selector Declaration Block Value Attribute Name body {
Cascading Style Sheets
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Cascading Style Sheet (CSS)
IS333: MULTI-TIER APPLICATION DEVELOPMENT
3 Configuring Color & Text With CSS.
Introduction to Web programming
CSS – Properties & Values
The Internet 10/13/11 The Box Model
Cascading Style Sheets
CSS Style Sheets: Intro
Stylin’ with CSS.
Cascading Style Sheets Color and Font Properties
Cascading Style Sheets
The Internet 10/6/11 Cascading Style Sheets
Web Development & Design Foundations with H T M L 5
Tutorial 3 Working with Cascading Style Sheets
CS3220 Web and Internet Programming CSS Basics
CS3220 Web and Internet Programming CSS Basics
Cascading Style Sheets
Lesson 5 Topic B – Basic Text & Fonts
Cascading Style Sheets
Cascading Style Sheets
Stylin’ with CSS.
Cascading Style Sheets
Cascading Style Sheets
Stylin’ with CSS.
Session IV Chapter 15 - How Work with Fonts and Printing
Cascading Style Sheets
Cascading Style Sheets
Cascading Style Sheets
Presentation transcript:

The Internet 10/11/11 Fonts and Colors CIS 228 The Internet 10/11/11 Fonts and Colors

Attaching CSS to a Web Page Style element Attribute type=”text/css” Content: one or more CSS rules Link element (empty element) Attribute rel=”stylesheet” Attribute href=”somepath/file.css” CSS file contains one or more CSS rules Both <link> and <style> belong in <head>

CSS Rules Template: selector { property : value+ ; } Selector identifies 0 or more elements in a document (Remember a document is a tree of elements) Element names can be selectors (e.g. blockquote, p, q …) Property governs an aspect of element presentation Value specifies a property (e.g. 7, 7px, 7%, red, etc.) Example: h1, q, em { background-color: maroon ; border: 1px solid blue ; }

Some CSS Properties color maroon grey background-color border border-bottom font-family sans-serif serif

Property Inheritance Some property values are inherited Some are not e.g. color, font-family Some are not e.g. border (why?) Elements pass inherited values to their children e.g. em inherits color from p Inheritance can be overridden by explicit assignment e.g. em { color: maroon ; }

Determining Property Values What is the value v of property p on element e? Is there a rule that selects e and defines p? Only one? that rule gives v More than one? take the (physically) last one Is p an inherited property? Take the value of p for e's parent Otherwise Default value To come: what if there are multiple style sheets?

The Class Attribute Distinguishes elements having the same name All Sam's must ware red hats All Sam's in the drama club must ware red hats XHTML (and HTML) Any element (in <body>) can have a class attribute e.g. <p class=”legalese”>...</p> CSS p.legalese { color: red ; } .legalese { font-size: small ; }

Font Families Sans-serif Serif Monospace Cursive Fantasy Ariel, Verdana, Geneva, Helvetica, “DejaVu Sans” Serif “Times New Roman”, Times, “DejaVu Serif” Monospace “Courier New”, Courier, “DejaVu Sans Mono” Cursive “Comic Sans”, Cartoon, “Apple Chancery” Fantasy Impact, “Last Ninja”, Crush, Papyrus

Font Size Keywords: Absolute size: Relative size: Suggestions: xx-small, x-small, small, medium, large, x-large, xx-large Absolute size: Pixels: 14px Points: 14pt Relative size: Reference character: 1.4em Percentage: 140% Suggestions: Default: use keyword (medium or small) in body rule Otherwise: use relative size measurements

Other Text Properties font-weight “bold” or “normal” font-style “italic” (“oblique”) or nothing text-decoration “underline”, “overline”, “line-through”, “blink”, “none” line-height e.g. 1.6em or 160%

Color Specifying color 17 named colors Red-Green-Blue triples black, white, red, green, blue, aqua, fuchsia, yellow, etc. Red-Green-Blue triples rgb(100%, 50%, 25$) rgb(255, 127, 63) Hex codes #FF7F3F #963 (= #996633)

Setting Defaults Set defaults for inherited properties on body element font-family: Verdana, Geneva, “Dejavu Sans”, Arial, san-serif ; font-size: medium ; background-color: #FEA ; Color: #963 ; } h1 { font-size: 150% ; } h3 { font-size: 1.2em ; }