Cascading Style Sheets

Slides:



Advertisements
Similar presentations
Introduction to HTML & CSS
Advertisements

Intro To Cascading Style Sheets By Mario Yannakakis.
CSS. CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to solve a problem External Style.
CHAPTER 7 STYLING CONTENT WITH CASCADING STYLE SHEETS.
Cascading Style Sheets Understanding styles. The term cascading describe the capability of a local style to override a general style. CSS applies style.
Ch. 5 Web Page Design – Templates and Style Sheets Mr. Ursone.
Introducing Cascading Style Sheets  Cascading Style Sheet Basics  Creating Styles  Using Styles  Manipulating Styles  Text Formatting with CSS.
XP 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
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.
Tutorial 3: Adding and Formatting Text. 2 Objectives Session 3.1 Type text into a page Copy text from a document and paste it into a page Check for spelling.
Using Cascading Style Sheets (CSS) Dept. of Computer Science and Computer Information CSCI N-100.
Dreamweaver MX. 2 Creating External Style Sheets-1 (p. 400) n A style is a group of formatting attributes identified by a single name. n An ________ style.
Cascading Style Sheets Dreamweaver. Styles Determine how the HTML code will display Determine how the HTML code will display Gives designers much more.
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.
Chapter 3 Working with Text and Cascading Style Sheets.
Copyright © Texas Education Agency, All rights reserved. 1 Web Technologies Website Development with Dreamweaver.
Dreamweaver -- CSS. Dreamweaver -- MX New icons are added in MX Most of the features commonly used in web design, and are same as FrontPage. New feature.
Using Styles and Style Sheets for Design
Cascading Style Sheets. Defines the presentation of one or more web pages Similar to a template Can control the appearance of an entire web site giving.
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.
Css. Definition Cascading style sheet (CSS) Cascading Style Sheets (CSS) is a simple mechanism for adding style (e.g. fonts, colors, spacing) to Web documents.
© 2011 Delmar, Cengage Learning Chapter 8 Using Styles and Design Style Sheets for Design.
Cascading Style Sheets Part 1. CSS vs HTML HTML: Originally intended to markup structure of a document (,...,,,,,...) CSS Developing technology, CSS1,
CS134 Web Design & Development Cascading Style Sheets (CSS) Mehmud Abliz.
Css. Definition Cascading style sheet (CSS)  It is a simple mechanism for adding style (e.g. fonts, colors, spacing) to Web documents.
Project 4: Yosemite CSS Layout
Introducing Cascading Style Sheets. Cascading Style Sheet Basics  Cascading Style Sheet Basics  Creating Styles  Using Styles  Manipulating Styles.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
1 © Netskills Quality Internet Training, University of Newcastle Using Style Sheets in Dreamweaver CS © Netskills, Quality Internet Training, University.
Tutorial 3 Adding and Formatting Text with CSS Styles.
Cascading Style Sheets CSS. Source W3Schools
Cascading Style Sheets (CSS). A style sheet is a document which describes the presentation semantics of a document written in a mark-up language such.
CNIT 132 – Week 4 Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of.
Microsoft Expression Web 3 – Illustrated Unit D: Structuring and Styling Text.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
NASRULLAHIBA.  It is time to take your web designing skills to the next level with Cascading Style Sheets (CSS). They are a way to control the look and.
XP Dreamweaver MX 2004 Tutorial 3 1 Adding and Formatting Text.
Tutorial 3 Adding and Formatting Text. Objectives Session 3.1 – Type text into a page – Copy/paste text from a Word document – Check for spelling errors.
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…
Working with Cascading Style Sheets
4.01 Cascading Style Sheets
>> Introduction to CSS
Introduction to CSS.
Madam Hazwani binti Rahmat
>> CSS Rules Selection
CX Introduction to Web Programming
Using Cascading Style Sheets Module B: CSS Structure
Introduction to web design discussing which languages is used for website designing
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Cascading Style Sheets - Building a stylesheet
Introduction to Cascading Style Sheets (CSS)
Working with Text and Cascading Style Sheets
Working with Cascading Style Sheets (CSS)
Working with Cascading Style Sheets (CSS)
Using Cascading Style Sheets (CSS)
Tutorial 3 Working with Cascading Style Sheets
Web Design and Development
Exercise 9 Skills You create and use styles to create formatting rules that can easily by applied to other pages in the Web site. You can create internal.
Introduction to CSS.
Chapter 6 Introducing Cascading Style Sheets
Made By : Lavish Chauhan & Abhay Verma
Cascading Style Sheets - Building a stylesheet
4.01 Cascading Style Sheets
5.00 Apply procedures to organize content by using Dreamweaver. (22%)
CS332A Advanced HTML Programming
Presentation transcript:

Cascading Style Sheets Understanding styles

CSS applies style formatting to your page in one of three ways: The term cascading describe the capability of a local style to override a general style. CSS applies style formatting to your page in one of three ways: Via an external, linked styled sheet Via an embedded style Via inline style rules External Style Sheets =files containing the CSS rules; they link one or more Web pages. One benefit to linking to an external style sheet –you can customize and change the appearance of all pages easily from one file. They are recommended. Embedded Styles are those typically written into the actual file at the top of the web page within a <style>…</style> tag pair. (however, they can be placed anywhere on the page) Inline Styles are inserted within HTML tags using the style attribute- a technique known as inline styles ( the most local-> has the ultimate control) These two last categories are also called internal styles

External style sheets –can use 2 methods: The link method: a line of code is added outside of the <style> tags: <link href=‘mainstyle.css” rel=“style sheet” type=“text/css”> The import method writes code within the style tags, as follows: <style type=“text/css”> <!— @import url (“newstyles.css”);  </style> The <style> tag for a Cascading Style Sheet identifies the type attribute as text/css.

Embedded styles Sample: <style type="text/css"> <!-- a:link { color: #FF3300; } a:visited { color: #993300; a:hover { color: #FF9900;

Inline styles: Sample: <div id=“Layer1” style=“position :absolute; visibility: inherit; left: 314px;……..> </div>

Working with Internal Styles There are 3 different selector types( kinds of elements defined by styles) that can be used : Class: allows you to create classes that are not tied to any particular elements. You can apply a single class to many different elements. Classes are indicated by their initial period Tag: allows you to specify an HTML tag as the element that will be redefined by the style Advanced: allows you to create styles that are used for specific tag combinations (contextual selectors). It enables you to create IDs, which are similar to classes but they can only be used once per page as a way of defining or uniquely identifying a particular element. =>IDs are often used for scripting purposes and are indicated by #

Converting Internal Styles to External Styles Gives consistency from page to page The internal styles ( especially those with the same name) should be deleted before attaching an external style sheet, to avoid conflict, reduce the amount of code and reduce possibility of error and confusion: In the list of rules on the CSS Styles panel, select <style> and delete it

Linking to an Existing External Style Sheet How to do it: Attach the .css file in the styles panel The link option is selected by default when it is the first time attaching a style sheet Given the cascading nature of style sheets, the second style sheet has priority and overrides any conflicting styles in the first sheet. Likewise, a third style sheet overrides any conflicts in the first and second sheets.

Creating External Styles Creating Styles for Tag Combinations

Editing an Existing Style Web pages tell the browser which external style sheets to use for instructions on how to display the formatting. The styles are applied to the elements by the browser at the time that a file is seen by visitor. Any modifications are automatically reflected in every page that is attached to the edited style sheet at the time it is viewed. Because formatting values are contained in the style sheet, those values need to be modified in only that one location to affect all pages linked to the style sheet. This is useful because the appearance of an element such as text can be changed in several pages or entire site very quickly.

Working with Style Precedence The origin which is the source of style , is evaluated first: Browser defaults (lowest priority) Styles created by user Styles specified by the web page ( highest priority) The order of styles concerns where styles are located: External CSS styles Internal CSS styles Inline CSS styles Local HTML formatting ( the formatting which is closest to the text; highest priority-overrides any other options set in the styles above if there are conflicts)-no used anymore by Dreamweaver because the <font> tag is deprecated (marked for deletion) in HTML 4.0

Creating a basic CSS Layout CSS can be used in combination with, or as an alternative to, creating layouts with tables. The benefits: The ease and speed with which a CSS-based site can be updated A consistent appearance Less code Faster download time Increased accessibility Flexibility Efficiency (content—separated from the design and attributes that define appearance)