Cascading Style Sheets

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.
Ideas to Layout Beginning web layout using Cascading Style Sheets (CSS). Basic ideas, practices, tools and resources for designing a tableless web site.
Cascading Style Sheets
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.
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.
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.
Understanding HTML Style Sheets. What is a style?  A style is a rule that defines the appearance and position of text and graphics. It may define the.
Cascading Style Sheets (CSS) Instructor: Mr. Ahmed Al Astal ITGD4104 Department Requirement for senior student University of Palestine Faculty of IT.
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.
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.
ITCS373: Internet Technology Week 3: Introduction to CSS Dr. Faisal Al-Qaed.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
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)
Cascade Style Sheet Introduction. What is CSS?  CSS stands for Cascading Style Sheets  Styles define how to display HTML elements  Styles were added.
IS1825: Developing Multimedia Applications for Business Lecture 1: Introduction to CSS Rob Gleasure
Web Design and Development for Business Lecture 4 Cascading Style Sheet (CSS)
DIV, Span, CSS.
Cascading Style Sheets CSS. Source W3Schools
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.
CSS Cascading Style Sheets A very brief introduction CSS, Cascading Style Sheets1.
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.
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.
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.
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.
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.
CSS: formatting webpages
CSS.
External Style Sheets.
Cascading Style Sheets
Cascading Style Sheet.
CSS Cascading Style Sheets
4.01 Cascading Style Sheets
Introduction to the Internet
Madam Hazwani binti Rahmat
CX Introduction to Web Programming
Introduction to Web programming
Intro to CSS CS 1150 Fall 2016.
CASCADING STYLE SHEET CSS.
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Website Design 3
Cascading Style Sheets - Building a stylesheet
Intro to CSS CS 1150 Spring 2017.
Software Engineering for Internet Applications
DynamicHTML Cascading Style Sheet Internet Technology.
CS134 Web Design & Development
محمد احمدی نیا CSS محمد احمدی نیا
Web Programming– UFCFB Lecture 11
Working with Cascading Style Sheets (CSS)
Working with Cascading Style Sheets (CSS)
What are Cascading Stylesheets (CSS)?
The Internet 10/6/11 Cascading Style Sheets
DynamicHTML Cascading Style Sheet Internet Technology.
Training & Development
Web Design & Development
Cascading Style Sheets - Building a stylesheet
4.01 Cascading Style Sheets
Web Client Side Technologies Raneem Qaddoura
INTERNATIONAL INSTITUTE OF IFORMATION TECHNOLOGY, (I²IT)
CASCADING STYLE SHEET WEB TECHNOLOGY
CGS 3066: Web Programming and Design Fall 2019
Presentation transcript:

Cascading Style Sheets CGS 3066: Lecture 3 Cascading Style Sheets

Term Project Maximum team size: 3 Teams and Topics are due on Monday 01/26/2015. Projects and assignments should be turned in on the CS department server, so please create your CS usernames. (CS username ≠ FSUID).

CSS 3 CSS stands for Cascading Style Sheets. Current Version: CSS 3. Supported by most browsers Internet Explorer : 9 and higher Firefox: 15 or higher Chrome: 16 or higher Safari: 4 or higher Opera: 10 or higher

CSS - Intro Styles define how to display HTML elements. Styles were added to HTML 4.0 to solve a problem. External Style Sheets can save a lot of work. External Style Sheets are stored in CSS files.

Why CSS? The original purpose of HTML was to combine the structure and content of the page into one document. When presentation elements began to be included in the document, it increased the complexity and reduced readability. Solution: Move the presentation elements elsewhere.

Why CSS? Separate the “style” elements from the documents and put it in a “style sheet”. Advantages: Styles can be changed easily. Document is more readable.

3 ways to do styling Inline Style Internal Style Sheets Style elements are included as HTML attributes. Internal Style Sheets A <style> tag is used in the HTML document to specify the presentation elements. External Style Sheets A separate “.css” file is used as a part of your set of documents. It contains all the styling elements.

Inline CSS What little styling we’ve been doing so far. Mixes content with presentation. Loses many of the advantages of a style sheet. Used very rarely (when very few elements require styling). Add the style attribute to the relevant tag. The style attribute can contain any CSS property.

Inline CSS example <h1 style="color:blue;margin-left:30px;"> This is a heading.</h1>

Internal CSS Used when the current document has a unique style. A <style> tag is used under the <head> tag of the document to define the styles. The content of the <style> tag follows CSS syntax.

Internal CSS example <head> <style> body { background-color: linen; } h1 { color: maroon; margin-left: 40px; </style> </head>

External CSS Used when a style is applied to many pages (like a theme). The look of the webpage can be changed by just changing one file. Each page must include a link to the style sheet with the <link> tag. The <link> tag goes inside the head section.

External CSS An external stylesheet is written as a separate file with a “.css” extension. Should go into the same relative path as the rest of the files (or can be referred by absolute path). The external stylesheet should not contain any HTML tags.

External CSS example mystyle.css body { background-color: lightblue; } color: navy; margin-left: 20px;

External CSS example <head> <link rel="stylesheet" type="text/css" href="mystyle.css"> </head>

Why “Cascading”? Multiple styles will cascade into one. Styles can be specified: inside an HTML element inside the head section of an HTML page in an external CSS file

Cascading Order Generally speaking we can say that all the styles will "cascade" into a new "virtual" style sheet by the following rules, where number one has the highest priority: Inline style (inside an HTML element) Internal style sheet (in the head section) External style sheet Browser default

Cascading example External Style sheet: Internal Style sheet: h1 { color: navy; margin-left: 20px; } Internal Style sheet: color: orange;

Cascading example The final style for the h1 element will be a combination of the two according to the order of preference: color: orange; margin-left: 20px;