Cascading Style Sheets CSS. CSS - Structure Declaration block Property: identifies what to change Value: how to change it Selector – example h1{ font-size:

Slides:



Advertisements
Similar presentations
Cascading Style Sheets Color and Background Controls Border and Margin Controls (Boxes)
Advertisements

Session Objectives Setting the font family Setting the font size Working with Web fonts Setting font faces and sizes Setting font and text appearances.
1 Dynamic HTML: Cascading Style Sheets™ (CSS). 2 Introduction Cascading Style Sheets (CSS) –Specify the style of your page elements –Spacing, margins,
CSS: Class 1 Background Images, Controlling Position of Background Images, Add Padding to Page Elements, Add Borders to Elements on a Page.
CSS Properties  Font  Color & Background  Text  List  Box Model  Visual Formatting Model (normal & float)  User Interface & Downloadable Font 
Cascading Style Sheets (Formatting. Slide 2 Lecture Overview At this point, you have learned how and where to create styles You have not learned much.
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.
Text Properties, Line Box, CSS. Text Properties Properties related to the display of text. Text-align : left, right, center I like FSU!
Web Design & Development Cascading Style Sheets (CSS)
CS134 Web Design & Development Cascading Style Sheets (CSS) Mehmud Abliz.
Cascading Style Sheets Cyndi Hageman. Applying a Style Sheet  In-line style – used within the HTML tag  Embedded Style Sheet – located in the HTML document.
Multimedia and the World Wide Web HCI 201 Lecture Notes #7B.
Lecture CSS: Cascading Style Sheets. What are Styles? Cascading Style Sheets (CSS) is a style sheet language used to describe the presentation semantics.
Working with Fonts, Colors, and Graphics HTML: Tutorial 3.
3.1 Cascading Style Sheets. Motto Fashions fade, style is eternal. —Yves Saint Laurent.
Formatting Text (Plus More Selectors) Learning Web Design: Chapter 12.
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.
CSS1-1 Cascading Style Sheets (CSS) Xingquan (Hill) Zhu
Using Cascading Style Sheets. Introduction to Styles and Properties  Cascading Style Sheets (CSS) are a standard set by the World Wide Web Consortium.
Cascading Style Sheets Billy Toy Cascading Style Sheets Syntax review How to Implement style sheets Background properties Text properties.
 2000 Deitel & Associates, Inc. All rights reserved. Chapter 14 – Dynamic HTML: Cascading Style Sheets (CSS) Outline 14.1Introduction 14.2Inline Styles.
CSS Dvijesh Bhatt.
CSS Typography, Fonts, Spacing, Borders, Backgrounds, Opacity
1.NET Web Forms CSS: Style Sheets © 2002 by Jerry Post.
Tutorial #3 Cascading Style Sheets. Review: Last Class Image sizing Pathnames Project Default Path Relative Path Absolute Path Blackboard Homework Submission.
Cascading Style Sheets, pt 2 ECA 225 Applied Online Programming.
WORKING WITH CASCADING
New Perspectives on XML, 2nd Edition Tutorial 5 1 TUTORIAL 5 WORKING WITH CASCADING STYLE SHEETS.
CSS – Cascading Style Sheets Fred Durao
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.
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.
COMP213 – Web Interface Design
 2008 Pearson Education, Inc. All rights reserved Cascading Style Sheets™ (CSS)
Creating Your Own Webpage COSC Cascading Stylesheets Think of: HTML: content of your webpage HTML has tags CSS: presentation and appearance of your.
Cascading Style Sheets Chapters 5-6 Color and Background Controls Border and Margin Controls.
>> The “Box” Model. Pre-requisite Create a new project in Netbeans called Week5 Create a new html file and name it box.html Create a new css file and.
 Cascading Style Sheets (CSS) ◦ Used to specify the presentation of elements separately from the structure of the document.  Inline style ◦ declare.
CHAPTER 2 CSS (Cascading Style Sheet). Topics Introduction Inline Styles Embedded Style Sheets Conflicting Styles Linking External Style Sheets Positioning.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
Cascading Style Sheets Eugenia Fernandez IUPUI. CSS Purpose CSS allow you to specify the style in which your XML elements are displayed. CSS were originally.
 2008 Pearson Education, Inc. All rights reserved Cascading Style Sheets™ (CSS)
CSS Presentation CSS Typography, Fonts, Spacing, Borders, Backgrounds, Opacity Svetlin Nakov Technical Trainer Software University
1 CS428 Web Engineering Lecture 08 Border, Margin, Padding … (CSS - III)
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.
©SoftMoore ConsultingSlide 1 Introduction to HTML: Cascading Style Sheets.
CSS – Cascading Style Sheets
Cascading Style Sheets Web Design Fairport High School.
CSS properties Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 1.
CSS Cascading Style Sheets *referenced from
Web Technology (NCS-504) Prepared By Mr. Abhishek Kesharwani Assistant Professor,UCER Naini,Allahabad.
Basic Webpage Design Cascading Style Sheet (CSS).
ECA 228 Internet/Intranet Design I Cascading Style Sheets.
Font-Family, Color and Background. Basics  CSS rule: Selector (multiple separated by, ) Declaration (multiple separated by ; ) Example: p { color: red;
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,
03 CSS (Cascading StyleSheet) Р.Жавхлан МОНГОЛ УЛСЫН ИХ СУРГУУЛЬ Мэдээллийн технологийн сургууль Интернэт технологийн үндэс 2015 Намар.
Chapter 11 & 12 CSS Style Sheets: Intro. Why CSS? Separate presentation from content – more accessible Less work – can change appearance of whole site.
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)
CSS Details Cascading Style Sheets. Lesson Overview  In this lesson, you will learn:  To use CSS properties for fonts  Evaluate whether to use pts,
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 10: Formatting Text with Styles.
Cascading Style Sheets™ (CSS)
CSS – Properties & Values
The Internet 10/13/11 The Box Model
Cascading Style Sheets™ (CSS)
Presentation transcript:

Cascading Style Sheets CSS

CSS - Structure Declaration block Property: identifies what to change Value: how to change it Selector – example h1{ font-size: small; font-family: Georgia, ‘Times New Roman’, Times, serif; color: #CC3300; margin-top: 4em; margin-bottom: 10em; }

CSS Properties Font Ex: h1 { font-size: 1.5em;} Font-family | serif | sans-serif | monospace | cursive | fantasy | name | body { font-family: Courier, monospace; } p { font-family: “Trebuchet MS”, Verdana, Arial, sans-serif; } “suggestion” Font-size| length unit | % | xx-small | x-small | small | medium | | large | x-large | xx-large | smaller | larger | Font-weight| normal | bold | | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | Font-style|normal | italic | oblique | Font-variant| normal | small-caps | Font (shortcut){font: style weight variant size/line-height font-family} Ex: h2 {font: oblique bold small-caps 1.5em/2 sans-serif;} Embedded web rule

CSS Measurements Absolute Units pt - points (1/72 inch) pc - picas (1 pica = 12 points) mm - millimeters cm - centimeters in - inches Relative Units em - equal to the current font size ex - approx. height of a lowercase “x” in current font px – pixel (varies depending on resolution) % - percentage

CSS Measurements If your default or base font size is 16 pixels Then h1{font-size: 1.5em;} = 24 (1.5 X 16 =24) body {font-size: 100%;} h1 {font-szie: 150%;} /*150 of 16 = 24*/

CSS Properties Line height p {line-height: 2;} p {line-height: 2em;} p {line-height: 200%} Text Color h1{color: gray;} h1{color:#666666} h1{color:#666;} h1{color: fuchsia;} (17 standard color names defined in CSS2.1) Indents (indents 1 st line of paragraph) p {text-indent: 2em;} p {text-indent: 25%} p {text-indent: -35px;} alignment p {text-align: left;} p {text-align: right;} p {text-align: center;} p {text-align: justify;}

CSS Properties Text-decoration a {text-decoration: underline;} a {text-decoration: overline;} a {text-decoration: line-through;} a {text-decoration: blink;} a {text-decoration: none;} Text-transform h1{text-transform:none;} h1{text-transform:capitalize;} h1{text-transform:lowercase;} h1{text-transform:uppercase;} Spacing (letter & word) p {letter-spacing: 8px;} p {word-spacing: 1.5em;}

CSS Color Values Color name color: red; background-color: olive; border-bottom-color: blue; RGB color Color: rgb(200, 178, 230); Text Shadow (CSS3) (not supported by earlier versions of IE) h1 { color: darkgreen; text-shadow:.2em.2em sliver;} (horizontal offset, vertical offset, optional blur radius and color) Hexadecimal colors Color: #FFCC00; Color: #FC0; White=#FFFFFF or #FFF (equivalent of 255,255,255) full blast Black=# or #000 (equivalent of 0,0,0) no light Hex: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F RGBa h1 {color: rgba(0,0,0,.5);} (50% transparency) a=alpha channel or the level of transparency (not support in IE8 and earlier)

The Box Model Block and inline elements are seen as being contained in rectangular boxes

CSS Padding, Borders, Margins Width & height of element Padding Border Margin

CSS box elements Width & height p {width: 400px; height: 100px; background: #C2F670;} overflow Less common to specify height |visible|hidden|scroll| p{ height: 15px; width: 15px; overflow: scroll;} Padding | top | right | bottom | left | Blockquote { padding-top: 1em; padding-right: 3em; padding-bottom: 1em; padding-left: 3em; } Shortcut blockquote{ padding: 1em 3em 1em 3em; } TRBL {padding: top right/left bottom;} {padding: 1em 3em 1em;} {padding: top/bottom right/left;} {padding: 1em 3em;} {padding: 15px;}

CSS box elements Border-style | top | right | bottom | left | |none | dotted | dashed | solid | double | | groove | ridge | inset | outset | h1 { border-bottom-style: solid; width: 300px;} Border-width |value | thin | medium | thick | h1{ border-bottom-width: 12px; border-style: solid; width: 300px:} Border-color| top | right | bottom | left | | value | h1 { border-color: aqua; border-bottom-style: solid; border-width: 6px; width: 300px;} shortcut |style | width | color | h1{ border-bottom: 1px solid; #663 }

CSS box elements margin | top | right | bottom | left | h1 { margin-top: 2em; margin-right: 250px; margin-bottom: 1em; margin-left: 4em; border: 1px solid red; } Remember border is around element & padding not margim

CSS Images Background-image Body { background-image: url(logo.gif); } Blockquote { background-image: url(logo.gif); border: 4px dashed; } Tiling |repeat | repeat-x | repeat-y | no-repeat | Body { background-image: url(logo.gif); background-repeat: no-repeat; } Background-position |value | left | center | right | top | bottom | Body { background-image: url(logo.gif); background-position: left bottom; } |value | Body { background-image: url(logo.gif); background-position: 200px 50px; } (distance from top-left corner) Background-attachment |scroll | fixed | Body { background-image: url(logo.gif); background-attachement: fixed; }

Let’s see how this works…