Stylin’ with CSS.

Slides:



Advertisements
Similar presentations
WEB PAGES: CREATING AND MAINTAINING ** Frank Romanelli Instructor: Wednesday: 10:15 -11:15 Week 3.
Advertisements

CSS-Formatting Review Cascading Style Sheets addstyle to your HTML web pages.
Intro To Cascading Style Sheets By Mario Yannakakis.
CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
Cascading Style Sheets. Next Level Cascading Style Sheets (CSS) - control the look and feel of your HTML documents in an organized and efficient manner.
Cascading Style Sheets
Cascading Style Sheets (CSS) “Styles” for short. Pg. 418.
Cascading Style Sheets
Part 2 Introduction to CSS. CSS Syntax – class selector 1 With the class selector you can define different styles for the same type of HTML element. You.
CSS. CSS, or Cascading Styles Sheets, is a way to style HTML. Whereas the HTML is the content, the style sheet is the presentation of that document.
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.
Cascading Style Sheets Based on Castro, HTML for the WWW, 6 th edition Ron Gerton, Fall 2007.
Stylin’ with CSS. 2 Topics What is CSS? Why CSS? CSS Examples.
Introduction to Cascading Style Sheets (CSS) Module 2: HTML Basics LESSON 4.
Web Workshop: CSS Objectives: - “What is CSS?” - Structure of CSS - How to use CSS in your webpage.
Workshop: CSS-Part I Cascading Style Sheets add style to your HTML web pages.
WEB PAGES: CREATING AND MAINTAINING ** Tom Keane & Mayis SeapanInstructors: HTML Tags to format your text.
3.1 Cascading Style Sheets. Motto Fashions fade, style is eternal. —Yves Saint Laurent.
Stylin’ with CSS. 2 Topics What is CSS? Why CSS? CSS Examples.
HIGHER COMPUTING CSS. WHAT IS CSS? CSS: Cascaded Style Sheets used to separate a web site’s content(information) from its style(how it looks).
Stylin’ with CSS Monday October 8 th and Tuesday October 9 th.
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
CSS Cascading Style Sheets *referenced from
CSS DHS Web Design. Location Between the & Start with – End with –
CSS Cascading Style Sheets. Session Checklist ► Learn why style sheets are needed and their advantages and disadvantages ► Learn the format of a style.
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.
WEB FOUNDATIONS CSS Overview. Outline  What is CSS  What does it do  Where are styles stored  Why use them  What is the cascade effect  CSS Syntax.
WebD Introduction to CSS By Manik Rastogi.
HTML WITH CSS.
CSS for Styling Text.
CSS for Styling By Jinzhu Gao.
Web Development & Design Foundations with XHTML
Cascading Style Sheets Color and Font Properties
The Internet 10/11/11 Fonts and Colors
HTML WITH CSS.
Creating Your Own Webpage
Cascading Style Sheets
Introduction to CSS.
Cascading Style Sheets
Web Development & Design Foundations with HTML5
Introduction to the Internet
Cascading Style Sheets
INTRODUCTION TO HTML AND CSS
Chapter 3 Style Sheets: CSS
Web Developer & Design Foundations with XHTML
Cascading Style Sheets
Cascading Style Sheets (CSS)
Introduction to Web programming
Intro to CSS CS 1150 Fall 2016.
Cascading Style Sheet (CSS)
Introduction to CSS.
Introduction to Web programming
Intro to CSS CS 1150 Spring 2017.
The Internet 10/13/11 The Box Model
Software Engineering for Internet Applications
CSS Style Sheets: Intro
Stylin’ with CSS.
Cascading Style Sheets Color and Font Properties
Introduction to Cascading Style Sheets (CSS)
Web Programming– UFCFB Lecture 11
What are Cascading Stylesheets (CSS)?
INTRODUCTION TO HTML AND CSS
Tutorial 3 Working with Cascading Style Sheets
CSS Styles Fonts and Colors.
Introduction to CSS.
Cascading Style Sheets
Stylin’ with CSS.
Presentation transcript:

Stylin’ with CSS

Topics What is CSS Why CSS CSS Examples

What is CSS? Stands for Cascading Style Sheets Used to change the “presentation” of a Web page Used in conjunction with HTML in several ways Inline -- embedded within the HTML element Internal -- placed within the header information External -- coded in a separate document Allows style control of multiple pages all at once

HTML vs. CSS HTML intended to show what the text is being used for Defines it’s semantic meaning Designed to say things like “This is a paragraph” not “This is a paragraph that is centered with a font color of blue” CSS used for presentation only Defines how the HTML should be displayed

Internal Style Placed in the header of the page between the <head>…</head> tags. Contains styles that are used throughout the whole page rather than on a single tag. Enclose each “rule” in the <style>…</style> tag.

Internal Style Example <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/transitional.dtd”> <html> <head> <title>CMSC104 HTML Template</title> <style type=“text/css”> h1{ font-family: verdana; text-align: center; } </style> </head> <body>

A Closer Look at the Style <style type=“text/css”> h1{ font-family: verdana; text-align: center; } </style> selector value property rule How many attributes does the style tag have in this example?

Changing the Font Face Use the font-family property Will only display fonts already installed on the end user’s computer If a font-family is not specified, displays the browser’s default font, usually Times New Roman. Can give more than one value in the CSS, just in case To see a list of Web fonts: http://www.angelfire.com/al4/rcollins/style/fonts.html More information than you ever wanted to know about fonts: http://www.w3.org/TR/REC-CSS2/fonts.html

Font Example <html> <head> <title>CMSC104 HTML Template</title> <style type=“text/css”> body{ font-family: verdana, helvetica, arial, sans-serif; } </style> </head> <body> Do you like this font? </body> </html>

Font Example Screenshot

Chart of possible CSS color values Working with Color background-color -- changes the background color color -- changes the text color Can be applied to most selectors. ie: body, p, etc... black lime maroon purple white olive navy teal silver green red fuchsia gray yellow blue aqua orange Chart of possible CSS color values

Color Example <html> <head> <title>CMSC104 HTML Template</title> <style type=“text/css”> body{ background-color: black; color: orange; } </style> </head> <body> Happy Halloween!! </body> </html>

Color Example Screenshot

Changing the Font Size Sample Usage Possible values font-size: 14pt; Can use number and unit (as in 12pt) or keywords: xx-small, x-small, small, medium, large, x-large, xx-large. (There are other possibilities but we won’t be discussing them now.)

Aligning text Sample Usage Possible values text-align: center; left, right, center, justify

CSS for Emphasis Sample Usage Possible values font-style: italic; normal, italic, oblique font-weight: bold; normal, bold, bolder, lighter

CSS Comments You can place a comment in CSS by using the following syntax: <style type=“text/css”> /* body layout */ body{ background-color: black; color: orange; } </style>

Example with Multiple Rules <html> <head> <title>CMSC104 CSS Example</title> <style type=“text/css”> body{ color: purple; } h1{ color: red; </style> </head> <body> <h1>What color is this Heading?</h1> What color am I? </body> </html>

Multiple Rule Screenshot