Accessing CSS THREE WAYS: INLINE, INTERNAL, AND EXTERNAL STYLE SHEET.

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.
Computer Applications II.  A Style Sheet is a web page development tool that allows the developer to make global changes to a web page (or web site)
Cascading Style Sheets
Making Things Look Nice: Visual Appearance and CSS CMPT 281.
กระบวนวิชา 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.
CSS normally control the html elements. Three Ways to Insert CSS There are three ways of inserting a style sheet: External style sheet Internal style.
Cascading Style Sheets Understanding styles. The term cascading describe the capability of a local style to override a general style. CSS applies style.
Lecture 5. CSS 2 What style will be used when there is more than one style specified for an HTML element? Generally speaking we can say that all the styles.
Chapter 7 Using Advanced Cascading Style Sheets HTML5 & CSS 7 th Edition.
Prepared by ackoo Styli n g your page (font type, font size, colors, text decoration, alignment, set margin, table padding, etc.) References: W3Schools.
4.01 Cascading Style Sheets
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.
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.
Cascading Style Sheets (CSS) Instructor: Mr. Ahmed Al Astal ITGD4104 Department Requirement for senior student University of Palestine Faculty of IT.
Cascading Style Sheets Dreamweaver. Styles Determine how the HTML code will display Determine how the HTML code will display Gives designers much more.
 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.
Robert Vitolo CS430.  CSS (Cascading Style Sheets)  Purpose: To provide a consistent look and feel for a set of web pages To make it easy to update.
Chapter 3 Working with Text and Cascading Style Sheets.
The Characteristics of CSS
INTERNAL CSS Casey Ames Different types of CSS There are three different types of CSS: ◦ External CSS ◦ Internal CSS ◦ Inline CSS In this presentation.
Images (1) Three most popular formats – Graphics Interchange Format (GIF) – Joint Photographic Experts Group (JPEG) – Portable Network Graphics (PNG) –
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.
Web Foundations TUESDAY, OCTOBER 1, 2013 LECTURE 4: HTML COLOR CODES, INTRO TO CSS STYLES.
WRT235: Writing in Electronic Environments CSS Classes, IDs, divs.
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.
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)
Essentials of HTML Class 4 Instructor: Jeanne Hart
Cascade Style Sheet Introduction. What is CSS?  CSS stands for Cascading Style Sheets  Styles define how to display HTML elements  Styles were added.
Css. Definition Cascading style sheet (CSS)  It is a simple mechanism for adding style (e.g. fonts, colors, spacing) to Web documents.
Web Design and Development for Business Lecture 4 Cascading Style Sheet (CSS)
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
DIV, Span, CSS.
Cascading Style Sheets
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.
Are You Smarter Than a 5 th Grader? 1,000,000 5th Grade HTML 5th Grade Syntax 4th Grade HTML 4th Grade Syntax 3rd Grade HTML 3rd Grade Syntax 2nd Grade.
How to… Cascading Style Sheets. How to Insert a Style Sheet When a browser reads a style sheet, it will format the document according to it. There are.
Cascading Style Sheets Chris Vollmer IT 5610 Chatfield Senior High School.
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.
objectives Learning WEB TECHNOLOGIES. Understanding Salient features of WEB TECHNOLOGIES. Designing of WEB PAGES on your own. Development of WEB APPLICATIONS.
INTERNET APPLICATIONS CPIT405 CSS Cascading Style Sheet Instructor: Omnia H. Alwazzan
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,
CSS Cascading Style Sheets. Session Checklist ► Learn why style sheets are needed and their advantages and disadvantages ► Learn the format of a style.
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.
Cascading Style Sheets Using HTML. What are they? A set of style rules that tell the web browser how to present a web page or document. In earlier versions.
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.
External Style Sheets.
Cascading Style Sheets
CSS Cascading Style Sheets
Web Basics: HTML/CSS/JavaScript What are they?
4.01 Cascading Style Sheets
>> CSS Rules Selection
CASCADING STYLE SHEET CSS.
Website Design 3
Styles and the Box Model
What are Cascading Stylesheets (CSS)?
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.
4.01 Cascading Style Sheets
Presentation transcript:

Accessing CSS THREE WAYS: INLINE, INTERNAL, AND EXTERNAL STYLE SHEET

Three Ways to Insert CSS There are three ways of inserting a style sheet: Inline style - Defined in the of the current page Internal style sheet - Defined in the HTML tag of a particular element External style sheet - Defined in a separate file that is linked to the web page(s)

CSS Inline Style

An inline style loses many of the advantages of style sheets by mixing content with presentation. Use this method sparingly! To use inline styles you use the style attribute in the relevant tag. The style attribute can contain any CSS property. Inline styles cannot be reused, and are placed directly inside an HTML element in the code. NOTE: Inline styles do not have a Selector since it is embedded directly inside the HTML element it styles. Therefore, there is no need for a Selector. For the most part, inline styles defeat the purpose of using CSS and negates most of CSS's advantages, like the separation of content from presentation. Use of inline styles should be kept to a minimum and only used as a last resort (or a single quick fix).

CSS Inline Style One example of using an inline style is useful. Let's say you want to override a style that's on your external style sheet. Using an inline style is one way to accomplish this. Example of an inline style: This is a paragraph. The style is embedded inside the HTML element using the style attribute. The above style cannot be reused at all. It will only target that one paragraph. In order to style more paragraphs with an inline style, you'd have to make one inline style per paragraph. That's not very efficient, can make a mess of your code, and add to the amount of markup on your page.

CSS Internal Style

Internal styles are placed inside the section of a particular web page via the tag: Inline styles can only be used for the web pages in which they are embedded. Therefore, you would need to create these styles over and over again for each web page you want to style. If you want to change your style throughout the site you would have to make the changes manually on each and every web page. Not very efficient! Internal styles are also called "embedded" styles. We use the tag to embed internal styles in the section of a given web page.

CSS Internal Style Example of an Internal Style: hr { color:#0000ff; } p { margin:20px; font-size:12pt; font-family:"Times New Roman",Georgia,Serif; } body { background-image:url("images/browngradient.jpg"); margin: 40px; }

CSS External Style

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. It also means you only have to create the style one time! An external style sheet is a separate page file that is linked to the web page. Therefore, the styles are external to, or outside of, the code of that web page. Each web page must link to the external style sheet using the tag. The tag goes inside the head section: The Cackling Crows of Cascadia

CSS External Style Example of an External Style Sheet: /* style.css */ hr { color:#0000ff; } p { font-size:12pt; font-family:"Times New Roman",Georgia,Serif; margin:20px; padding:10px; } body { background-image:url("images/browngradient.jpg"); }