Website Development & Management Working with Style Rules Instructor: John Seydel, Ph.D. CIT 3353 -- Fall 2006 www.clt.astate.edu/jseydel/mis3353.

Slides:



Advertisements
Similar presentations
Today CSS HTML A project.
Advertisements

Web Pages and Style Sheets Bert Wachsmuth. HTML versus XHTML XHTML is a stricter version of HTML: HTML + stricter rules = XHTML. XHTML Rule violations:
กระบวนวิชา 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.
Beginning Web Site Creation: Dreamweaver CS4. XHTMLCSS  Describes the structure  Content  Collection of styles  Formatting body { background-color:
Prepared by ackoo Styli n g your page (font type, font size, colors, text decoration, alignment, set margin, table padding, etc.) References: W3Schools.
Cascading Style Sheets. Slide 2 Lecture Overview Overview of Cascading Style Sheets (CSS) Ways to declare a CSS CSS formatting capabilities New features.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic CSS: Cascading Style Sheets.
Cascading Style Sheets Scripting with Style. CSS versus HTML  Ways to format in HTML –HTML Tag extensions –Converting Text to images –Page Layout with.
Cascading Style Sheets Controlling the Display Of Web Content.
Controlling Page Style: Cascading Style Sheets (CSS) References: 1.Wang, P.S & Katila, S. (2004). A Introduction to Web Design and Programming. CA: Thomson.
Cascading Style Sheets Controlling the Display Of Web Content.
4.01 Cascading Style Sheets
CM143 Week 4 Introducing CSS. Cascading Style Sheets A definition for the style in which an element of the webpage will be displayed Border width, colour,
Working with Cascading Style Sheets. 2 Objectives Introducing Cascading Style Sheets Using Inline Styles Using Embedded Styles Using an External Style.
CSS (Cascading Style Sheets): How the web is styled Create Rules that specify how the content of an HTML Element should appear. CSS controls how your web.
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,
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 (CSS) Instructor: Mr. Ahmed Al Astal ITGD4104 Department Requirement for senior student University of Palestine Faculty of IT.
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.
Cascading Style Sheet (CSS)
Website Development & Management Creating Web Pages CIT Fall Instructor: John Seydel, Ph.D.
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.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
CIS 1315 – Web Development for Educators CIS 1315 HTML Tutorials 3 & 4: Working With CSS.
Introduction to Programming the WWW I CMSC Summer 2004 Lecture 7.
CO1552 – Web Application Development Cascading Style Sheets.
CSS Basic (cascading style sheets)
Introduction to Programming the WWW I CMSC Winter 2003 Lecture 7.
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.
IS 360 Declaring CSS Styles. Slide 2 Introduction Learn about the three ways to declare a style Inline / embedded / external Learn about the effect of.
Cascading Style Sheets Part 1. CSS vs HTML HTML: Originally intended to markup structure of a document (,...,,,,,...) CSS Developing technology, CSS1,
CS134 Web Design & Development Cascading Style Sheets (CSS) Mehmud Abliz.
Website Development & Management Going Live with Web Pages (b) CIT Fall Instructor: John Seydel, Ph.D.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Tutorial 7.
Css. Definition Cascading style sheet (CSS)  It is a simple mechanism for adding style (e.g. fonts, colors, spacing) to Web documents.
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.
ECA225 Applied Interactive Programming Cascading Style Sheets, pt 1 ECA 225 Applied Online Programming.
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.
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 Eugenia Fernandez IUPUI. CSS Purpose CSS allow you to specify the style in which your XML elements are displayed. CSS were originally.
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,
Copyright © 2006, Jumail, FSKSM, UTM Slide 1 Cascading Style Sheets (CSS)
Lecture 2: Cascading Style Sheets (CSS) Instructor: Dr. M. Anwar Hossain.
How to… Cascading Style Sheets. How to Insert a Style Sheet When a browser reads a style sheet, it will format the document according to it. There are.
CSS: Cascading Style Sheets Part II. Style Syntax.
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.
Company LOGO In the Name of Allah,The Most Gracious, The Most Merciful King Khalid University College of Computer and Information System Web pages Development.
ECA 228 Internet/Intranet Design I Cascading Style Sheets.
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 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 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.
1 Cascading Style Sheets
WebD Introduction to CSS By Manik Rastogi.
4.01 Cascading Style Sheets
CSS: Cascading Style Sheets
Cascading Style Sheets
Cascading Style Sheets
IS 360 Declaring CSS Styles
Madam Hazwani binti Rahmat
Cascading Style Sheets
Cascading Style Sheets
IS333: MULTI-TIER APPLICATION DEVELOPMENT
4.01 Cascading Style Sheets
Web Client Side Technologies Raneem Qaddoura
Presentation transcript:

Website Development & Management Working with Style Rules Instructor: John Seydel, Ph.D. CIT Fall

Student Objectives Upon completion of this class meeting, you should be able to: Use the style element to specify presentational aspects Explain what a selector and a declaration do in a style rule Specify styles  Within document head Via tag Via links to external files  Inline via the style attribute Explain why stylesheets are “cascading”

How to Set/Modify Web Page Displays Use display elements Typically inline elements Also, (misuse) tables, headings, etc. Mixes presentation and content on pages (XHTML is moving away from this) Most have been deprecated (e.g., ) Provide specification in xmlns Incorporate style rules (CSS)

Style Rules Customize HTML tag definitions Create custom look/theme Provide more control over how pages look Provide information on formatting Can be Embedded: within... tags External: separate file; use tag Inline: using the style attribute within XHTML tags (deprecated) Cascading Style Sheets (CSS): concept incorporates cascading levels of precedence

A Quick Overview Thus, there are two valid ways to specify style rules, both within the document element External file (use element) Use the element All three modify the same display properties Typical properties modified: font-family font-size text-align margin-left Others... Syntax for style rules Always property1:value;property2:value;... Example: font-size:10pt;text-align:center

Working with Style Rules Typically two parts Selector (e.g., body, h1, table, a:link) Declaration (e.g., align:center, font-size: 28px) Example: body {background-color:teal} Typical format selector { attribute:value; attribute:value }

When & Where to Specify Styles Ideally, specify once Using separate file When multiple documents use same styles Creates “theme” Same concept as server side includes Use embedded approach (in of document) for page-specific styles

Containers for Style Rules The... tags... declarations go here... Separate files Refer to text file using tag  Within... tags  Example: <link rel=“stylesheet” href=“styles1.css” type=“text/css” > Contents should be just declarations (i.e., no tags) Should use.css extension

Multiple Versions: Classes Use classes to define more than one version of a style Example: declaring styles table.nav {background:aqua} table.other { background:yellow; text-align:center } Example: calling style classes...

Classes for Various Structural Elements Specification Define as class without element selector Often call from within or tag Example:.subhead { font-size:28px; margin-top:12px; margin-left:20px; line-height:32px; }...

Using the Element Overcomes problems with lack of support for pseudo elements Contained in the element Use style attribute within opening tag Applies style info to all content between opening and closing tag For limited occurrences of desired display characteristics Typically

Style Rules Example body {background:coral}.copy { color:Black; font-size:11px; line-height:14px; font-family:Verdana,Arial,Helvetica,sans-serif }.subhead { font-size:28px; margin-top:12px; margin-left:20px; line-height:32px; }

Styles Affecting Links Links attributes (use pseudo-classes) a:link a:visited a:active a:hover Selectors (i.e., properties) include: background (color) color font-family text-decoration (underline, overline, strikethrough, none)

Styles Affecting Text General: background, color Also: Common font properties  font-family  font- size  font- style  font- weight  line-height Common text properties  text-align  text-indent  text-decoration See Appendix C for possible values

Styles Affecting Boxes: Margins & Borders Set for:,, For margins, specify Which margin: left, right, bottom Use: pixels (px), in, cm, points (pt) Examples body {margin: 100px 100px 50px} div {margin-left:10%;margin-right:5%} For borders Specify: type (e.g., groove), width, padding Example:.box {border:groove;border-width:thin;padding:2px} content...

Customizing Lists Use To set all properties: list-style To set properties individually:  list-style-image  list-style-position  list-style-type Most common is the image Values: none, inherit, url Example: li {list-style-image:url(images/ball.gif)}

Review: Style Odds & Ends Recall format for style rules Selector  Type: describes default element  Attribute: defines specific classes of elements  Descendent: what happens when two or more selectors are used together  External: in development (not well supported) Declaration Inheritance Site management issues Indentation

References for Style Specification HTML textbooks Duckett: Chapters 10 & 11, Appendix C Proffitt & Zupan: Chapter 15 and Appendix B Examples of what styles can achieve General overview of styles wdvl.internet.com/Authoring/Style/Sheets/ Complete reference summary for style syntax Materials that are no longer available (!): webreview.com/pub/guides/style/style.html webreview.com/wr/pub/guides/style/mastergrid.html

Summary of Objectives Use the style element to specify presentational aspects Explain what a selector and a declaration do in a style rule Specify styles Within document head  Via tag  Via links to external files Inline via the style attribute Explain why stylesheets are “cascading”