Cascade Style Sheet Demo. Cascading Style Sheets Cascading Style Sheets (CSS) is a simple mechanism for adding style (e.g., fonts, colors, spacing) to.

Slides:



Advertisements
Similar presentations
HTML and CSS. HTML Hyper Text Markup Language Tells browser how to display text and images.
Advertisements

HIGH LEVEL OVERVIEW: CSS CSS SYNTAX CONSISTS OF A SET OF RULES THAT HAVE 3 PARTS: A SELECTOR, A PROPERTY, AND A VALUE. IT’S NOT NECESSARY TO REMEMBER THIS.
CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
Web Pages Week 10 This week: CSS Next week: CSS – Part 2.
Cascade Style Sheet Demo ISYS 350. Cascading Style Sheets Cascading Style Sheets (CSS) is a mechanism for adding style (e.g., fonts, colors, spacing)
Cascading Style Sheets
Cascading Style Sheets
/k/k 1212 Cascading Style Sheets Part one Marko Boon
1 Cascading Style Sheets™ (CSS) Outline 5.1 Introduction 5.2 Inline Styles 5.3 Embedded Style Sheets 5.4 Conflicting Styles 5.5 Linking External Style.
Today CSS HTML A project.
Introducing CSS CIS 133 mashup Javascript, jQuery and XML 1.
CSS. Intro to CSS Cascading Style Sheets – styles and enhances appearance of webpage.css extension.
Introduction to CSS. What is CSS? A CSS (cascading style sheet) file allows you to separate your web sites (X)HTML content from it’s style. Use your (X)HTML.
Murach's PHP and MySQL, C1© 2010, Mike Murach & Associates, Inc.Slide 1.
Very quick intro HTML and CSS. Sample html A Web Title.
Cascading Style Sheets (CSS): Pixel-Level Control with HTML Ease
CHAPTER 8 ADVANCED CSS. LEARNING OBJECTIVES Assign formatting styles to a CSS class definition Use a tag’s class attribute to apply the styles defined.
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.
HyperText Markup Language (HTML) Uses plain text to add markup instructions to a file. If you can't produce it with a standard keyboard, it can't go into.
Cascading Style Sheets By: Valerie Kuna. What are Cascading Style Sheets? Cascading Style Sheets (CSS) are a standard for specifying the presentation.
Web Development & Design Foundations with XHTML Chapter 7 Key Concepts.
1 Web Developer & Design Foundations with XHTML Chapter 9 Key Concepts.
End User Computing An Introduction to CSS Sujana Jyothi Research Lab1, Callan Building, Department of Computer Science
Advance CSS (Menu and Layout) Miftahul Huda. CSS Navigation MENU It's truly remarkable what can be achieved through CSS, especially with navigation menus.
CSS BASICS. CSS Rules Components of a CSS Rule  Selector: Part of the rule that targets an element to be styled  Declaration: Two or more parts: a.
Building a Website: Cascading Style Sheets (CSS) Fall 2013.
Cascading Style Sheets Based on Castro, HTML for the WWW, 6 th edition Ron Gerton, Fall 2007.
1 Pengantar Teknologi Internet W03: CSS Cascading Style Sheets.
CIS 1310 – HTML & CSS 6 Layout. CIS 1310 – HTML & CSS Learning Outcomes  Describe & Apply the CSS Box Model  Configure Float with CSS  Designate Positioning.
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.
1/18 ITApplications XML Module Session 5: Extensible Stylesheet Language (XSL)
1 Dreamweaver CS5 intermediate class by Cookie Setton Build a CSS website WITHOUT TABLES Just when you thought you were starting to understand HTML coding,
Web Pages and Style Sheets Bert Wachsmuth. HTML versus XHTML XHTML is a stricter version of HTML: HTML + stricter rules = XHTML. XHTML Rule violations:
“Cascading Style Sheets” for styling WWW information DSC340 Mike Pangburn.
กระบวนวิชา 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.
Class four: the box model and positioning. is an HTML tag which allows you to create an element out of inline text. It doesn’t mean anything! try it:
Unit 20 - Client Side Customisation of Web Pages
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
Web Design with Cascading Style Sheet Lan Vu. Overview Introduction to CSS Designing CSS Using Visual Studio to create CSS Using template for web design.
More CSS CS HTML id attribute 2 Coding Horror! Our mission is to combine programming and “human” factors with geekiness! output  A unique ID for.
Beginning Web Site Creation: Dreamweaver CS4. XHTMLCSS  Describes the structure  Content  Collection of styles  Formatting body { background-color:
4.01 Cascading Style Sheets
Creating Web Pages with HTML and CSS ISY 475. HTML Introduction History: – Standard.
Principles of Web Design 6 th Edition Chapter 4 – Cascading Style Sheets.
Cascade Style Sheet Demo ISYS 350. Cascading Style Sheets Cascading Style Sheets (CSS) is a mechanism for adding style (e.g., fonts, colors, spacing)
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
Cascade Style Sheet Demo ISYS 350. Cascading Style Sheets Cascading Style Sheets (CSS) is a mechanism for adding style (e.g., fonts, colors, spacing)
Cascade Style Sheet Demo W3Schools.com: ISYS 350.
CSS Introductions. Objectives To take control of the appearance of a Web site by creating style sheets. To use a style sheet to give all the pages of.
WebD Introduction to CSS By Manik Rastogi.
CSS.
Style Sheets.
4.01 Cascading Style Sheets
Creating Your Own Webpage
CSS Rule Selector Declaration Block Value Attribute Name body {
>> Introduction to CSS
Cascading Style Sheets
Cascading Style Sheets (Layout)
Cascading Style Sheets
IS333: MULTI-TIER APPLICATION DEVELOPMENT
The Internet 10/13/11 The Box Model
Cascade Style Sheet Demo W3Schools. com: w3schools
The Internet 10/6/11 Cascading Style Sheets
Web Development & Design Foundations with H T M L 5
How to use the CSS box model for spacing, borders, and backgrounds
Principles of Web Design 5th Edition
4.01 Cascading Style Sheets
Introduction to Cascading Style Sheets (CSS)
Cascade Style Sheet Demo W3Schools. com: w3schools
Presentation transcript:

Cascade Style Sheet Demo

Cascading Style Sheets Cascading Style Sheets (CSS) is a simple mechanism for adding style (e.g., fonts, colors, spacing) to Web documents. A style sheet consists of a list of rules. Each rule or rule-set consists of one or more selectors, and a declaration block.

Selector Examples All elements of a specific type: – H1 { color: blue } ID as a selector: with a preceding '#': – HTML: – Style: #content { width: 450px; margin: 0 auto; padding: 15px; background: white; border: 2px solid navy; }

Class As Selector Example 1: – HTML: Center-aligned heading – Style: with a preceding “.”.center{ text-align:center; } Example 2: For a specific element – HTML: – Style: ul.nav { list-style-type: none; margin-left: 0; padding-left: 0; }

Pseudo Class Selector : pseudo-classes are used to add special effects to some selectors. For example, change color when mouse is over the element, a:hover {color:#FF00FF;} table:hover {color:red;} td:hover {color:blue;} Others:

CSS MIME Type Multipurpose Internet Mail Extensions (MIME) is an Internet standard of content type system. CSS MIME type: – text/css Example: referencing a CSS file using the element inside the head section

Example: Page View

HTML Code Product Discount Calculator Product Description: List Price: Discount Percent: %

body { font-family: Arial, Helvetica, sans-serif; margin: 10px; padding: 0; } #content { width: 450px; margin: 0 auto; padding: 15px; background: white; border: 2px solid navy; } h1 { color: navy; } label { width: 10em; padding-right: 1em; float: left; } #data input { float: left; width: 15em; margin-bottom:.5em; } #buttons input { float: left; margin-bottom:.5em; } br { clear: left; }

HTML Element Object Properties: className property style property Assuming we have two classes: –.evenColor {color:red;} –.oddColor {color:black;} Example of assigning className value dynamically using code. var row = table.insertRow(rowCount); if(count % 2 == 0){ row.className = "evenColor"; } else{ row.className = "oddColor"; } Example of assigning style property using code: var boxFV=document.getElementById('FV'); fv=myPV*Math.pow(1+myRate,myYear); if (fv>1000) boxFV.style.backgroundColor = "red"; else boxFV.style.backgroundColor = "green";

Loan Affordability Analysis

HTML Code Loan Affordability Analysis Enter Loan: Enter Rate: Enter Term: Enter Affordable payment: Payment is:

computePmt() function computePmt(){ Loan=parseFloat(document.getElementById("Loan").value); Rate=parseFloat(document.getElementById("Rate").value); Term=parseFloat(document.getElementById("Term").value); Afford=parseFloat(document.getElementById("Afford").value); Pmt=(Loan*Rate/12)/(1-Math.pow(1+Rate/12,-12*Term)); var boxPmt=document.getElementById("Pmt"); if (Pmt>Afford) boxPmt.style.backgroundColor="red"; else boxPmt.style.backgroundColor="green"; boxPmt.value=Pmt.toFixed(2); }

CSS File div { width: 450px; margin: 0 auto; padding: 15px; background: aqua; border: 2px solid navy; } p {font-weight:bold;}

function showTable(){ value=eval(document.depForm.pValue.value); life=eval(document.depForm.pLife.value); depreciation = value / life; var table = document.getElementById('depTable'); var totalDepreciation=0; for(var i = table.rows.length - 1; i > 0; i--) { table.deleteRow(i); } for (count = 1; count <= life; count++) { var rowCount = table.rows.length; var row = table.insertRow(rowCount); if(count % 2 == 0){ row.className = "evenColor"; }else{ row.className = "oddColor"; } var cell0 = row.insertCell(0); cell0.innerHTML=count; var cell1 = row.insertCell(1); cell1.innerHTML="$" + value.toFixed(2); var cell2 = row.insertCell(2); cell2.innerHTML="$" + depreciation.toFixed(2); totalDepreciation += depreciation; var cell3 = row.insertCell(3); cell3.innerHTML="$" + totalDepreciation.toFixed(2); value -= depreciation; }

Body Section Straight Line Depreciation Table Enter Property Value: Enter Property Life_: Year Value at BeginYr Dep During Yr Total to EndOfYr

CSS File #content { width: 650px; margin: 0 auto; padding: 15px; background: aqua; border: 2px solid navy; } table:hover {color:blue;} td:hover {color:blue;} table { border:1px solid green; margin: 0 auto; }.evenColor {color:red;}.oddColor {color:black;} p { font-size: 200; font-weight: bold; text-align: center; text-decoration: underline; }

Tutorials W3C: – properties properties W3Schools.com: –