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.

Slides:



Advertisements
Similar presentations
Web Engineering 1 Ishaq Khan Shinwari MCS City University Peshawar.
Advertisements

Cascading Style Sheets (CSS): Pixel-Level Control with HTML Ease
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.
Cascading Style Sheets By: Valerie Kuna. What are Cascading Style Sheets? Cascading Style Sheets (CSS) are a standard for specifying the presentation.
Building a Website: Cascading Style Sheets (CSS) Fall 2013.
Part 3 Introduction to CSS. CSS Text Text Styles h1 {color: green} // rgb(0,255,0), #00ff00 h2{letter-spacing: 0.5cm} // 2px h3 {text-align: right} //
Measurement Many CSS properties (values within the declaration) require that you specify a unit of measurement, such as spacing between elements, border.
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.
Cascading Style Sheets (Formatting. Slide 2 Lecture Overview At this point, you have learned how and where to create styles You have not learned much.
CS4370/6370 Web Development Cascading Style Sheets (CSS)
CASCADING STYLE SHEETS CSS. 2 What CSS means?  CSS is an extension to basic HTML that allows you to style your web pages.  It separates the part that.
Text Properties, Line Box, CSS. Text Properties Properties related to the display of text. Text-align : left, right, center I like FSU!
Web Design & Development Cascading Style Sheets (CSS)
CSE CASCADING STYLE SHEETS CSS Faculty of Computer Science and Engineering.
Style sheets can also affect the BODY. style4.css BODY {BACKGROUND-COLOR : white} H1 {COLOR : red; FONT-SIZE : 50; FONT-FAMILY : arial} H2 {COLOR : green}
Style sheets can also affect the body. style4.css body {background-color : white} h1 {color : red; font-size : 50; font-family : arial} h2 {color : green}
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.
© 2007 D. J. Foreman CSS-1 Cascading Style Sheets Styles.
Selectors thru Borders. CSS – Cascading Style Sheets – is a way to style HTML HTML is the content base of a web page CSS provides the presentation qualities.
CSS1-1 Cascading Style Sheets (CSS) Xingquan (Hill) Zhu
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.
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.
1Computer Sciences Department. And use
Tutorial #3 Cascading Style Sheets. Review: Last Class Image sizing Pathnames Project Default Path Relative Path Absolute Path Blackboard Homework Submission.
Cascading Style Sheets, pt 2 ECA 225 Applied Online Programming.
Cascading Style Sheets CSS. CSS - Structure Declaration block Property: identifies what to change Value: how to change it Selector – example h1{ font-size:
WORKING WITH CASCADING
WDV 101 Intro to Website Development
INTRODUCTION TO HTML5 Styling Text. Change the Font Size  You can use the font-size property to change the font size for a document’s text.  Instead.
Chapter 12 Cascading Style Sheets: Part II The Web Warrior Guide to Web Design Technologies.
CSS – Cascading Style Sheets Fred Durao
CIS 1315 – Web Development for Educators CIS 1315 HTML Tutorials 3 & 4: Working With CSS.
Tutorial #4 Formatting Text and Links. Tutorial #3 Review - CSS CSS format Selector { property1: value1; /* Comments */ } Embedded, In-Line, and External.
Cascading Style Sheets Chapter Four. What are they? A set of style rules that tell the web browser how to present a web page or document. Cascading Style.
Tutorial #3 Cascading Style Sheets. Tutorial #2 Review - Anchors Links to Site DMACC Internal Links Go to Top Mail To me Local.
Introduction to CSS. What is CSS?  Cascading Style Sheets  Used for styling HTML  Also important in javascript and jquery for selectors  External.
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)
INTRODUCTORY Tutorial 4 Exploring Graphic Elements and Images.
Cascading Style Sheets Robin Burke ECT 270. Outline Midterm The Layout Debate CSS properties Fonts Alignment Color CSS selection selectors pseudo-classes.
Creating Your Own Webpage COSC Cascading Stylesheets Think of: HTML: content of your webpage HTML has tags CSS: presentation and appearance of your.
 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.
Cascading Style Sheets Eugenia Fernandez IUPUI. CSS Purpose CSS allow you to specify the style in which your XML elements are displayed. CSS were originally.
XP Review 2 New Perspectives on JavaScript, Comprehensive1 Introducing Cascading Style Sheets Formatting Web Pages with CSS.
CIS234A Lecture 5 Instructor Greg D’Andrea. Font Styles Review Font-Family: generic family, font family Font-Size: em, pt, px, %, mm, cm, in Font-Style:
©SoftMoore ConsultingSlide 1 Introduction to HTML: Cascading Style Sheets.
5 th ed: Chapter 4 4 th ed: Chapter 5 SY306 Web and Databases for Cyber Operations Slide Set #4: CSS.
ECA 228 Internet/Intranet Design I Cascading Style Sheets.
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 11 & 12 CSS Style Sheets: Intro. Why CSS? Separate presentation from content – more accessible Less work – can change appearance of whole site.
Blended HTML and CSS Fundamentals 3 rd EDITION Tutorial 3 Introducing Cascading Style Sheets.
1 CS428 Web Engineering Lecture 07 Font, Text & Background (CSS - II)
WebD Introduction to CSS By Manik Rastogi.
CS3220 Web and Internet Programming CSS Basics
Cascading Style Sheets™ (CSS)
( Cascading style sheet )
Cascading Style Sheets (Formatting)
3.5 Property Value Forms - There are 60 different properties in 7 categories: - Fonts - Lists - Alignment of text - Margins - Colors - Backgrounds - Borders.
The Internet 10/13/11 The Box Model
CSS Style Sheets: Intro
CS3220 Web and Internet Programming CSS Basics
Cascading Style sheet. What is CSS?  CSS stands for Cascading Style Sheets  Cascading: refers to the procedure that determines which style will apply.
Cascading Style Sheets
Cascading Style Sheets
Cascading Style Sheets™ (CSS)
Presentation transcript:

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 in the tags  Imported – external.css file imported by {url(“styles.css”)} in the style tags  Linked – external.css in a link tag

Order of Precedence  In-line styles  Embedded styles  Imported style sheet  Linked style sheet

Class  Used to create a style that can be applied to many different HTML elements.sectionhdr{color:blue;font-size: 14pt}

ID  Used to set the style for specific id of an element on a page. ID’s are unique and cannot be repeated on a page. They can be reused on different pages so the style sheet will apply throughout a web site. #divhdr{background-color:green; text- align:center}

Comments  You can add HTML comment tags to ensure older browsers that do not understand will not get confused  You can put comments in a style sheet by placing your comm/ent inside /* */ /*Use this style for all section headers*/

Inheritance  Child elements inherit the styles of the parent elements if those styles are not set for the child element.  Child elements are contained within other elements  Parent elements contain other tags – such as the

Deprecated Elements  HTML elements that are no longer used and are replaced by styles.

Modularity  The ability of a single document to incorporate style information originating from multiple sources and serving multiple purposes  Author – sets styles through.css files, in-line styles or embedded styles  User – can set their own stylesheet by clicking Tools/Options/Accessibility and checking Format documents using my style sheet  Browser – each browser is set differently and can be affected by display settings, resolutions and monitor dimensions

Units of measurement  Pixels - px  Point – pt  Inches – in, centimeters – cm, millimeters – mm  em – calculated based on the default size. If default is 14px then 1.5em is 14*1.5  Xxsmall, small, large, xxlarge  Percentages - %

Margins  margins: 5px margins: 10px 5px 2px 1px (top, right, bottom, left)  margin-top, margin-bottom, margin-left, margin-right

Negative Margins  Used to offset an element from it’s parent element  For example, the negative setting for a will move it back from it’s original position body {margin-left:5%} h1 {margin-left:-3%}

Padding  Sets the space between the element content and the margin  You can set the padding universally h1 {padding:5px}  You can set each side individually h1 {padding-left:5px; padding-right:10px; padding-top:2px; padding-bottom:3px}

Font Families  Used to set which fonts will be used for an element  Generic font families are a catch all and should be included as a back-up Serif – some version of Times New Roman Sans-serif - some version of arial or Helvetica Monospace – some version of Courier Cursive – browser determined – avoid Fantasy – browser determined - avoid

Font Families (cont.)  You can list specific fonts body {font-family: Arial, Helvetica, sans}

Font Color  You can set the color by using the color style h1 {color:navy}  You can set the color value different ways Word – red, blue, orange, green, aqua Rgb – color: rgb(255,255,204) Hexadecimal – color: #FFFFFF

Background color  Background-color: blue

Monospace fonts  Font in which all the characters are the same width  Courier or Courier New

Font-Size  Sets the font size of an element body{font-size:10pt}  Can use any absolute measurement to set your default. You can use a calculated measurement to make enhance an element

Font-Weight  Default is normal  Used to make things bold span{font-weight:bold}

Font Style  Default is none  Used to make things italic span{font-style:itlaic}

Text Decoration  Used to apply an underline or overline a{text-decoration:none} a:hover {text-decoration:underline}

Letter Spacing  Allows you to set the spacing between letters h1 {letter-spacing: 0.5em}

Word Spacing  Sets the amount of space between words in an element h1 {word-spacing: 0.5em}

Text Indent  Indents the first line of an element p {text-indent: 5px}

Text Alignment  Used to align the content with the element td{text-align:center}  Can align center, left, right or justify

Text Transform  Transform all the text in an element to upper or lower case h1 {text-transform: uppercase}

Background Image  Sets the background image for an element.flower{background-image: url(“flower.jpg”)}  Background images are defaulted to repeat. If you want to change this you need to set the background-repeat style Repeat the x axis – background-repeat: repeat-x Repeat the y axis – background-repeat:repeat-y No repeat – background-repeat: no repeat

Lists  List-style-position: outside or inside Outside – default – blocks the text Inside – wraps the text around the bullet  List-style-image: url(“mybullet.gig”)  List-style-type None – no marker Disc – solid circle Circle – empty circle Square – solid square Decimal – 1,2,3,etc Lower roman – i,ii,iii, iv, etc Upper roman – I,II, III, IV, etc

Lists (cont.)  Bullet separation – space between the bullets can be set using the padding style ul li {padding: 1.5%}  Nested lists – can define each level of nested lists in your style sheet ul{list-style-type: circle} ul ul{list-style-type:square} ul ul ul{list-style-type:disc}

Definition Lists  Used to create a glossary of FAQ  data list  data term 

Border Style  You can set the border-style Double Dotted Dashed Groove Ridge Inset outset

Border Width  You can set the border by your usual units of measurement  You can also use keywords Thick Thin medium

Border color  You can set border-color using the same types of color definitions as you set the font color

Positioning  Absolute – sets the position on the page within its containment block.  Relative – sets the position on the page relative to it’s containment block. Used to overlay objects  Set the top, bottom, left or right position with these values {position:absolute; top:10px; left:30px}

Tables  Cellpadding – can be set by usinig the padding style for the or  Cellspacing – can be set by setting border- collapse:collapse then setting the border-width and border-spacing  Vertical alignment of text can be set to a Top, bottom, center  Horizontal alignment of text can be set using the text-align for a

Display  Displays an element  No whitespace is reserved  Set to none, the element does not display  Set to “” the element will display

Visibility  Can make something visible or not  Whitespace is reserved on the page for that element  To hide an element set the visibility: hidden  To show the element set the visibility: visible