CS4370/6370 Web Development Cascading Style Sheets (CSS)

Slides:



Advertisements
Similar presentations
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} //
Advertisements

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 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!
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.
Web Design & Development Cascading Style Sheets (CSS)
CS134 Web Design & Development Cascading Style Sheets (CSS) Mehmud Abliz.
Using CSS for Page Layout. Types of HTML Elements Block-Level Element –Creates blocks of content e.g. div, h1..h6, p, ul, ol, li, table, form –They start.
CSE CASCADING STYLE SHEETS CSS Faculty of Computer Science and Engineering.
Multimedia and the World Wide Web HCI 201 Lecture Notes #7B.
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.
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.
Lecture 7 Cascading Style Sheets (CSS) Boriana Koleva Room: C54
3.1 Cascading Style Sheets. Motto Fashions fade, style is eternal. —Yves Saint Laurent.
Cascading Style Sheets 1 Color and Backgrounds. Cascading Style Sheets 2 Color and Backgrounds Computer color basics Expression of color values using.
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.
CSS1-1 Cascading Style Sheets (CSS) Xingquan (Hill) Zhu
Cascading Style Sheets Example
CSS Dvijesh Bhatt.
1Computer Sciences Department. And use
Basics of Smarajit Dasgupta.
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
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 in XHTML continued Please use speaker notes for additional information!
1 Cascading Style Sheets (CSS) Part 2. 2 The Sources of Style Sheets.
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.
Cascading Style Sheets " Provide means to control and change presentation of HTML documents. " Allow the user to impose a standard style. " Three levels.
(CSS) More Details Instructor: Mr. Ahmed Al Astal ITGD4104 Department Requirement for senior student University of Palestine Faculty of IT.
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.
Class three: CSS review, backgrounds, font formatting, the box model.
Tutorial #3 Cascading Style Sheets. Tutorial #2 Review - Anchors Links to Site DMACC Internal Links Go to Top Mail To me Local.
Cascading Style Sheet Bayu Priyambadha, S.Kom. Definition Cascading Style Sheets (CSS) form the presentation layer of the user interface. –Structure (HTML)
Introduction to CSS. What is CSS?  Cascading Style Sheets  Used for styling HTML  Also important in javascript and jquery for selectors  External.
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.
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.
Basics of Web Design Chapter 6 More CSS Basics Key Concepts.
 2008 Pearson Education, Inc. All rights reserved Cascading Style Sheets™ (CSS)
INTRODUCTORY Tutorial 4 Exploring Graphic Elements and Images.
 Cascading Style Sheets (CSS) ◦ Used to specify the presentation of elements separately from the structure of the document.  Inline style ◦ declare.
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:
3.2 Cascading Style Sheets. 2 Positioning Elements Normally, elements are laid out on the page in the order that they are defined in the XHTML document.
©SoftMoore ConsultingSlide 1 Introduction to HTML: Cascading Style Sheets.
Cascading Style Sheets Web Design Fairport High School.
5 th ed: Chapter 4 4 th ed: Chapter 5 SY306 Web and Databases for Cyber Operations Slide Set #4: CSS.
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
CSS: Cascading Style Sheets Part II. Style Syntax.
CSS Cascading Style Sheets *referenced from
Class & ID Selectors, Font and List Properties. Id Selectors  # followed by Id-name (without space)  Can be used once on a page  Examples: #p1 { color:
ECA 228 Internet/Intranet Design I Cascading Style Sheets.
PERSPECTIVES: TUTORIAL 4 CREATING PAGE LAYOUTS WITH CSS.
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.
Chapter 7.  Change body and link styles  Create a drop-down menu  Change color and font styles in the menu  Create a pop-up effect using CSS  Utilize.
CS 120: Introduction to Web Programming Lecture 10: Extra Features and Website Design Part 1 Tarik Booker CS 120 California State University, Los Angeles.
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.
1 CS428 Web Engineering Lecture 07 Font, Text & Background (CSS - II)
CSS Details Cascading Style Sheets. Lesson Overview  In this lesson, you will learn:  To use CSS properties for fonts  Evaluate whether to use pts,
HTML & CSS Contents: the different ways we can use to apply CSS to The HTML documents CSS Colors and Background CSS Fonts CSS Text CSS box model: padding,
CSS Layouts CH 13.
Cascading Style Sheets
Cascading Style Sheets™ (CSS)
Presentation transcript:

CS4370/6370 Web Development Cascading Style Sheets (CSS)

Selector Type Tag –redefines the look of a specific tag E.g. body {background-color: #000000;} Class –can apply to any tag E.g..indent{margin-right:5%;margin-left: 5%;} In HTML, Advanced –IDs, pseudo-class selectors E.g. #myId {color: #38608A;}

Values - Lenghts Lengths [a number + unit identifier] –Unit identifier can be em (font size of the relevant font), ex (x-height of the relevant font), px (pixels), in (inches), cm (centimeter), mm, pt (points, =1/72 in), pc (picas, 1 pc = 12 pt) –E.g. h1 { margin: 0.5em }, h1 { margin: 1ex }, p { font-size: 12px }, h2 { line-height: 3cm }, h4 { font-size: 12pt }, h4 { font- size: 1pc }

Values – Percentages & URIs Percentages [a number + %] –p { line-height: 120% } URLs & URIs –url(“ ”), or –url( ) –li { list-style: ( disc } –body { background: url("yellow.png") } where, “yellow” is relative to the URI of the style sheet.

Values - Colors Colors –A color is either a keyword (e.g. white, red), or a numerical RGB specification (e.g. ). A numerical RGB specification can be: –An RGB value in hexadecimal notation, which is a ‘#’ immediately followed by a 6 digit or 3 digit hexadecimal number, i.e. #rrggbb or #rgb. E.g. #ff0000, #f00 –An RGB value in functional notation, i.e. rgb(rrr,ggg,bbb), rgb(r%,g%,b%) E.g. rgb(255,0,0), rgb(100%,0%,0%)

Values - Colors 16 original predefined color codes (names) 216 browser safe colors –Colors display correctly on all color monitors –You can search online

Values - Strings String –Sequence of characters written inside double quotes ("") or single quotes (''). Examples "this is a ’string’“ "this is a \"string\"“ ’this is a "string"’ ’this is a \’string\’’

Box Properties margin : border : padding : width & height : Examples: p{ margin: 50px; padding: 30px; float: right; height: 200px; width: 400px; border: 5px solid #006633; }

Box Model

Box Property Example

Text Properties font-family :, |, … font-size : | | inherit font-weight : normal | bold | lighter | 100 | –normal = 400, bold = 700, lighter is relative font-style : normal | italic | oblique | inherit line-height : normal | | | inherit text-transform : capitalize | uppercase | lowercase | none | inherit color : text-indent : | | inherit text-align : left | right | center | justify | inherit

Text Properties Practice Practice –Create a paragraph text –Create internal style for tag as following –Create a internal style called “textStyle” and apply it to paragraph text and let it look like this this p{ margin: 50px; padding: 50px; clear: right; float: right; border: 10px solid #0066CC; }

Text Properties Practice Color is #666666; font-family is Arial, Helvetica, sans-serif; font-indent is 20%;

Positioning Properties height : | | inherit width : | | inherit left : | | auto | inherit top : | | auto | inherit right : | | auto | inherit bottom : | | auto | inherit position : static | relative | absolute | fixed | inherit left/top/right/bottom usually used when position is specified as absolute.

Values for position property ValueDescription staticDefault. An element with position: static always has the position the normal flow of the page gives it ( a static element ignores any top, bottom, left, or right declarations) relativeAn element with position: relative moves an element relative to its normal position, so "left:20" adds 20 pixels to the element's LEFT position absoluteAn element with position: absolute is positioned at the specified coordinates relative to its containing block. The element's position is specified with the "left", "top", "right", and "bottom" properties fixedAn element with position: fixed is positioned at the specified coordinates relative to the browser window. The element's position is specified with the "left", "top", "right", and "bottom" properties. The element remains at that position regardless of scrolling. Works in IE7 (strict mode)

Positioning Properties A floated box is shifted to the left or right until its outer edge touches the containing block edge or the outer edge of another float. Example.positionStyle { height: 400px; width: 200px; left: 50px; top: 50px; right: 50px; bottom: 50px; position:absolute; float: rigth; }

List Properties list-style: [disc | circle | square | decimal | lower-roman | upper-roman | lower-alpha | upper-alpha | none] || [inside | outside] || [ | none] –Example li { list-style: url( disc inside; } Can use the list-style-type, list-style- image, list-style-position separately.

List Properties Difference between inside and outside Outside

Box Model for List

Background Properties background-color: | transparent | inherit background-image: | none | inherit background-position: [ [ | | left | center | right ] [ | | top | center | bottom ]? ] | [ [ left | center | right ] || [ top | center | bottom ] ] | inherit background-repeat: repeat | repeat-x | repeat-y | no-repeat | inherit background-attachment: scroll | fixed | inherit

Background Properties Practice body { background-image: url( background-repeat:no-repeat; color: #FFFFFF; background-position:center; background-color: #666666; background-attachment: fixed; }

and tags –is a generic block-level tag –is a generic inline tag, it spans a series of characters Example.subTitle { font-family: Georgia, Times, serif; font-size: 14px; font-weight: bold; color: #960000; } blah blah blah some text in different style text text text text

tag : –defines the title of the document. –Placed between and Example XHTML Tag Reference …

Directory Structure