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.

Slides:



Advertisements
Similar presentations
LIS901N: Style sheet Thomas Krichel Style sheets Style sheets are the officially sanctioned way to add style to your document We will cover.
Advertisements

Cascading Style Sheets
Cascading Style Sheets CSS. Learning outcome CSS – Introduction – Motivation – Advantages – Implementation – Classes & Ids – and – General Model – Validation.
1 © Netskills Quality Internet Training, University of Newcastle Introducing Cascading Style Sheets © Netskills, Quality Internet.
HTML and CSS. HTML Hyper Text Markup Language Tells browser how to display text and images.
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-Formatting Review Cascading Style Sheets addstyle to your HTML web pages.
Intro To Cascading Style Sheets By Mario Yannakakis.
CSS Basics Style and format your web site using CSS.
CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
Web Engineering 1 Ishaq Khan Shinwari MCS City University Peshawar.
Cascading Style Sheets
Today CSS HTML A project.
CSS CSS stands for Cascading Style Sheets Styles define how to display HTML elements External Style Sheets can save a lot of work External Style Sheets.
Introduction to CSS.
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.
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 Basics. Why use Cascading Style Sheets? Allows you to set up a series of rules for all pages in a site. The series may be changed.
Cascading Style Sheets By: Valerie Kuna. What are Cascading Style Sheets? Cascading Style Sheets (CSS) are a standard for specifying the presentation.
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.
1 Pengantar Teknologi Internet W03: CSS Cascading Style Sheets.
Cascading Style Sheet CSS CS1520 Ali Alanjawi. 2 TA Information Ali Alanjawi Homepage: Office:
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.
Chapter 8 Creating Style Sheets.
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.
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.
Using Cascading Style Sheets CSS Structure. Goals Understand how contextual, class and ID selectors work Understand how contextual, class and ID selectors.
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.
1 What is CSS?  CSS stands for Cascading Style Sheets  Styles define how to display HTML elements  Styles are normally stored in Style Sheets  Styles.
Using Cascading Style Sheet As you create more web pages, you may wish to impose a consistent look for all of your web pages or for group of related pages.
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.
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.
WebD Introduction to CSS By Manik Rastogi.
CSS.
Cascading Style Sheets
CSS for Styling By Jinzhu Gao.
CS3220 Web and Internet Programming CSS Basics
The Internet 10/11/11 Fonts and Colors
Cascading Style Sheets™ (CSS)
( Cascading style sheet )
Madam Hazwani binti Rahmat
Using Cascading Style Sheets Module B: CSS Structure
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Introduction to Web programming
CSS – Properties & Values
The Internet 10/13/11 The Box Model
CSS Style Sheets: Intro
Stylin’ with CSS.
Cascading Style Sheets Color and Font Properties
Cascading Style Sheets™ (CSS)
Tutorial 3 Working with Cascading Style Sheets
CS3220 Web and Internet Programming CSS Basics
CS3220 Web and Internet Programming CSS Basics
Cascading Style sheet. What is CSS?  CSS stands for Cascading Style Sheets  Cascading: refers to the procedure that determines which style will apply.
Lesson 5 Topic B – Basic Text & Fonts
Stylin’ with CSS.
Stylin’ with CSS.
Session IV Chapter 15 - How Work with Fonts and Printing
Introduction to Cascading Style Sheets (CSS)
Cascading Style Sheets™ (CSS)
Cascading Style Sheets
Presentation transcript:

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 associated web pages) Like HTML, it is a language It is primarily used for layouts, colors, and fonts It can be applied to HTML, XML, XHTML and some other languages It may be linked separately or embedded in the section of your HTML

Why use CSS? With style sheets, one only needs to specify such presentational preferences once, and the style can be applied to an entire site. Style sheets also offer much more flexibility in terms of the presentation effects that they provide. A style sheet is made up of style rules that tell a browser how to present a document. CSS is validated in HTML 4, and some elements are valid in HTML 3.2. Browsers that don’t support CSS will ignore it.

So CSS format looks like this:

Grouping selectors is CSS In order to decrease repetitious statements within style sheets, grouping of selectors is allowed. For example, all of the headings in a document could be given identical declarations through the use of combined selectors:  H1, H2, H3, H4, H5, H6 { color: red; font-family: sans-serif }  h1,h2,p { color:green; }  A:link, A:visited, A:active {text-decoration: blink}

Examples of CSS Selectors & Properties Body background image & color  BODY { background: url(foo.gif) red; color: black } Large drop cap first letter  P:first-letter { font-size: 300%; float: left } Link:  A:link { color: red } Active link:  A:active { color: blue; font-size: 125% } Visited link:  A:visited { color: green; font-size: 85% }

Font Properties & Values Family-name (Ariel, Times New Roman, Helvetica) Generic-family (serif, sans serif, fantasy, monospace)  P { font-family: "New Century Schoolbook", serif } Style (normal, italics, oblique)  H1 { font-style: oblique} Weight (bolder, lighter, 100, 300, 600, 800, etc.)  H1 { font-weight: 800 } Size (xx-small, large, x-large, larger, 12pt, 80%)  LI { font-size: 90%}

BG and Color Properties & Values Color (specifies color of element)  H2 { color: # } Background-color (specifies color of background)  BODY { background-color: white } Background-image (assigns an image to background)  BODY { background-image: url(/images/foo.gif)} Background-repeat (repeat-x, repeat-y, no-repeat)  BODY { background: white url(candybar.gif); background- repeat: repeat-x }  Repeats image horizontally

Text Properties & Values Text-decoration (underline, overline, line-through, blink)  A:link, A:visited, A:active {text-decoration: none} Vertical-align ( sub, super, top, middle, bottom, 50%)  IMG.middle { vertical-align: middle} Text-align (center, justify, left, right)  H1 { text-align: center} Text-indent (any number)  P { text-indent: 5em}

How to place your style sheet Style sheets are linked to from your HTML page Sheets should be saved as “style.css” The link indicates the HREF and type of file. In your document’s section, insert the CSS link: 

Single or Multiple line CSS Some CSS is written using multiple lines: h1 { float: left; width: 155px; height: 50px; }  How you write your CSS is entirely up to you, but multi-line CSS makes scanning for selectors, properties, and values much easier  It's good practice to place a semicolon after every declaration, including the last one so you can easily add properties

Here’s some fun CSS Custom cursor  { cursor: url(mycursor.cur) }  Replace “mycursor.cur” with your file name (must be.cur or.ani file)  Downloadable.ani here: Dotted underline  A:hover { COLOR: #518293; border-bottom:1px dotted #FFFFFF;} Change the browser’s scrollbar  { scrollbar-face-color: #000000; scrollbar-shadow-color: #BED8BF; scrollbar-highlight-color: #BED8BF; scrollbar- 3dlight-color: #000000; scrollbar-darkshadow-color: #000000; scrollbar-track-color: #000000; scrollbar-arrow- color: #BED8BF}