LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 8: Working with Style Sheets.

Slides:



Advertisements
Similar presentations
Cascading Style Sheets (CSS). Cascading Style Sheets With the explosive growth of the World Wide Web, designers and programmers quickly explored and reached.
Advertisements

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
Cascading Style Sheets
HTML Overview - Cascading Style Sheets (CSS). Before We Begin Make a copy of one of your HTML file you have previously created Make a copy of one of your.
CHAPTER 7 STYLING CONTENT WITH CASCADING STYLE SHEETS.
Chapter 3 – Designing your web pages Dr. Stephanos Mavromoustakos.
Project 8 Creating Style Sheets.
Introduction to CSS.
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.
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.
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 9: Defining Selectors.
CSW131 Steven Battilana 1 CSW 131 – Chapter 5 (More) Advanced CSS Prepared by Prof. B. for use with Teach Yourself Visually Web Design by Ron Huddleston,
กระบวนวิชา 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.
16 HTML Tables and Frames Section 16.1 Create a basic table using HTML Define borders Merge cells Align content in tables Section 16.2 Create a frames-based.
Cascading Style Sheets. Slide 2 Lecture Overview Overview of Cascading Style Sheets (CSS) Ways to declare a CSS CSS formatting capabilities New features.
1 Getting Started with CSS. 2 CSS Cascading Style Sheets XHTML provides structure for our documents (web pages) CSS provides Style or Presentation for.
XP 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
Cascading Style Sheets Controlling the Display Of Web Content.
4.01 Cascading Style Sheets
Working with Cascading Style Sheets. 2 Objectives Introducing Cascading Style Sheets Using Inline Styles Using Embedded Styles Using an External Style.
Using Cascading Style Sheets (CSS) Dept. of Computer Science and Computer Information CSCI N-100.
Working with Text and Cascading Style Sheets Adobe Dreamweaver Chapter 3.
Understanding HTML Style Sheets. What is a style?  A style is a rule that defines the appearance and position of text and graphics. It may define the.
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 2: Working with Webpage Files.
Basics of HTML.
Online Chapter 1 4 th Edition.  Review elements  Whitespace handling  Rule structure  Linking to an external style sheet  Alternate Style Sheets.
Chapter 11 Cascading Style Sheets: Part I The Web Warrior Guide to Web Design Technologies.
XP Tutorial 7New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks.
STYLING THE WEBSITE - EXTERNAL CSS BY JORGE MARTINEZ.
 ult.htm ult.htm  This website illustrates the use of CCS (style sheets)
Different ways to implement CSS. There are four different ways to use CSS in your web pages: – Inline CSS – Embedded CSS/Internal CSS – Linked CSS/External.
CSS Style Rules Guang Tong, Zhan L;lo’p[ Css Style Rule Guang Tong Zhan Three ways to insert CSS 1 External style sheet 2 Internal style sheet 3 Inline.
Chapter 3 Working with Text and Cascading Style Sheets.
Cascading Style Sheets (CSS) 1.  What is CSS?  Why CSS?  How to write a CSS? 2.
Using Styles and Style Sheets for Design
INTRODUCTION TO HTML5 CSS Styles. Understanding Style Sheets  HTML5 enables you to define many different types of content on a web page, including headings,
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.
Introduction To CSS.. HTML Review What is HTML used for? Give some examples of formatting tags in HTML? HTML is the most widely used language on the Web.
XP Dreamweaver 8.0 Tutorial 3 1 Adding Text and Formatting Text with CSS Styles.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
INTRODUCTION TO CSS. OBJECTIVES: D EFINE WHAT CSS IS. K NOW THE HISTORY OF CSS. K NOW THE REASON WHY CSS IS USED. CSS SYNTAX. CSS ID AND CLASS.
CSS CSS is short for C ascading S tyle S heets. It is a new web page layout method that has been added to HTML to give web developers more control over.
CSS Basic (cascading style sheets)
© 2011 Delmar, Cengage Learning Chapter 8 Using Styles and Design Style Sheets for Design.
CS134 Web Design & Development Cascading Style Sheets (CSS) Mehmud Abliz.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Tutorial 7.
HTML GUIDE Press F5 and then Click on the links on the left to get to the section you want Section 1: Getting Started Section 2: Moving Banner Section.
Introduction to CSS. What is CSS? CSS ("Cascading Style Sheets") determines how the elements in our XHTML documents are displayed and formatted. By using.
Cascading Style Sheets August 25-26, What is CSS? a means for web authors to separate the appearance of web pages from the content of web pages.
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 7: CSS Building Blocks.
CNIT 132 – Week 4 Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
Introduction. MIS 5450 Behavioral Layer JavaScript and DOM Structural Layer XHTML Presentation Layer CSS Design Development Process.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
1 Cascading Style Sheet (CSS). 2 Cascading Style Sheets (CSS)  a style defines the appearance of a document element. o E.g., font size, font color etc…
Getting Started with CSS
4.01 Cascading Style Sheets
>> Introduction to CSS
Madam Hazwani binti Rahmat
Website Design 3
Cascading Style Sheets - Building a stylesheet
Using Cascading Style Sheets (CSS)
Some Stuff You Need to Know
Cascading Style Sheets - Building a stylesheet
4.01 Cascading Style Sheets
One Set of Styles Connected to As Many Pages as You Want!!!
Presentation transcript:

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 8: Working with Style Sheets

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE Objectives Create CSS style sheets. Apply CSS to HTML pages using external style sheets. Understand the basic style rule of location. Identify !important and user style sheet exceptions. Employ media-specific style sheets. Define persistent, preferred, and alternate style sheets. View other designers’ CSS code.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE Working with Style Sheets Create a style sheet file and apply CSS to multiple webpages, a single page, or an individual HTML element. Three methods: –External Style Sheets (preferred choice) –Embedded Style Sheets –Inline Styles (least desirable)

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE Creating an External Style Sheet External style sheet: A separate page that holds all CSS styles to be loaded into one or more pages. –Preferred method. Set each page on the site to load the same external sheet. –Ensures each page has the same settings and a consistent look.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE To Create an External Style Sheet Create new text document in text editor. Define style rules for webpages. –Option: Include CSS comments. Save document in text-only format in desired directory. –Document extension must be.css for a Cascading Style Sheet.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE Linking to External Style Sheets Load a style sheet into HTML pages to apply style rules to content. Best way to do so is to link to the style sheet. –Link element goes inside head section of HTML document. –Style rule (a solid red border four pixels thick) is applied to each img element. –Other documents can link to same external style sheet.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE To Link an External Style Sheet Type <link rel="stylesheet" in head section of each HTML page. Type a space and then href="url.css” –url.css is the location and name of the CSS style sheet. Type a space and the final /> –Or, type no space and simply > HTML5 allows both approaches and they work exactly the same.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE Creating an Embedded Style Sheet Embedded style sheet: –Second way to apply CSS to a page. –Sets the styles directly in HTML document. –Typically goes in the page’s head. Because styles are only in HTML file: –CSS won’t apply to other pages. –Lacks same caching benefits.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE To Create an Embedded Style Sheet Type in the head section of your HTML document. Define as many style rules as desired. Type to complete the embedded style sheet.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE Applying Inline Styles Inline styles are the third way to apply CSS to HTML. Least desirable option: –Mixes content (HTML) and presentation (CSS). –Only affects one element. –Means sifting through HTML pages to make simple changes. Inline styles: –Aren’t intended for regular use. Use to perform a quick test before placing a style in an external style sheet.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE To Apply Styles Inline Type style=" within HTML element to be formatted. –Add it to the start tag of non-void elements. Create a style rule without curly brackets or selector. –Selector isn’t needed since you’re placing it directly inside the element. –If your rule has more than one declaration, separate each one by typing ; (a semicolon). Type the final quote mark ".

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE The Cascade and the Order of Styles Basic rule: With all else equal, the later the style appears, the greater its precedence or importance. How that plays out: –Relationship between an embedded style sheet and any linked external style sheets depends on their relative positions in HTML. –Inline styles take precedence, overriding any conflicting styles applied elsewhere. –Exception: A style marked !important always wins, whether first or last in order.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE Using Media-Specific Style Sheets Media-specific style sheets designate a style sheet for a particular output. –Create style sheets for printing or for viewing in browser. –Can make a general style sheet with common features for both print and screen, and then print and screen style sheets with respective individual properties.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE To Designate Media-Specific Style Sheets Add media="output" to link or style start tags. –Output is one or more of the following: print, screen, or all. These are the most common types, though others exist Separate multiple values with commas. at-rule in a style sheet is another way to target other media types. Does not require specifying a media type in the link element.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE The Inspiration of Others: CSS To view others’ CSS code: –First view the page’s HTML code. If the CSS code is in an embedded style sheet, you’ll be able to see it already. –If the CSS is in an external style sheet, locate the reference to it in the HTML and click the file name. –The style sheet displays in the browser window. –You can copy it from there and paste it into your text editor if you like.

LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE View CSS in Browser