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.

Slides:



Advertisements
Similar presentations
Introduction to HTML & CSS
Advertisements

CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
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.
CSS: Separating Design and Content Kevin Campbell Duke University/Grouchyboy.com.
Cascading Style Sheets
CHAPTER 7 STYLING CONTENT WITH CASCADING STYLE SHEETS.
กระบวนวิชา 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.
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.
Using Cascading Style Sheets (CSS) Dept. of Computer Science and Computer Information CSCI N-100.
Cascading Style Sheet. What is CSS? CSS stands for Cascading Style Sheets. CSS are a series of instruction that specify how markup elements should appear.
Working with Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of a document.
Cascading Style Sheets (CSS) Instructor: Mr. Ahmed Al Astal ITGD4104 Department Requirement for senior student University of Palestine Faculty of IT.
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.
 ult.htm ult.htm  This website illustrates the use of CCS (style sheets)
The Characteristics of CSS
Styles with Cascading Style Sheets (CSS) Web Design – Section 4-1 Part or all of this lesson was adapted from the University of Washington’s “Web Design.
INTERNAL CSS Casey Ames Different types of CSS There are three different types of CSS: ◦ External CSS ◦ Internal CSS ◦ Inline CSS In this presentation.
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.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
The format is text files, with.htm or.html extension. Hard returns, tabs, and extra spaces are ignored. DO NOT use spaces in file names. File names ARE.
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.
Working with Cascading Style Sheets (CSS) Module 2: HTML Basics LESSON 5.
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.
 cascade Style Sheets (CSS) is a mark-up language that was first proposed in 1994 by Håkon Wium Lie. CSS works in conjunction with HTML to greatly increase.
Internet Web Publishing III. Intro to Cascading Style Sheets Patricia Roberts.
Bare bones slide show. The format is text files, with.htm or.html extension. Hard returns, tabs, and extra spaces are ignored. DO NOT use spaces in file.
CS134 Web Design & Development Cascading Style Sheets (CSS) Mehmud Abliz.
Introduction to Cascading Style-sheets (CSS) Basharat Mahm ood, Department of Computer Science, CIIT,Islamabad, Pakistan 1.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Tutorial 7.
Css. Definition Cascading style sheet (CSS)  It is a simple mechanism for adding style (e.g. fonts, colors, spacing) to Web documents.
Professor Waterman Cascading Style Sheets (CSS) is a language that works with HTML documents to define the way content is presented. The presentation.
Use CSS to Implement a Reusable Design Selecting a Dreamweaver CSS Starter Layout is the easiest way to create a page with a CSS layout You can access.
INTRODUCTION TO CSS. TOPICS TO BE DISCUSSED……….  Introduction Introduction  Features of CSS Features of CSS  Creating Style Sheet Creating Style Sheet.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 8: Working with Style Sheets.
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.
DYNAMIC HTML What is Dynamic HTML: HTML code that allow you to change/ specify the style of your web pages. Example: specify style sheet, object model.
Introduction to CSS Brendan Knight. What is CSS Cascading Style Sheets (CSS) is a style sheet language used to describe the presentation semantics (the.
CNIT 132 – Week 4 Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of.
Cascading Style Sheets
Cascading Style Sheets (CSS) EXPLORING COMPUTER SCIENCE – LESSON 3-5.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
Practice for Chapter 3: Assume that you are a freelance web designer and need to create a website to promote your freelance company.
HTML5 and CSS3 Illustrated Unit C: Getting Started with CSS.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
What is CSS? A set of style rules that tell the web browser how to present a web page or document. – In earlier versions of HTML, style characteristics,
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…
Cascading Style Sheets - CSS December 20, 2008 NTPCUG Expression Web SIG.
CASCADING STYLE SHEET 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.
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.
Working with Cascading Style Sheets
Cascading Style Sheets (CSS)
Getting Started with CSS
4.01 Cascading Style Sheets
Madam Hazwani binti Rahmat
CASCADING STYLE SHEET CSS.
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Website Design 3
Web Programming– UFCFB Lecture 11
What are Cascading Stylesheets (CSS)?
Some Stuff You Need to Know
Web Design and Development
Made By : Lavish Chauhan & Abhay Verma
Web Design & Development
4.01 Cascading Style Sheets
Presentation transcript:

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 – Importing CSS

Inline CSS Inline styles are CSS styles that are applied to one element using the style attribute. CSS can be defined for single tags by simply adding style="style definition : style attribute;" to the tags. Inline CSS has the highest priority out of external, internal, and inline CSS. This means that you can override style rules that are defined in external or internal by using inline CSS

If you want to add a style inside an HTML element all you have to do is specify the desired CSS properties with the style HTML attribute. Syntax: <element style=“style1: value1; style2: value2; style3: value3;…”> Eg: Content

Advantages The only styles that have higher precedence. Inline styles are easy and quick to add. You don't need to create a whole new document (as with external style sheets) or edit a new element in the head of your document (as with internal style sheets).

Disadvantages Disadvantages: – doesn't separate document structure from formatting so use sparingly, if at all – Increase maintenance work for the designer and download time for the reader

Internal or Embedded CSS CSS can be defined for entire pages by simply adding a style definition to the head section. An internal style sheet should be used when a single document has a unique style. When using internal CSS, you must add a new tag, style, inside the tag.

You can embed style definitions in a document head using the following form: style declarations Where style declarations are the declarations of the different styles to be applied to the document

Advantages By defining styles for entire pages, you will gain the freedom to easily change the styles even after the entire page has been made. Since the styles are only defined in one place, the page size will be smaller, and thus faster to load. Internal style sheets affect only the page they are on. Internal style sheets can use classes and IDs. Internal style sheets don't require that you upload multiple files. Internal styles may have higher precedence than external style sheets.

Disadvantages They affect only the page they are on. Internal style sheets increase page load times.

External CSS Because an embedded style sheet only applies to the content of one file, you need to place a style declaration in an external style sheet to apply to the rest of the Web site An external style sheet is a text file that contains style declarations – It can be linked to any page in the site, allowing the same style declaration to be applied to the entire site

An external style sheet is ideal when the style is applied to many pages. With an external style sheet, you can change the look of an entire Web site by changing one file. Each page must link to the style sheet using the tag. An external style sheet is simply a text file containing a list of CSS rules sets.

Syntax:

Advantages It keeps your website design and content separate. It's much easier to reuse your CSS code if you have it in a separate file. Instead of typing the same CSS code on every web page you have, simply have many pages refer to a single CSS file with the "link" tag. You can make drastic changes to your web pages with just a few changes in a single CSS file. It allows a single style sheet to control the rendering of multiple documents. This results in a time-savings for the author, a savings of space for the web server, and less download time for the user.

Disadvantages If the user downloads the page and if he forgot to download the linked css then he/she will not be able to view the page with all the styles.

Importing CSS A style sheet may be imported using the import statement. statements must occur at the start of the style sheet. Any rules specified in the style sheet override rules in the imported style sheets. Imported style sheets can be modularised in a number of ways.

url(nameof file.css) “nameof file.css”

Limitations of CSS Limited transcription capabilities. In css1 context specification limited. Non programmable. Western – language orientation (left to right)

Advantages of CSS Workflow – Faster downloads. – Streamlined site maintenance. – Global control of design attributes. – Precise control (advanced) Positioning Fluid layouts Cost savings – Reduced bandwidth costs. One style sheet called and cached. – Higher search engine rankings. Cleaner code is easier for search engines to index Greater density of indexable content.

 Faster download = better usability – Web usability redesign can increase the sales/conversion rate by 100% – Css requires less code. – Tables require spacer images. – Entire table has to render before content. – Css can control the order that elements download (content before images)  Increased reach – Css website is compatible with many different devices. – In 2008 an est. 58 million pda’s will be sold (source: et forecast.com) – 1/3 of the world’s population will own a wireless device by 2010.