introduction to css

9
Introduction to CSS Mr. Smyth Stoneham High School HS7535 – Video Game Web Design

Upload: richard-smyth

Post on 14-Jun-2015

466 views

Category:

Education


1 download

DESCRIPTION

introduction to CSS for my Video Game Web Design class at Stoneham High School in Stoneham, MA

TRANSCRIPT

Page 1: Introduction to CSS

Introduction to CSSMr. Smyth

Stoneham High School

HS7535 – Video Game Web Design

Page 2: Introduction to CSS

CSS – Cascading Style Sheets

• Language used to describe appearance and formatting of your HTML

• “Stylesheet” is the file describing how the HTML file should look

• “Cascading” means that you can apply formatting when more than one style applies

Page 3: Introduction to CSS

Three Ways to Incorporate CSS

• External Style Sheet – as a separate file referenced via <link> tag within the <head> tags

• Internal Style Sheet – within the <head> tags

• Inline Styling – within tags as attributes

Page 4: Introduction to CSS

Direction of the Cascade

• Inline Styling overrides an Internal Stylesheet

• Internal Stylesheet overrides an External Stylesheet

•Cascading allows you to specify global settings while making local changes as needed or desired

Page 5: Introduction to CSS

1st Method: Examples of Inline Styling•<p style=“color: red”>Red font color

here</p>

•<h1 style=“text-align: center”>Centered Header</h1>

• Limitations: formatting changes have to be made for each element

Page 6: Introduction to CSS

2nd Method: Example of Internal Stylesheet

Page 7: Introduction to CSS

3rd Method: External Stylesheet• Separate file with CSS code

• File is named with .css extension: somename.css

•Must have the following in between <head> tags:

<link type=“text/css” rel=“stylesheet” href=“name.css”>

• Stylesheet name is often simply stylesheet.css

•Advantage: changes made to .css file apply to entire website

Page 8: Introduction to CSS

CSS Syntax

Page 9: Introduction to CSS

CSS Syntax Variant