CSS. HTML: Looking Back HTML dictates order, structure, and function Does very little to specify layout or visual rendering.

Slides:



Advertisements
Similar presentations
CSS Styling CSS Box Model & CS110: Computer Science and the Internet.
Advertisements

Cascading Style Sheets
Cascading Style Sheets
Cascading Style Sheets (CSS) “Styles” for short. Pg. 418.
Today CSS HTML A project.
CSS CSS Precise Aesthetic Control. Cascading Style Sheets Though they can be put in HTML header, usually a separate page that the HTML links to Contains.
Recognizing the Benefits of Using CSS 1. The Evolution of CSS CSS was developed to standardize display information CSS was slow to be supported by browsers.
กระบวนวิชา 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.
© 2010, Robert K. Moniot Chapter 5 CSS : Cascading Style Sheets 1.
Chapter 6 Web Typography
Introduction to Cascading Style Sheets (CSS) Module 2: HTML Basics LESSON 4.
Text Properties, Line Box, CSS. Text Properties Properties related to the display of text. Text-align : left, right, center I like FSU!
Cascading Style Sheets SP.772 May 6, CSS Useful for creating one unified look for an entire web site. Helps to seperate style from content. Can.
Beginning Web Site Creation: Dreamweaver CS4. XHTMLCSS  Describes the structure  Content  Collection of styles  Formatting body { background-color:
CSS Basics LIS Webteam April 8, Why CSS? What’s wrong with HTML? Structure vs Style Early web design used hacks to style webpages with HTML – like.
Using Cascading Style Sheets CSS Structure. Goals Understand how contextual, class and ID selectors work Understand how contextual, class and ID selectors.
4.01 Cascading Style Sheets
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
W EB S ITE L ECTURE C ASCADING S TYLE S HEETS. Cascading Style Sheets (CSS) Introduction CSS Objectives – Provide more control over web site content presentation.
CSS (Cascading Style Sheets): How the web is styled Create Rules that specify how the content of an HTML Element should appear. CSS controls how your web.
Principles of Web Design 6 th Edition Chapter 4 – Cascading Style Sheets.
Using Cascading Style Sheets. Introduction to Styles and Properties  Cascading Style Sheets (CSS) are a standard set by the World Wide Web Consortium.
Cascading Style Sheets CS3505. What are CSS? Method for adding style attributes consistently to HML tags Cascading because styles are applied in order.
HTML - Quiz #2 Attendance CODE:
Cascading style sheets (CSS)
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
Chapter 6 Web Typography. 2 Principles of Web Design Chapter 5 Objectives Understand principles for type design on a Web site Use the element Understand.
Cascading Style Sheets. Defines the presentation of one or more web pages Similar to a template Can control the appearance of an entire web site giving.
Cascading Style Sheets by Pavlovic Nenad by. Presentation Contents  What is CSS?  Why CSS?  Types of Style Sheets  Style Sheets Syntax  Box Formatting.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
CSS My favourite ICT lesson By Federico Boschi Cascading Style Sheets.
Cascading Style Sheets Orientation Learning Web Design: Chapter 11.
Tutorial 5 Formatting with CSS. Objectives Session 5.1 – Evaluate why CSS styles are used – Determine where to write styles – Create an element selector.
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.
Introduction to CSS. What is CSS?  Cascading Style Sheets  Used for styling HTML  Also important in javascript and jquery for selectors  External.
Cascading Style Sheets Class 2, Lecture 2 Rachel A Ober
Cascade Style Sheet Introduction. What is CSS?  CSS stands for Cascading Style Sheets  Styles define how to display HTML elements  Styles were added.
CSS Cascading Style Sheets. CSS Advantages Greater typography and page layout control Style is separate from structure Styles can be stored in a separate.
HTML - Quiz #2 Attendance CODE:
Lesson 03 // Cascading Style Sheets. CSS Stands for Cascading Style Sheets. We’ll be using a combination of Html and CSS to create websites. CSS is a.
ECA225 Applied Interactive Programming Cascading Style Sheets, pt 1 ECA 225 Applied Online Programming.
Course created by Sarah Phillips BBCD Melbourne BAPDCOM Version 1 – April 2013.
Cascading Style Sheets Level 2. Course Objectives, Session 1 Level 1 Quick Review Chapter 8: Adding Graphics to Web Pages Chapter 9: Sprucing Up Your.
Cascading Style Sheets CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
Lesson 15: Cascading Style Sheets. Objectives Identify ways to apply Web page formatting with Cascading Style Sheets (CSS1 and CSS2) using various methods.
1 Working with Cascading Style Sheet (CSS). 2 Cascading Style Sheets (CSS)  a style defines the appearance of a document element. o E.g., font size,
5 th ed: Chapter 4 4 th ed: Chapter 5 SY306 Web and Databases for Cyber Operations Slide Set #4: CSS.
Cascading Style Sheets Primary readings Presentations Explain & review projects with class mates.
Web Technologies Beginning Cascading Style Sheets (CSS) 1Copyright © Texas Education Agency, All rights reserved.
Developing Web Applications with HTML and CSS “Selectors and Properties”
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
CSS Cascading Style Sheets *referenced from
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.
Creating Layouts with CSS. Span tag Here is some underlined text. Here is some blinking text. Here's some bold text.
ECA 228 Internet/Intranet Design I Cascading Style Sheets.
Chapter 11 & 12 CSS Style Sheets: Intro. Why CSS? Separate presentation from content – more accessible Less work – can change appearance of whole site.
HTML 5 AND CSS Dr Mohd Soperi Mohd Zahid Semester /16.
Blended HTML and CSS Fundamentals 3 rd EDITION Tutorial 3 Introducing Cascading Style Sheets.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
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.
CONFIGURING COLOR AND TEXT WITH CSS Chapter 3. Cascading Style Sheets (CSS) Used to configure text, color, and page layout. Launched in 1996 Developed.
Internet & World Wide Web How to Program, 5/e 1. 2.
4.01 Cascading Style Sheets
CSS Layouts: Grouping Elements
Introduction to Web programming
CSS.
4.01 Cascading Style Sheets
Presentation transcript:

CSS

HTML: Looking Back HTML dictates order, structure, and function Does very little to specify layout or visual rendering

CSS Let’s Write Some Poetry! ShakespeareLongfellow YOU

C S tyle S

The Purpose of CSS If HTML is the content and meaning ➡ CSS helps to convey that meaning Allows developers to separate the content from layout and design Content and design inherently different in nature ➡ Change in content does not require change in design

CSS Zen Garden Site using consistent HTML content Differing external CSS files create dramatically different layout Support for multiple browsers link: hint: change the styles on the page

An Example Meaning is conveyed by the styling Remove the style and meaning is lost Attention is given to the information No additional meaning is lost when removed Consider the boldface font in the following examples: Chunky bacon is delicious. Today I will go outside. Monday I will run 2 miles.

A Bit of Reasoning ➡ Hola. ➡ Hola! Explicitly conveys meaning ➡ Hola. ➡ Hola! Typographical artifacts: any meaning is implied

In detail Special attention is given to the date Assists the user in resolving, parsing the information ➡ Key goal of Design Today I will go outside. Monday I will run 2 miles.

CSS: How to Use It 1. Select the elements you want to modify ➡ Selectors 2. Indicate which aspect(s) of the element you want to modify ➡ Assign values to properties

CSS Anatomy body { background-color: #FFFFFF; } body { background-color: #FFFFFF } Selector Property Value This also works: Example of hex color codes: ColorSchemer Online Color Generator

C S tyle S heet

Stylesheet: A Sheet of Styles Place each style block together to make a stylesheet!

Selectors Select an element ➡ body { }p { }strong { }div { } Select a nested element ➡ p strong { }div p { } ul li ul li span { } Select multiple elements ➡ p, div { }strong, em { }p, span { }

More Selectors Select an element with a class ➡ p.indent { }span.blue { }div.page { } Select an element with an id ➡ div#home { }div p#tools { } Select an element with an id and a class ➡ ul.square#top { }div.page table.math#pset { }

About Properties Properties can be specific to a group of elements ex: border-spacing is useless for elements Some property values can be inherited by children ex: font-size set on will be inherited by a child element Properties can have default values ex: background-color ’s default value is transparent

How do you know? Luckily, the W3C produces a specification for CSS, too Lists all properties, defaults, possible values Also suggests how property values affect rendering Many commercial sites also provide similar references ex: SitePoint, w3schools (both have HTML & CSS)... Or find out?

Key Properties background-color background-image color width height font-family font-size font-weight text-decoration text-align

Values & Units Values are typically keywords ex: colors: red, blue ex: text alignment: left, right, center Values, especially for layout Pixels: 15px Points: 12pt Percentages- relative to size of parent: 50%

An Example Use the taguse font-weight: bold ; Consider the boldface font in the following examples: Chunky bacon is delicious. Today I will go outside. Monday I will run 2 miles.

Firebug: Your New Best Friend Firefox extension for “inspecting” page elements Useful tool when “something doesn’t look right” Provides interactive view of HTML source Allows for real-time changes in HTML and CSS ➡ The Web is inherently Open Source! Get Firebug

Layout: The Box Model Describes how layout properties alter rendering Well-illustrated in real-time with Firebug Padding Element Margin Border

How to change attributes Element width, height Padding padding macro Border border macros Margin margin macro Padding Element Margin Border

About Macro Properties Macro properties take multiple values, separated by spaces border: Each constituent value corresponds to a property that can be set itself

How it’s seen Background color extends to border Margin is invisible Padding Element Margin Border

C ascading S tyle S heet

Where does it go? CSS can be included in The style attribute of an element The tag of a HTML document An external file specified in the tag

Things to know Comments /* */ Not every browser renders content the same CSS renders by specificity Selectors are not overridden simply by order Most specific selector for an element’s property wins