CIS 1315 – Web Development for Educators CIS 1315 HTML Tutorials 3 & 4: Working With CSS.

Slides:



Advertisements
Similar presentations
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.
Advertisements

1 Pengantar Teknologi Internet W03: CSS Cascading Style Sheets.
CIS 1310 – HTML & CSS 6 Layout. CIS 1310 – HTML & CSS Learning Outcomes  Describe & Apply the CSS Box Model  Configure Float with CSS  Designate Positioning.
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.
Cascading Style Sheets Color and Background Controls Border and Margin Controls (Boxes)
9-May-15 More CSS. 2 A different emphasis CSS is the same for XML as it is for HTML and XHTML, but-- XML contains no display information If you want your.
Today’s objectives Site performance Padding, Margins, Borders
Week 9 Using the Box Properties. 9-2 The CSS Visual Formatting Model Describes how the element content boxes should be displayed by the browser –Based.
Tutorial 4: Creating page layout with css
Tutorial 5 Working with the Box Model. XP Objectives Understand the box model Create padding, margins, and borders Wrap text around an image Float a block-level.
Working with Cascading Style Sheets
 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.
Cascading Style Sheets 1. About Lists HTML list code ul, ol, dldl CSS list-item style properties
Cascading Style Sheets Part 3 Fall, 2007 Modified by Linda Kenney Nov. 12, 2007.
Cascading Style Sheets Cyndi Hageman. Applying a Style Sheet  In-line style – used within the HTML tag  Embedded Style Sheet – located in the HTML document.
CSS II Digital Media: Communication and design IT University of Copenhagen.
XP 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
14-Jul-15 CSS Applications to XML. 2 A different emphasis CSS is the same for XML as it is for HTML, but-- HTML already does a pretty good job of layout.
Lecture CSS: Cascading Style Sheets. What are Styles? Cascading Style Sheets (CSS) is a style sheet language used to describe the presentation semantics.
Working with Cascading Style Sheets. 2 Objectives Introducing Cascading Style Sheets Using Inline Styles Using Embedded Styles Using an External Style.
Principles of Web Design 6 th Edition Chapter 4 – Cascading Style Sheets.
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 Example
Cascading Style Sheets CS3505. What are CSS? Method for adding style attributes consistently to HML tags Cascading because styles are applied in order.
Cascading Style Sheets Billy Toy Cascading Style Sheets Syntax review How to Implement style sheets Background properties Text properties.
XP Tutorial 7New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks.
CSS Dvijesh Bhatt.
Dreamweaver -- CSS. Dreamweaver -- MX New icons are added in MX Most of the features commonly used in web design, and are same as FrontPage. New feature.
Cascading Style Sheets, pt 2 ECA 225 Applied Online Programming.
WORKING WITH CASCADING
New Perspectives on XML, 2nd Edition Tutorial 5 1 TUTORIAL 5 WORKING WITH CASCADING STYLE SHEETS.
XP New Perspectives on XML Tutorial 5 1 TUTORIAL 5 CSS Tutorial – Carey ISBN
CSS Introduction Cascading Style Sheets Provides a great deal of control over the presentation of the document HTML indicates both semantics of a document.
Tutorial 4 Creating Special Effects with CSS
1 Cascading Style Sheets (CSS) Part 2. 2 The Sources of Style Sheets.
CSS The Definitive Guide Chapter 8.  Allows one to define borders for  paragraphs  headings  divs  anchors  images  and more.
Doman’s Sections Information in this presentation includes text and images from
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.
CSS Border.
CSS-Lists CSS provides special properties that are designed for lists. It is usually more convenient to use these properties whenever you can. To specify.
MySQL and PHP Review CSS. Cascading Style Sheet (CSS) Style sheets are files or forms that describe the layout and appearance of a document. Cascading.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Tutorial 7.
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.
 2008 Pearson Education, Inc. All rights reserved Cascading Style Sheets™ (CSS)
Chapter 6 Introducing Cascading Style Sheets Principles of Web Design, 4 th Edition.
INTRODUCTORY Tutorial 4 Exploring Graphic Elements and Images.
Cascading Style Sheets Part 3 Spring, 2008 Modified by Linda Kenney April 21, 2008.
>> The “Box” Model. Pre-requisite Create a new project in Netbeans called Week5 Create a new html file and name it box.html Create a new css file and.
 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.
 Cascading Style Sheets (CSS) ◦ Used to specify the presentation of elements separately from the structure of the document.  Inline style ◦ declare.
CSS Class 2 -Add margins to elements on a page. -Set width and height of elements. - CSS shorthand properties for box model. -Style links. -Style tables.
XP Review 2 New Perspectives on JavaScript, Comprehensive1 Introducing Cascading Style Sheets Formatting Web Pages with CSS.
1 CS428 Web Engineering Lecture 08 Border, Margin, Padding … (CSS - III)
CSS Layout Cascading Style Sheets. Lesson Overview  In this lesson, you will learn:  CSS Box Model  CSS properties for border  CSS properties for.
CNIT 132 – Week 4 Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of.
©SoftMoore ConsultingSlide 1 Introduction to HTML: Cascading Style Sheets.
Tutorial 4 Creating Page Layouts with CSS
CIS234A Lecture 6 Instructor Greg D’Andrea. Span and Div The span and div elements are a generic means by which we can add structure to documents. The.
CIS 228 The Internet 10/18/11 Grouping XHTML. CSS Selectors Rule: selector-group { property-declaration* } Selector-group: selector *, Selector: simple-selector.
Tutorial #5 Working with the Box Model. Tutorial #4 Review - CSS Create a homework page Final Project Discussion Exam on Blackboard Styling Lists (List-style-type,
Tutorial 3 Designing a Web Page with CSS
Chapter 6 Introducing Cascading Style Sheets Principles of Web Design, Third Edition.
HTML 5 AND CSS Dr Mohd Soperi Mohd Zahid Semester /16.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
Unit 3 - Review. Topics 1. Tag, Attribute, Value 2. CSS Rule Syntax + link 3. Categories of Selectors 4. Inline vs Block Tags 5. CSS Layout 6. CSS Box.
Blended HTML and CSS Fundamentals 3 rd EDITION Tutorial 4 Formatting Text and Links.
Cascading Style Sheet List Properties Box Properties Pseudoclass
>> The “Box” Model
6 Layout.
Presentation transcript:

CIS 1315 – Web Development for Educators CIS 1315 HTML Tutorials 3 & 4: Working With CSS

CIS 1315 – Web Development for Educators CSS Basics  Style Rules Determines Style Characteristics for an HTML Element Selector Determines Element to Which Rule is Applied Declaration Details the Exact Property Values Property Quality or Characteristic (e.g., Color) Value Specification of Property (e.g., Blue)  Style Sheet Set of Style Rules

CIS 1315 – Web Development for Educators CSS Basics  Style Rule Syntax

CIS 1315 – Web Development for Educators Combining CSS & HTML  Inline Modify the Appearance of a Particular Element Style Attribute  Embedded Applied To An Entire Document Redefines All Occurrences of a Particular Element Uses … in  Linked External File of Declarations Available to an Entire Site ASCII File with an Extension of.css

CIS 1315 – Web Development for Educators Inline Style  Defines a Style for a Single Element Generally Used to Override a Style Set at a Higher Level Only Affects One Instance of an Element  Syntax

CIS 1315 – Web Development for Educators Embedded Style  Always Contained in the Generally Used to Override a Style Set at a Higher Level Only Affects the Document in Which it Resides  Syntax selector {declarations} h1 {color:green; font-family:sans-serif;} b {color:yellow; background-color:green;}

CIS 1315 – Web Development for Educators Linked Style  External Style Sheet Always Contained in the Text Document that Contains Style Rules Allows Specification of Rules for Multiple Documents Does Not Contain HTML Code  Syntax

CIS 1315 – Web Development for Educators Inheritance  Parent Element that Contains Another Element  Child Element within Another Element  Inheritance CSS Rules Inherit from Parent to Child Elements Based on Hierarchical Structure of Documents

CIS 1315 – Web Development for Educators Basic Selection  Type Selectors Selector Determines Element to which Declaration is Applied Style Sheet Examples: h2 {color: red;} p {font-size: 10 pt;}

CIS 1315 – Web Development for Educators Basic Selection  Grouping Selectors Set the Same Declaration for Multiple Selectors  Syntax: h1 {color: red;} h2 {color: red;} or h1, h2 {color: red;}

CIS 1315 – Web Development for Educators Basic Selection  Combining Declarations Multiple Declarations May be Stated for Same Selector  Syntax: p {color: blue;} p {font-size: 12pt;} or p {color: blue; font-size: 12pt;}

CIS 1315 – Web Development for Educators Basic Selection  Descendant Selector AKA Contextual Selectors Based on Hierarchical Structure of Elements in Document  Syntax: b i {color: #336699; background-color: #000000;} Does Not Apply to i b

CIS 1315 – Web Development for Educators Advanced Selection  id Attribute Selector Applied to Only ONE Unique Element in a Document Core Attribute that can be Applied to Any HTML Element  Syntax: This is a unique paragraph that is the preface of the document

CIS 1315 – Web Development for Educators Advanced Selection  class Attribute Selector Enables Application of Rule to Selected Element(s) Core Attribute that can be Applied to Any HTML Element  Syntax: Text in red with a 30 pixel margin May be Restricted to a Specific Element Type h1.quote {color: red; margin: 30px;}

CIS 1315 – Web Development for Educators Advanced Selection  … Block Level Element Used to Contain Other HTML Elements Displayed Discretely from the Rest of the Document Paragraph Breaks Added Before and After Contents  … Inline Element Used to Contain Other HTML Elements Used within Text Blocks

CIS 1315 – Web Development for Educators Advanced Selection  Pseudo-Class Selectors Select Elements Based on Characteristics Other Than Name Link Pseudo-Classes :link Allow Modification of Style Characteristics for Unvisited Links :link {color: green;} :visited Allow Modification of Style Characteristics for Visited Links :visited {color: green;}

CIS 1315 – Web Development for Educators Advanced Selection  Pseudo-Class Selectors Dynamic Pseudo-Classes Apply Styles to an Element Based on User’s Actions :hover Applies Style When User Mouses Over Element :active Applies Style When User Activates Element :focus Applies Style When Element is Accepting User Input

CIS 1315 – Web Development for Educators Advanced Selection  Pseudo-Elements Selectors Modify Aspects of Document Not Classified by Elements :first-letter Apply Style Rules to the First Letter of Any Block-level Element Initial Capitals Drop Capitals

CIS 1315 – Web Development for Educators Advanced Selection  Pseudo-Element Selectors :first-letter

CIS 1315 – Web Development for Educators Advanced Selection  Pseudo-Element Selectors :first-line Apply Style Rules to the First Line of Any Block-level Element

CIS 1315 – Web Development for Educators Visual Formatting Model  Three Element Display Type Categories Block (e.g., Paragraphs) Contain Inline Boxes that Contain Element Content Inline Contain Content within the Block-level Elements Do not Form New Blocks of Content List-item Creates Surrounding Container and List-item Inline Boxes display: block | inline | list-item | none

CIS 1315 – Web Development for Educators Box Model  Describes Rectangular Boxes that Contain Content Each Block-level Element is Displayed as a Box Each Content Box can have Margins, Borders, & Padding

CIS 1315 – Web Development for Educators Margin Properties  margin: # | % Shorthand Property Sets All Four Individual Margins

CIS 1315 – Web Development for Educators Margin Properties  margin-left | margin-right | margin-top | margin- bottom: # | % Negative margins can be set to achieve special effects

CIS 1315 – Web Development for Educators Padding Properties  padding: # | % Shorthand Property Sets All Four Individual Paddings Same Format as Margin  padding-left | padding-right | padding-top | padding-bottom: # | %

CIS 1315 – Web Development for Educators Border Properties  border: style width color Shorthand Property Sets All Four Individual Borders Same Format as Margin

CIS 1315 – Web Development for Educators Border Properties  border-style: keyword Keywords none dotted dashed solid double groove ridge inset outset

CIS 1315 – Web Development for Educators Border Properties  border-width: thin | medium | thick | #  border-color: value

CIS 1315 – Web Development for Educators Special Box Properties  width: # | % Sets Horizontal Width of a Containing Box  height: # | % Sets Vertical Height of a Containing Box  float: left | right | none Sets Position of an Element to Left/Right of Parent Element  clear: none | left | right | both Controls Flow of Text Around Floated Elements

CIS 1315 – Web Development for Educators Special Box Properties  float & clear

CIS 1315 – Web Development for Educators Background Properties  background-color

CIS 1315 – Web Development for Educators Background Properties  background-image

CIS 1315 – Web Development for Educators Background Properties  background-repeat

CIS 1315 – Web Development for Educators Background Properties  background-position

CIS 1315 – Web Development for Educators List Properties  list-style-type: disc | circle | square | decimal | decimal-leading-zero | lower-roman | upper- roman | lower-greek | lower alpha | lower-latin | upper-alpha | upper-latin | hebrew | armenian | georgian | cjk-ideographic | hiragana | katakana | hira-ganairoha | katakana-iroha | none Default = disc Allows Customization of the List Marker  Syntax: ul {list-style-type: circle;}

CIS 1315 – Web Development for Educators List Properties  list-style-type

CIS 1315 – Web Development for Educators List Properties  list-style-image: url(filename.ext) Allows Use of Image as List Marker  Syntax: ul {list-style-image: url(paw.gif);}

CIS 1315 – Web Development for Educators List Properties  list-style-position: inside | outside Default = inside Allows Placement of the List Marker  Syntax: ul {list-style-position: outside;}

CIS 1315 – Web Development for Educators Positioning Properties  position: type position size type = static | relative | absolute | fixed position = top | left | bottom | right size = height | width

CIS 1315 – Web Development for Educators Positioning Properties  div {position:absolute; left:130px; top:100px;}

CIS 1315 – Web Development for Educators Positioning Properties  div {position:absolute; left:130px; top:100px; width: 100px;}