Cascading Style Sheets - CSS basics. CSS use in html Internally … …css… … Externally.

Slides:



Advertisements
Similar presentations
1 Cascading Style Sheets Continued Different kinds of selectors in a style sheet –Simple- Pseudo-Class –Contextual- Pseudo-Element –Class Image Styles.
Advertisements

CSS Internet Engineering Spring 2014 Bahador Bakhshi CE & IT Department, Amirkabir University of Technology.
Cascading Style Sheets
CSS The basics { }. CSS Cascading Style Sheets - language used to – describe html appearance & formatting Style Sheet - file that describes – how html.
Part 2 Introduction to CSS. CSS Syntax – class selector 1 With the class selector you can define different styles for the same type of HTML element. You.
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.
Cascading Style Sheets CSS. What is it? Another file format ! its not like html Describes the looks of “selectors” in a.css file (example.css) in the.
XP Introducing Cascading Style Sheets With Cascading Style Sheets (CSS), you can create one or more documents that control the appearance of some or all.
CS4370/6370 Web Development Cascading Style Sheets (CSS)
Web Design & Development Cascading Style Sheets (CSS)
Web Workshop: CSS Objectives: - “What is CSS?” - Structure of CSS - How to use CSS in your webpage.
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.
The.htm/.html Mystery When saving the template files in Internet Explorer, they will be named.htm by default. To be consistent with how the code was written.
4.01 Cascading Style Sheets
CM143 Week 4 Introducing CSS. Cascading Style Sheets A definition for the style in which an element of the webpage will be displayed Border width, colour,
Cascading Style Sheets 1 Color and Backgrounds. Cascading Style Sheets 2 Color and Backgrounds Computer color basics Expression of color values using.
Cascading Style Sheets Dreamweaver. Styles Determine how the HTML code will display Determine how the HTML code will display Gives designers much more.
CSS Dvijesh Bhatt.
HTML - Quiz #2 Attendance CODE:
HTML/CSS Hyper Text Markup Language. CSS Cascading Style Sheets.
CSS Cascading Style Sheets By Garrett Garman. CSS Why use Style Sheets? Separates Appearance and Structure Modularity Quick and Easy changes Flexibility.
Basics of Smarajit Dasgupta.
INTERNAL CSS Casey Ames Different types of CSS There are three different types of CSS: ◦ External CSS ◦ Internal CSS ◦ Inline CSS In this presentation.
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.
CSS in XHTML continued Please use speaker notes for additional information!
(CSS) More Details Instructor: Mr. Ahmed Al Astal ITGD4104 Department Requirement for senior student University of Palestine Faculty of IT.
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.
Working with Cascading Style Sheets (CSS) Module 2: HTML Basics LESSON 5.
آموزش طراحی وب سایت جلسه چهارم– سی اس اس 1 تدریس طراحی وب برای اطلاعات بیشتر تماس بگیرید تاو شماره تماس: پست الکترونیک :
Form Tag How to use Form Tag Something NEW ? PARAMETER Attribute NAME Specifies the name for a form To specify which form to submit with JavaScript, this.
11/6/13 MORE CSS!. TODAY’S AGENDA Review: float for positioning objects Review: CSS and color Introductions to: o CSS and images o CSS backgrounds o CSS.
CSS. HTML: Looking Back HTML dictates order, structure, and function Does very little to specify layout or visual rendering.
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.
Softsmith Infotech CSS. Softsmith Infotech CSS Cascading Style sheets Enhances look and feel of the site Adds more features to plain HTML Can define properties.
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:
More CSS.
Web Design and Development for Business Lecture 4 Cascading Style Sheet (CSS)
CSS Tutorial 1 Introduction Syntax How to use style specifications. Styles.
 Use the think diagram … ISP Server.
Colors and backgrounds The following CSS properties will be explained: 1.color 2.background-color 3.background-image 4.background-repeat 5.background-attachment.
So far, we have looked at CSS selectors that correlate with HTML tags Now, we’ll see how you can define your own selectors using class and ID selectors.
DIV, Span, CSS.
XP Review 2 New Perspectives on JavaScript, Comprehensive1 Introducing Cascading Style Sheets Formatting Web Pages with CSS.
Introduction to CSS September 20, Introduction Cascading Style Sheets (CSS) –Separation of structure from presentation CSS guide and tutorial.
Colors and backgrounds The following CSS properties will be explained: 1.color 2.background-color 3.background-image 4.background-repeat 5.background-position.
CSS Cascading Style Sheets A very brief introduction CSS, Cascading Style Sheets1.
Web Technologies Beginning Cascading Style Sheets (CSS) 1Copyright © Texas Education Agency, All rights reserved.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
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.
- WE’LL LOOK AT THE POSITION PROPERTY AND HOW CSS RESOLVES CONFLICTS BETWEEN STYLING INSTRUCTIONS The position property; CSS specificity hierarchy.
Web Design (15) CSS Opacity, Link Colours & Background Images.
BEGINNER WEB DESIGN. INTRODUCTION Vocabulary Design Tools of the Trade HTML CSS.
CSS Layout Cascading Style Sheets. Lesson Overview  In this lesson, we’ll cover:  Brief CSS review  Creating sections with the tag  Creating inline.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
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…
Css lectures. What is 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 (Cascading Style Sheets). CSS CSS – Cascading Style Sheets – Cascade because of the way CSS rules can stack on top of each other. Allows you to add.
1 Cascading Style Sheets
Getting Started with CSS
Bare boned notes.
Display Property.
Cascading Style Sheets - Building a stylesheet
The Web Wizard’s Guide To DHTML and CSS
Google Fonts Selective Formatting
Intro to CSS Mr. Singh.
Cascading Style Sheets - Building a stylesheet
Web Programming and Design
Presentation transcript:

Cascading Style Sheets - CSS basics

CSS use in html Internally … …css… … Externally

Selectors terminology to remember! Selectors “select” items on the page such as: all H1 tags & all H2 tags 1 tag with the ID “fred” all tags classified “cats”

Selectors = What/how to “select” the tags you want to apply style attributes to 3 CSS Selectors tagname (aka element name).classname (class attribute) #idname (id attribute) 3 ways to apply a style

SillyPhrase Animal The fox jumped over the lazy dog

Selectors: (3 ways to apply a style) IDs - can only be used ONCE Class - can be used many times tag - all of that tag, ex: b is all tags SillyPhrase Animal The fox jumped over the lazy dog

similar to Java/C/JavaScript syntax ;;;; /* block comments, no line comments*/ Selector { property: value; } is a tagname, #idname, or.classname Selector1 selector2 selector3 {…} CSS Syntax

The fox jumped over the lazy dog SillyPhrase Animal The fox jumped over the lazy dog.animal { color: blue;font-weight: bold;} #sillyphrase { background-color: green; }

Do nothing - exist so you can use class=”” Two for technical reasons Block tags - take 100% width: Inline tags - “flow” within: Modern browsers handle this old problem but you shouldn’t push your luck

SillyPhrase Animal The fox jumped over the lazy dog.animal { color: blue;font-weight: bold;} #sillyphrase { background-color: green; }

SillyPhrase Animal The fox jumped over the lazy dog.animals is applied to everything that has the class= “animals” #sillyphase could be made RED, and then the fox and dog (animals) would inherit the RED color.animals are black, no matter what color #sillyphrase is The fox jumped over the lazy dog

Backgrounds background-color: #ff00ff background-image: url( ) background-repeat: repeat-x, repeat- y, repeat, no-repeat, inherit background-position: x y; background-attachment: scroll, fixed

Typical Selector Use classes are the most flexible multiple selectors (or complex query).classname {…properties...}.classname h1 {…properties...} all class=”classname” tags filter search results: all tags

The fox jumped over the lazy dog animal The fox jumped over the lazy dog p.animal { color: yellow;} p.animal { background-color: red;}

Naming Conventions If you didn’t notice… it is all LOWERCASE + no spaces on names background color = background-color colors in CSS named (a short list) red, blue, green… #99CC33 → #9C3

Use CSS references / tools Most HTML tags come with built-in properties, which you can override with CSS Use LIVE CSS editor to learn (Firefox) part of the Web Developer Tool add- on FireBug for Firefox & Google Chrome Next…

CSS3 properties Draft finalized end of 2005? still in draft 2010… Browser support initially limited Problems: buggy limited support POORLY designed standard