W EB S ITE L ECTURE C ASCADING S TYLE S HEETS. Cascading Style Sheets (CSS) Introduction CSS Objectives – Provide more control over web site content presentation.

Slides:



Advertisements
Similar presentations
Table, List, Blocks, Inline Style
Advertisements

HIGH LEVEL OVERVIEW: CSS CSS SYNTAX CONSISTS OF A SET OF RULES THAT HAVE 3 PARTS: A SELECTOR, A PROPERTY, AND A VALUE. IT’S NOT NECESSARY TO REMEMBER THIS.
Web Engineering 1 Ishaq Khan Shinwari MCS City University Peshawar.
Cascading Style Sheets
CSS. Intro to CSS Cascading Style Sheets – styles and enhances appearance of webpage.css extension.
Chapter 3 – Designing your web pages Dr. Stephanos Mavromoustakos.
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.
Building a Website: Cascading Style Sheets (CSS) Fall 2013.
กระบวนวิชา 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.
Web Design with Cascading Style Sheet Lan Vu. Overview Introduction to CSS Designing CSS Using Visual Studio to create CSS Using template for web design.
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.
Beginning Web Site Creation: Dreamweaver CS4. XHTMLCSS  Describes the structure  Content  Collection of styles  Formatting body { background-color:
Using Cascading Style Sheets CSS Structure. Goals Understand how contextual, class and ID selectors work Understand how contextual, class and ID selectors.
4.01 Cascading Style Sheets
Using Cascading Style Sheets. Introduction to Styles and Properties  Cascading Style Sheets (CSS) are a standard set by the World Wide Web Consortium.
Chapter 4 Cascading Style Sheets Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
CSS Dvijesh Bhatt.
HTML - Quiz #2 Attendance CODE:
Cascading style sheets (CSS)
Principles of Web Design 6 th Edition Chapter 10 – Data Tables.
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.
Learning HTML. HTML Attributes HTML elements can have attributes Attributes provide additional information about an element Class – specifies a class.
Doman’s Sections Information in this presentation includes text and images from
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.
1 What is CSS?  CSS stands for Cascading Style Sheets  Styles define how to display HTML elements  Styles are normally stored in Style Sheets  Styles.
Web Programming Language Dr. Ken Cosh Week 2 (CSS I)
(CSS) More Details Instructor: Mr. Ahmed Al Astal ITGD4104 Department Requirement for senior student University of Palestine Faculty of IT.
To Proudly supported by ferrycake.com. We will be printing Cash for your Community tokens every week in the Carmarthen Journal and Llanelli Star. The.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
Cascading Style Sheets (CSS)
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.
CO1552 – Web Application Development Cascading Style Sheets.
CSS CSS is short for C ascading S tyle S heets. It is a new web page layout method that has been added to HTML to give web developers more control over.
Tutorial #3 Cascading Style Sheets. Tutorial #2 Review - Anchors Links to Site DMACC Internal Links Go to Top Mail To me Local.
CSS Basic (cascading style sheets)
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.
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:
Using the CSS. What is CSS? CSS is a language that’s used to define the formatting applied to a Website, including colors, background images, typefaces.
CSS Tutorial 1 Introduction Syntax How to use style specifications. Styles.
Cascading Style Sheets Robin Burke ECT 270. Outline Midterm The Layout Debate CSS properties Fonts Alignment Color CSS selection selectors pseudo-classes.
DIV, Span, CSS.
Cascading Style Sheets CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
OV Copyright © 2008 Element K Content LLC. All rights reserved.  Format Text  Format Lists  Format Images  Modify Page Background Applying Styles.
Web Design (12) CSS Introduction. Cascading Style Sheets - Defined CSS is the W3C standard for defining the presentation of documents written in HTML.
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
Cascading Style Sheets (CSS)
OV Copyright © 2008 Element K Content LLC. All rights reserved. Working with Web Pages  An Introduction to Cascading Style Sheets  Format a Web.
Creating Layouts with CSS. Span tag Here is some underlined text. Here is some blinking text. Here's some bold text.
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)
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 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.
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 solve a problem External.
* CSS Objectives * Provide more control over web site content presentation and formatting * Facilitate cross web page consistency * Reduce the amount.
CONFIGURING COLOR AND TEXT WITH CSS Chapter 3. Cascading Style Sheets (CSS) Used to configure text, color, and page layout. Launched in 1996 Developed.
CSS.
CSS for Styling By Jinzhu Gao.
4.01 Cascading Style Sheets
( Cascading style sheet )
>> Introduction to CSS
IS333: MULTI-TIER APPLICATION DEVELOPMENT
4.01 Cascading Style Sheets
Presentation transcript:

W EB S ITE L ECTURE C ASCADING S TYLE S HEETS

Cascading Style Sheets (CSS) Introduction CSS Objectives – Provide more control over web site content presentation and formatting – Facilitate cross web page consistency – Reduce the amount of coding within a web page to accomplish the desired results CSS style sheets can be embedded in web page source files or as separate documents – If embedded the CSS definition would be done above the tag They can facilitate consistent formatting throughout a web site The CSS statements differ from HTML statements – CSS Properties perform roughly the same function as some HTML tag attributes – There are more many more Properties – A set of Properties can be applied against more than one element in a single CSS statement CSS is obsoleting HTML in web page source coding (deprecating) An excellent source for CSS properties is:

Cascading Style Sheets (CSS) Introduction Font Property Example – Change the default format for h1 header element CSS Rules h1{ color: white; background-color: blue; font-size: 120%; } Nice Header?

Properties Apply Against Content Type Examples of the Content Types Border Background Font List Marquee Padding Table

Font Properties Font Properties include: fontSets all the font properties in one declaration font-familySpecifies the font family for text (e.g. comic-sans) font-sizeSpecifies the font size of text (e.g. %, pixels, named (e.g. small)) font-styleSpecifies the font style for text font-variantSpecifies whether or not a text should be displayed in a small-caps font font-weightSpecifies the weight of a font (e.g. lighter, bold, bolder)

Font Property Example your name P { font-family: gungsuh; font-style: italic; font-variant: small-caps; font-weight: bold; font-size: 150%; color: red; } Business as usual until we hit the p-tag Wow, what a difference a p-tag makes Back to boring

Font Properties Font Properties include: colorSets the color of text directionSpecifies the text direction/writing direction letter-spacingIncreases or decreases the space between characters in a text line-heightSets the line height text-alignSpecifies the horizontal alignment of text text-decorationSpecifies the decoration added to text text-indentSpecifies the indentation of the first line in a text- block text-transformControls the capitalization of text vertical-alignSets the vertical alignment of an element white-spaceSpecifies how white-space inside an element is handled word-spacingIncreases or decreases the space between words in a text

Background Properties CSS properties used for background effects: – background-color – background-image – background-repeat – background-attachment – background-position Color: – a HEX value - like "#ff0000" – an RGB value - like "rgb(255,0,0)" – a color name - like "red“ Image: – Repeat horizontally, vertically, or no repeat Use of Color body{background-color:b0c4de} Use of Color body{background-image:url(‘myimage.jpg’);}

Table Properties Table Properties include: border-collapseSpecifies whether or not table borders should be collapsed border-spacingSpecifies the distance between the borders of adjacent cells caption-sideSpecifies the placement of a table caption empty-cellsSpecifies whether or not to display borders and background on empty cells in a table

Table Example Definition huh table { border-collapse: collapse; } table, td, th { border:1px solid blue; } th { background-color: blue; color: white; } td { padding: 10px 20px 10px 20px; } Use In Body Name Address Lightning T. Mascot E.Main St, M'boro TN

ID Selector Allows you to create your own selector instead of modifying a previous selector Defined with # The style rule will be used on the element with id = ‘selector here’ Definition #para1 { text-align:center; color:red; } Use in Body Hello World! This paragraph is not affected by the style.

Classes Classes provide a shorthand method of formatting They are defined in the style section (internal or external) When defining names they are prefaced by a period symbol When applied the period is not added to the name Definition.blueit { color: blue; font-size: 150%; font-style: italic; font-weight: bold; font-variant: small-caps; } Use in Body Hello I’m so blue

Span Element Span allows for limiting the scope of a format change Best applied for non-trivial changes Span can be used with or without a Class Class allows for multiple Span selections huh span { color: blue; font-size: 150%; font-style: italic; font-weight: bold; font-variant: small-caps;; } I'm so blue boohoo huh.blueit { color: blue; }.redit { color: red; } I'm so blue

Div Element Div element enables different formatting of logical sections of a page, e.g: – Banners – Navigation tabs – Page footer – Special formatting such as indenting content Div elements can be nested The Div element is an XHMTL construct that works within the CSS environment Multiple Div elements can be defined within a page or style sheet, distinguished via unique names Div element names must contain “#” (hash) sign, e.g.: col#tabs #floatleft

Div Element Example Definition #offset500 { position: relative; left: 500; } Results Use in Body The influences to the Blues included Spirituals Work Songs Field Hollers Shouts Chants Rhymed Simple Narrative Ballads

Ways to Insert CSS External Style sheet: – Best for multiple pages – Can change entire look of a Web site by changing one file – Doesn’t contain any HTML tags Internal Style sheet: – Used in a single document Inline Styles: – This is a paragraph.