ITCS373: Internet Technology Week 3: Introduction to CSS Dr. Faisal Al-Qaed.

Slides:



Advertisements
Similar presentations
Dr. Alexandra I. Cristea CSS Dr. Alexandra I. Cristea Source:
Advertisements

CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
CSS Cascading Style Sheets. Contents{ 1. What is CSS? 1. A Brief History of CSS 2. Why to use Styles? 2. Syntax 3. Cascading Order 4. Examples of Properties.
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.
Cascading Style Sheets
Making Things Look Nice: Visual Appearance and CSS CMPT 281.
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.
Building a Website: Cascading Style Sheets (CSS) Fall 2013.
กระบวนวิชา 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.
Introduction to Cascading Style Sheets (CSS) Module 2: HTML Basics LESSON 4.
1 Creating Web Pages Part 3. 2 CASCADING STYLE SHEETS (CSS): What exactly are they? Set of rules that define how a web browser should display an HTML.
Controlling Page Style: Cascading Style Sheets (CSS) References: 1.Wang, P.S & Katila, S. (2004). A Introduction to Web Design and Programming. CA: Thomson.
Cascading Style Sheet (CSS) Instructor: Dr. Fang (Daisy) Tang
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.
Web Design is a class created to nurture the minds of high school techies, and introduce those without prior knowledge to the field.
Review HTML  What is HTML?  HTML is a language for describing web pages.  HTML stands for Hyper Text Markup Language  HTML is not a programming language,
Cascading Style Sheets (CSS) Instructor: Mr. Ahmed Al Astal ITGD4104 Department Requirement for senior student University of Palestine Faculty of IT.
Cascading Style Sheets Example
Chapter 11 Cascading Style Sheets: Part I The Web Warrior Guide to Web Design Technologies.
CSS Dvijesh Bhatt.
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.
Cascading style sheets (CSS)
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.
To Proudly supported by ferrycake.com. We will be printing Cash for your Community tokens every week in the Carmarthen Journal and Llanelli Star. The.
CSS Netcentric. What is CSS O CSS stands for Cascading Style Sheets O Styles define how to display HTML elements O Styles were added to HTML 4.0 to solve.
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.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
Cascading Style Sheets Chapter Four. What are they? A set of style rules that tell the web browser how to present a web page or document. Cascading Style.
Working with Cascading Style Sheets (CSS) Module 2: HTML Basics LESSON 5.
CO1552 – Web Application Development Cascading Style Sheets.
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 Basic (cascading style sheets)
Cascading Style Sheets in.NET Lilian Kiilu, Client/Server & Web Applications, Coms 463/563, Section 1pm, Fall 2005, November 16 th 2005.
Cascade Style Sheet Introduction. What is CSS?  CSS stands for Cascading Style Sheets  Styles define how to display HTML elements  Styles were added.
Chapter 3 CSS. Vacabulary CSS: 层叠样式表 Syntax: 语法 Selector: 选择器 filter :滤镜 / 过滤器 background: 背景 property: 属性.
Web Design and Development for Business Lecture 4 Cascading Style Sheet (CSS)
CSS Tutorial 1 Introduction Syntax How to use style specifications. Styles.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
DIV, Span, CSS.
Cascading Style Sheets CSS. Source W3Schools
Introduction to CSS. Why CSS? CSS Provides Efficiency in Design and Updates CSS relatively easy to use Can give you more flexibility and control Faster.
Cascading Style Sheets
Web Design (12) CSS Introduction. Cascading Style Sheets - Defined CSS is the W3C standard for defining the presentation of documents written in HTML.
CSS Cascading Style Sheets A very brief introduction CSS, Cascading Style Sheets1.
CSS Hadas Kahsay. Overview  What is CSS  Basic syntax of CSS Rules  How to link CSS style to html documents  Browsers and CSS  Advantages of CSS.
Web Technologies Beginning Cascading Style Sheets (CSS) 1Copyright © Texas Education Agency, All rights reserved.
Designing Web Pages The case for CSS. The Power of CSS css Zen Garden
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.
Introduction To CSS by: Alexandra Vlachakis Sandy Creek High School, Fayette County Schools Content and Resources Used With Permission: Interact With Web.
IS1825 Multimedia Development for Internet Applications Lecture 12: IDs, Classes and Internal CSS Rob Gleasure
CSS Syntax. Syntax The CSS syntax is made up of three parts: a selector, a property and a value: selector {property: value}
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.
Html: structure & content CSS: presentation & style A CSS Primer chapter 4.
CSS DHS Web Design. Location Between the & Start with – End with –
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.
1 Cascading Style Sheets
WEB FOUNDATIONS CSS Overview. Outline  What is CSS  What does it do  Where are styles stored  Why use them  What is the cascade effect  CSS Syntax.
Cascading Style Sheet (CSS)
CASCADING STYLE SHEET CSS.
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Website Design 3
Cascading Style Sheets - Building a stylesheet
Introduction to Cascading Style Sheets (CSS)
What are Cascading Stylesheets (CSS)?
Cascading Style Sheets - Building a stylesheet
Presentation transcript:

ITCS373: Internet Technology Week 3: Introduction to CSS Dr. Faisal Al-Qaed

What is CSS? CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles are normally stored in Style Sheets Styles were added to HTML 4.0 to solve a problem External Style Sheets can save you a lot of work External Style Sheets are stored in CSS files Multiple style definitions will cascade into one

Styles Solve a Common Problem HTML tags were originally designed to define the content of a document. They were supposed to say "This is a header", "This is a paragraph", "This is a table", by using tags like,,, and so on. The layout of the document was supposed to be taken care of by the browser, without using any formatting tags. As the two major browsers - Netscape and Internet Explorer - continued to add new HTML tags and attributes (like the tag and the color attribute) to the original HTML specification, it became more and more difficult to create Web sites where the content of HTML documents was clearly separated from the document's presentation layout. To solve this problem, the World Wide Web Consortium (W3C) - the non profit, standard setting consortium, responsible for standardizing HTML - created STYLES in addition to HTML 4.0. All major browsers support Cascading Style Sheets.

Style Sheets Can Save a Lot of Work Styles sheets define HOW HTML elements are to be displayed, just like the font tag and the color attribute in HTML 3.2. Styles are normally saved in external.css files. External style sheets enable you to change the appearance and layout of all the pages in your Web, just by editing one single CSS document! CSS is a breakthrough in Web design because it allows developers to control the style and layout of multiple Web pages all at once. As a Web developer you can define a style for each HTML element and apply it to as many Web pages as you want. To make a global change, simply change the style, and all elements in the Web are updated automatically.

Multiple Styles Will Cascade Into One Style sheets allow style information to be specified in many ways. Styles can be specified inside a single HTML element, inside the element of an HTML page, or in an external CSS file. Even multiple external style sheets can be referenced inside a single HTML document.

Cascading Order 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 will "cascade" into a new "virtual" style sheet by the following rules, where number four has the highest priority: 1.Browser default 2.External style sheet 3.Internal style sheet (inside the tag) 4.Inline style (inside an HTML element) So, an inline style (inside an HTML element) has the highest priority, which means that it will override a style declared inside the tag, in an external style sheet, or in a browser (a default value).

Syntax The CSS syntax is made up of three parts: a selector, a property and a value: selector {property: value} The selector is normally the HTML element/tag you wish to define, the property is the attribute you wish to change, and each property can take a value. The property and value are separated by a colon, and surrounded by curly braces

Examples body {color: black} p {font-family: "sans serif"} p {text-align:center;color:red} p { text-align: center; color: black; font-family: arial }

Grouping: h1,h2,h3,h4,h5,h6 { color: green } The class Selector: i.e. define classes as follow: p.right {text-align: right} p.center {text-align: center} Then you can use them as follows: This paragraph will be right- aligned. This paragraph will be center- aligned.

You can also omit the tag name in the selector to define a style that will be used by all HTML elements that have a certain class..center {text-align: center} And then use it for any tag: This heading will be center-aligned This paragraph will also be center-aligned.

Add Styles to Elements with Particular Attributes input[type="text"] {background-color: blue} The id Selector: You can also define styles for HTML elements with the id selector. The id selector is defined as a #. #green {color: green} will match the element that has an id attribute with a value of "green": p#para1 { text-align: center; color: red } will match the p element that has an id with a value of "para1"

External Style Sheet

Internal Style Sheet <!-- hr {color: sienna} p {margin-left: 20px} body {background-image: url("images/back40.gif")} -->

Inline Style An inline style loses many of the advantages of style sheets by mixing content with presentation. Use this method sparingly, such as when a style is to be applied to a single occurrence of an element. This is a paragraph

Multiple Style Sheets External CSS: h3 { color: red; text-align: left; font-size: 8pt} Internal style sheet h3 { text-align: right; font-size: 20pt } If the page with the internal style sheet also links to the external style sheet the properties for h3 will be: color: red; text-align: right; font-size: 20pt

What will happen if we replace repeat-y with repeat-x? no-repeat? repeat?

Replace centre with 50px 100px? 30% 20%? background-attachment:fixed; set a fixed background image. The image will not scroll with the rest of the page. Try scroll instead of fixed, what is the difference?

Try lower-roman, lower-alpha, upper-alpha for ordered list Try disc, none for unordered list

What else? With style sheet, you can control the margins, layout, border of the page, table, paragraphs, and also control the positions of images, form elements,..etc For more examples visit and google the keywords CSS Examples

Reading Read Chapter 5 CSS Required Assignment  Learn how to create a CSS Drop-Down Menu – Page 184