© 2007 D. J. Foreman CSS-1 Cascading Style Sheets Styles.

Slides:



Advertisements
Similar presentations
CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
Advertisements

Week 7 Web Typography. 2 Understanding Type Design Principles.
Introduction to Cascading Style Sheets (CSS) Module 2: HTML Basics LESSON 4.
Cascading Style Sheets (CSS) Why do we need them? Separate structure from browser presentation There are many HTML presentation attributes –We want to.
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.
SM5312 week 6: basic CSS syntax1 An Introduction to Cascading Style Sheets Basic CSS Syntax Nick Foxall.
CSS: Cascading Style Sheets. What are Style Sheets A style sheet is a mechanism that allows to specify how HTML (/XHTML/XML) pages should look The style.
1 Cascading Style Sheets C S S. 2 What is CSS? A simple mechanism for controlling the style of a Web document without compromising its structure. It allows.
Using Cascading Style Sheets CSS Structure. Goals Understand how contextual, class and ID selectors work Understand how contextual, class and ID selectors.
Cascading Style Sheets1. 2 n Style sheets are a means of controlling the way HTML tags are formatted n IE introduced style sheets in IE 3.0 release n.
Cascading Style Sheet (CSS) Instructor: Dr. Fang (Daisy) Tang
Cascading style sheets - CSS
Lecture CSS: Cascading Style Sheets. What are Styles? Cascading Style Sheets (CSS) is a style sheet language used to describe the presentation semantics.
3.1 Cascading Style Sheets. Motto Fashions fade, style is eternal. —Yves Saint Laurent.
Stylin’ with CSS. 2 Topics What is CSS? Why CSS? CSS Examples.
Formatting Text (Plus More Selectors) Learning Web Design: Chapter 12.
CSS: Cascading Style Sheets. 2 History HTML tags were originally designed to define the content of a document. The layout of the document was supposed.
TECH2018 Multimedia and the Internet More about CSS and Page Layouts.
XHTML and CSS Introduction to XHTML and CSS Bharti Patel 1 phones off (please)
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,
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 CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
Cascading Style Sheet (CSS)
Tutorial #3 Cascading Style Sheets. Review: Last Class Image sizing Pathnames Project Default Path Relative Path Absolute Path Blackboard Homework Submission.
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.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
CSS: Cascading Style Sheets. 2 What are Style Sheets A style sheet is a mechanism that allows to specify how HTML (/XHTML/XML) pages should look The style.
 A style sheet is a single page of formatting instructions that can control the appearance of many HTML pages at once.  If style sheets accomplished.
Using Cascading Style Sheet As you create more web pages, you may wish to impose a consistent look for all of your web pages or for group of related pages.
Tutorial #4 Formatting Text and Links. Tutorial #3 Review - CSS CSS format Selector { property1: value1; /* Comments */ } Embedded, In-Line, and External.
Tutorial 5 Formatting with CSS. Objectives Session 5.1 – Evaluate why CSS styles are used – Determine where to write styles – Create an element selector.
Tutorial #3 Cascading Style Sheets. Tutorial #2 Review - Anchors Links to Site DMACC Internal Links Go to Top Mail To me Local.
CSS Font CSS font properties define the font family, boldness, size, and the style of a text. CSS Font Families Generic family Font familyDescription Serif.
Cascading Style Sheets Class 2, Lecture 2 Rachel A Ober
Cascading Style Sheets Part 1. CSS vs HTML HTML: Originally intended to markup structure of a document (,...,,,,,...) CSS Developing technology, CSS1,
Stylin’ with CSS Monday October 8 th and Tuesday October 9 th.
Files you will need ... Black Goose Bistro Summer Menu
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.
Cascading Style Sheets Robin Burke ECT 270. Outline Midterm The Layout Debate CSS properties Fonts Alignment Color CSS selection selectors pseudo-classes.
Cascading Style Sheets
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.
Cascading Style Sheets (CSS). A style sheet is a document which describes the presentation semantics of a document written in a mark-up language such.
1 Web Development CSS (Cascading Style Sheet). 2 1.Setting rules for multiple elements To decrease the amount of typing for setting rules for multiple.
XHTML Formatting font with a style declaration. Formatting Font HTML uses the font tag to change size and family of font But… the font tag is being deprecated.
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.
Developing Web Applications with HTML and CSS “Selectors and Properties”
CSS Fonts. The Font properties allow you to change the font family, boldness, size, and the style of a text.
CSS: Cascading Style Sheets Part II. Style Syntax.
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.
03 CSS (Cascading StyleSheet) Р.Жавхлан МОНГОЛ УЛСЫН ИХ СУРГУУЛЬ Мэдээллийн технологийн сургууль Интернэт технологийн үндэс 2015 Намар.
Chapter 11 & 12 CSS Style Sheets: Intro. Why CSS? Separate presentation from content – more accessible Less work – can change appearance of whole site.
CSS Details Cascading Style Sheets. Lesson Overview  In this lesson, you will learn:  To use CSS properties for fonts  Evaluate whether to use pts,
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 Cascading Style Sheets. Session Checklist ► Learn why style sheets are needed and their advantages and disadvantages ► Learn the format of a style.
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.
Cascading Style Sheets Robin Burke ECT 270. Outline CSS properties Fonts Alignment Color CSS selection selectors.
WebD Introduction to CSS By Manik Rastogi.
Cascading Style Sheets
Introducing :CSS Cascading Style Sheets in 5 Lessons.
Cascading Style Sheets
Cascading Style Sheets
Cascading Style Sheets
Cascading Style Sheets
Cascading Style Sheets
Cascading Style Sheets
Presentation transcript:

© 2007 D. J. Foreman CSS-1 Cascading Style Sheets Styles

CSS-2 © 2007, D. J. Foreman Purpose  Consistency of formatting  Modify tags  Ease of formatting  "Layers" within a document

CSS-3 © 2007, D. J. Foreman 3 types of styles  In-line ■ Specific to each tag-use  Embedded or Global ■ Applies to whole file  Linked or External ■ Rules saved in a separate file ■ Can apply to multiple files

CSS-4 © 2007, D. J. Foreman Syntax rules  TAG {attributes} ■ Attribute : value ; ■ ; not needed after last attribute  values may be merged ■ Separated by blanks  values may contain choices ■ Separated by commas

CSS-5 © 2007, D. J. Foreman Example of an Inline Style   Changes only this one tag  Note use of : ; ■ style used as an attribute in the TAG, so quotes required here ■ No { } for inline styles

CSS-6 © 2007, D. J. Foreman Example of an Embedded Style H1, H2 {color: blue; font-family: Arial, Sans-serif }note comma for choices B {color: red; font-size:120%} LI B {color: gold; font-size:120%}  NOTE: no quotes inside { }

CSS-7 © 2007, D. J. Foreman this bold text will be red & 110% Example of External Style H1, B {color: red; font-size: 110%} Note: no tags required here The Web Page file The Style file "mystyle.css" Type= specifies the language used for the styles

CSS-8 © 2007, D. J. Foreman Generic Font-family Names  Serif  Sans-serif  Monospace  Cursive  Fantasy

CSS-9 © 2007, D. J. Foreman Specific Font-family Names  Arial  Times Roman  Courier New  Gigi  Lucida Calligraphy  Comic Sans MS Example: H1 {font-family: times roman, arial, serif}

CSS-10 © 2007, D. J. Foreman Font-size  Length0.5in, 20px, 36pt  Keywordxx-small, x-small,  Percent105%  Relative2em, 5ex Example: H1 {font-size: xx-large}

CSS-11 © 2007, D. J. Foreman Inheritance  BODY {color: blue}  H1, H2 {font-size: 115%}  B {color: red} ■ tags will override body color value Note: tags needed if this is an embedded style

CSS-12 © 2007, D. J. Foreman Font Attributes  Font-family  serif  Font-size  3em medium larger*  Font-style  italic normal oblique  Font-weight  bold example H1 {Font: 2em italic bold arial, courier} ■ Note merging of values, followed by choices

CSS-13 © 2007, D. J. Foreman Anchor-tag Attributes  A:visited {styles}  A:link {styles}  A:active {styles}  A:hover {styles}

CSS-14 © 2007, D. J. Foreman Some Misc. Attributes  Text-indent: 10% 3em  Vertical-align: 10% -10% 3mm  Letter-spacing:.3em  Word-spacing:.4em  Line-height: 2 5mm 120% ("2" means 2*ratio of line-height/font-size)  Text-decoration:none underline

CSS-15 © 2007, D. J. Foreman Lists UL {list-style-type: circle} UL UL {list-style-type: disk} UL UL UL {list-style-type: square} list-style-position: inside or outside inside is like a hanging-indent

CSS-16 © 2007, D. J. Foreman Style Classes Classes allow re-use of a style Two steps: 1. Define a style class 2. Use the class in the HTML

CSS-17 © 2007, D. J. Foreman Classes (2 types)  Bound Syntax:tag.classname {styles} Style definition:H1.myheader {color:red} Usage: text  Unbound Syntax:.classname {styles} Style definition:.myreds {color:red;} Usage: text text

CSS-18 © 2007, D. J. Foreman DIV & SPAN assigns a NAME to an enclosed block:,,,,,, Designed for single-use for non-block elements:, etc

CSS-19 © 2007, D. J. Foreman Layer Definitions #layer1 {position:absolute; top:400px; left:10px; } #layer2 { etc. } (note: "#" for an ID vs a period for a class)

CSS-20 © 2007, D. J. Foreman Layer Usage note: no # here but it IS on the definition

CSS-21 © 2007, D. J. Foreman Examples.grn {color: green; font-size: 20px;} #lyr {position: 10px} green text a layer green layer Note: cannot use these 2 div's in same page (2 different texts, same layername)