CX Introduction to Web Programming

Slides:



Advertisements
Similar presentations
1 © Netskills Quality Internet Training, University of Newcastle Introducing Cascading Style Sheets © Netskills, Quality Internet.
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
1 Cascading Style Sheets™ (CSS) Outline 5.1 Introduction 5.2 Inline Styles 5.3 Embedded Style Sheets 5.4 Conflicting Styles 5.5 Linking External Style.
Cascading Style Sheets
Today CSS HTML A project.
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.
Introduction to CSS.
กระบวนวิชา 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.
Web Design with Cascading Style Sheet Lan Vu. Overview Introduction to CSS Designing CSS Using Visual Studio to create CSS Using template for web design.
 2003 Prentice Hall, Inc. All rights reserved. Chapter 6 - Cascading Style Sheets™ (CSS) Outline 6.1 Introduction 6.2 Inline Styles 6.3 Embedded Style.
Introduction to Cascading Style Sheets (CSS) Module 2: HTML Basics LESSON 4.
Cascading Style Sheets. Slide 2 Lecture Overview Overview of Cascading Style Sheets (CSS) Ways to declare a CSS CSS formatting capabilities New features.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic CSS: Cascading Style Sheets.
4.01 Cascading Style Sheets
Computing Concepts: CSS. Aims  To understand the uses of css  To understand the different types of css  To be able to create a css file  To be able.
Using Cascading Style Sheets (CSS) Dept. of Computer Science and Computer Information CSCI N-100.
Pre-Module CSS BTM 395: Internet Programming. Cascading Style Sheets (CSS) Separation of structure from presentation CSS guide and tutorial –
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.
Cascading Style Sheets (CSS) 1.  What is CSS?  Why CSS?  How to write a CSS? 2.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
Cascading Style Sheets Orientation Learning Web Design: Chapter 11.
CO1552 – Web Application Development Cascading Style Sheets.
IS 360 Declaring CSS Styles. Slide 2 Introduction Learn about the three ways to declare a style Inline / embedded / external Learn about the effect of.
Css. Definition Cascading style sheet (CSS)  It is a simple mechanism for adding style (e.g. fonts, colors, spacing) to Web documents.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 6 - Cascading Style Sheets™ (CSS) Outline 6.1 Introduction 6.2 Inline Styles 6.3 Embedded Style.
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 September 20, Introduction Cascading Style Sheets (CSS) –Separation of structure from presentation CSS guide and tutorial.
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.
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 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.
1 Cascading Style Sheets
CSS Cascading Style Sheets
Web Development & Design Foundations with XHTML
Getting Started with CSS
Chapter 6 - Cascading Style Sheets™ (CSS)
4.01 Cascading Style Sheets
Basics of Web Design Chapter 4 Cascading Style Sheets Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D.
CSS: Cascading Style Sheets
Introduction to CSS.
Cascading Style Sheets
Cascading Style Sheets
Chapter 6 Cascading Style Sheets™ (CSS)
IS 360 Declaring CSS Styles
Madam Hazwani binti Rahmat
Web Developer & Design Foundations with XHTML
Using Cascading Style Sheets Module B: CSS Structure
Cascading Style Sheets (CSS)
Basics of Web Design Chapter 4 Cascading Style Sheets Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D.
Intro to CSS CS 1150 Fall 2016.
CASCADING STYLE SHEET CSS.
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Introduction to CSS.
Intro to CSS CS 1150 Spring 2017.
Basics of Web Design Chapter 4 Cascading Style Sheets Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D.
Introduction to Cascading Style Sheets (CSS)
Web Programming– UFCFB Lecture 11
What are Cascading Stylesheets (CSS)?
The Internet 10/6/11 Cascading Style Sheets
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.
Made By : Lavish Chauhan & Abhay Verma
Basics of Web Design Chapter 4 Cascading Style Sheets Basics Key Concepts Copyright © 2016 Terry Ann Morris, Ed.D.
4.01 Cascading Style Sheets
Presentation transcript:

CX002-3-3 Introduction to Web Programming Cascading Style Sheet (CSS)

Topic & Structure of the lesson Introduction Inline Styles Embedded Style Sheets Linking External Style Sheets Conflicting Styles HTML Selectors Class Selectors W3C CSS Validation Service Web Resources

Learning Outcomes At the end of the module, your should be able to: Control the appearance of a Web site by creating style sheets. Use a style sheet to give all the pages of a Web site the same look and feel. Use the class attribute to apply styles. Specify the precise font, size, color and other properties of displayed text. Specify element backgrounds and colors. Understand the box model and how to control the margins, borders and padding. Use style sheets to separate presentation from content.

Key Terms you must be able to use If you have mastered this topic, you should be able to use the following terms correctly in your assignments and exams: CSS Cascading Style Sheet

Introduction Cascading Style Sheets (CSS) Separation of structure from presentation a style sheet is a document that contains instructions that define how to display HTML elements in a Web page. These instructions are called styles. An external style sheet typically has the .css file extension. 3 types Inline Embedded External

Inline Styles Declare an individual element’s format Attribute style CSS property Followed by a colon and a value Inline style is a one-time style instruction placed in an individual HTML tag. However, using inline CSS means that you are not taking advantage of the true powers of CSS, and it means that you are not separating content from presentation. <p style="font-size: 20pt; color: #0000ff">

Inline Styles

Inline Styles

Embedded Style Sheets Embed an entire CSS document in an XHTML document’s head section Multipurpose Internet Mail Extensions (MIME) type Describes a file’s content Property background-color Specifies the background color Property font-family Specifies the name of the font to use Property font-size Specifies a 14-point font it only affects the style of the page on which it is written

Embedded Style Sheets <head> <title>Style Sheets</title> <!-- this begins the style sheet section --> <style type = "text/css"> em { background-color: #8000ff; color: white } h1 { font-family: arial, sans-serif } p { font-size: 14pt } .special { color: blue } </style> </head>

Embedded Style Sheets

Embedded Style Sheets

Linking External Style Sheets Can provide uniform look and feel to entire site One external style sheet can control the appearance of many Web pages. By creating a CSS file that contains all of the style information for your website, you can: Maintain a consistent look across all pages that link to the style sheet. Easily update the look of all pages by changing the values in one file. Make your pages much smaller and quicker to download, because all of the style information has been removed to one file.

Linking External Style Sheets Each page must link to the style sheet using the <link> tag. The <link> tag goes inside the head section: <link href="stylesheet.css" rel="stylesheet" type="text/css" />

Linking External Style Sheets

Linking External Style Sheets

Conflicting Styles You could use any or all of these types of styles in a single HTML document. If multiple style instructions exist, they will “cascade” into a single set of instructions, with some instructions taking priority over others. This list describes the priority Inline Style (affects single HTML element; overrides all other style instructions) Embedded Style Sheet (affects one HTML document; overrides external style sheet) External Style Sheet (affects multiple documents, overridden by #1 and #2) Browser default

Conflicting Styles Some other points to keep in mind: If two styles are applied to the same text, the browser displays all attributes of both styles unless specific attributes conflict. If attributes from two styles applied to the same text conflict, the browser displays the attribute of the innermost style (the style closest to the text itself). HTML formatting will override any CSS formatting. Again, please understand that different browsers may implement CSS differently. It is very important to test your Web pages in a variety of browsers to make sure your pages display correctly.

Conflicting Styles

Conflicting Styles

HTML Selectors HTML selectors are the text part of a HTML tag and are used to define the behavior of the specific HTML tag. For example; H1 is the selector for <H1> tag. Although HTML tag and the selector appear to be identical, they are not the same. The HTML selector is used to control the behavior of its specific HTML tag. h1 { font-family: arial, sans-serif } p { font-size: 14pt }

Class Selectors Class selectors are selectors that you create from scratch. They can be applied to any HTML tag. Can be applied to any HTML tag .userDefineName { font-size: 14pt; color: blue; } <p class="userDefineName">Do Re Mi</p>

W3C CSS Validation Service Validates external CSS documents Ensures that style sheets are syntactically correct http://jigsaw.w3.org/css-validator/

W3C CSS Validation Service

Web Resources http://www.w3.org/TR/css3-roadmap http://jigsaw.w3.org/css-validator/

Question and Answer Session Q & A

Next Session Topic and Structure of next session ASP.NET