5 th ed: Chapter 4 4 th ed: Chapter 5 SY306 Web and Databases for Cyber Operations Slide Set #4: CSS.

Slides:



Advertisements
Similar presentations
กระบวนวิชา 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.
Advertisements

1 Dynamic HTML: Cascading Style Sheets™ (CSS). 2 Introduction Cascading Style Sheets (CSS) –Specify the style of your page elements –Spacing, margins,
 2003 Prentice Hall, Inc. All rights reserved. Chapter 6 - Cascading Style Sheets™ (CSS) Outline 6.1 Introduction 6.2 Inline Styles 6.3 Embedded Style.
Stylin’ with CSS. 2 Topics What is CSS? Why CSS? CSS Examples.
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!
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.
CSE CASCADING STYLE SHEETS CSS Faculty of Computer Science and Engineering.
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
Lecture CSS: Cascading Style Sheets. What are Styles? Cascading Style Sheets (CSS) is a style sheet language used to describe the presentation semantics.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
Lecture 7 Cascading Style Sheets (CSS) Boriana Koleva Room: C54
3.1 Cascading Style Sheets. Motto Fashions fade, style is eternal. —Yves Saint Laurent.
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.
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,
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.
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.
 2000 Deitel & Associates, Inc. All rights reserved. Chapter 14 – Dynamic HTML: Cascading Style Sheets (CSS) Outline 14.1Introduction 14.2Inline Styles.
CSS Dvijesh Bhatt.
Cascading style sheets (CSS)
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.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
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 CSS. CSS - Structure Declaration block Property: identifies what to change Value: how to change it Selector – example h1{ font-size:
Tutorial 6 By Sam INE 1020 Introduction to Internet Engineering 1 DHTML & CSS Tutorial 6.
CSS – Cascading Style Sheets Fred Durao
CSS My favourite ICT lesson By Federico Boschi Cascading Style Sheets.
Just A Few More Fun Objectives 1 Having Some Fun With Java Script 2 Using Style Sheets.
CASCADING STYLE SHEETS. Chapter 3 Objectives Customize HTML elements Specify Font characteristics Classes Tag style Inline and block-level elements 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.
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)
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.
ECA225 Applied Interactive Programming Cascading Style Sheets, pt 1 ECA 225 Applied Online Programming.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 6 - Cascading Style Sheets™ (CSS) Outline 6.1 Introduction 6.2 Inline Styles 6.3 Embedded Style.
 Cascading Style Sheets (CSS) ◦ Used to specify the presentation of elements separately from the structure of the document.  Inline style ◦ declare.
CSS with XHTML Please use speaker notes for additional information!
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.
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.
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.
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,
©SoftMoore ConsultingSlide 1 Introduction to HTML: Cascading Style Sheets.
CSS – Cascading Style Sheets
CSS for Styling CS The good, the bad and the… ugly!  Tags such as b, i, u, and font are discouraged in strict XHTML  Why is this bad? CS380 2.
Web Technologies Beginning Cascading Style Sheets (CSS) 1Copyright © Texas Education Agency, All rights reserved.
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.
5 th ed: Chapter 4 4 th ed: Chapter 5 SY306 Web and Databases for Cyber Operations SlideSet #5: Advanced CSS.
CSS Cascading Style Sheets *referenced from
Creating Layouts with CSS. Span tag Here is some underlined text. Here is some blinking text. Here's some bold text.
Basic Webpage Design Cascading Style Sheet (CSS).
ECA 228 Internet/Intranet Design I Cascading Style Sheets.
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.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
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,
Unit 3 - Review. Topics 1. Tag, Attribute, Value 2. CSS Rule Syntax + link 3. Categories of Selectors 4. Inline vs Block Tags 5. CSS Layout 6. CSS Box.
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.
CONFIGURING COLOR AND TEXT WITH CSS Chapter 3. Cascading Style Sheets (CSS) Used to configure text, color, and page layout. Launched in 1996 Developed.
Internet & World Wide Web How to Program, 5/e 1. 2.
Presentation transcript:

5 th ed: Chapter 4 4 th ed: Chapter 5 SY306 Web and Databases for Cyber Operations Slide Set #4: CSS

Cascading Style Sheets -Language used to describe appearance and formatting of HTML -Style sheet: file that describes how HTML should look -Cascading: Sheets can apply formatting when more than one style applies. Ex( if all tables should have red borders except for one particular table, you can single out that one table)

Why use CSS? You can apply the same styling to several HTML elements without rewriting code over and over again. You can apply the same styling to several HTML pages without rewriting code over and over again.

declared.html (1 of 2) Cascading Style Sheets (CSS) example

Key Questions I.Where can we specify style? II.How to “select” what parts of a page the style applies to? III.How can we specify specific style values?

Three Locations for Style 1.Inline … 2.Embedded style sheet (in ) … p { font-size: 20pt} 3.External style sheet styles.css content: p { font-size: 20pt} In HTML5 document: … I.

CSS Selectors: automatically applied p { font-size: 20pt; text-align: right} h1, h2 { font-size: 30pt} li em { color: red; font-weight: bold } a:hover { text-decoration: underline; color: red; } II.

Exercise #1: Write an external stylesheet styles.css that makes every h1 element centered; apply the stylesheet to starter.html

CSS Selectors: manually applied … a.nodec { text-decoration: none }.crazy { font-size: 40pt; color: red } #fineprint { font-size:8pt } … II.

Organizing multiple selectors with the same tag What if you had several s that you want to style individually? 1. Give a unique ID to each tag! Ideal for styling individual selectorsIdeal for styling individual selectors Define each id in your.css like this: Notice the # sign! 2. Give a unique class name to each tag! Ideal for applying same styling to multiple elementsIdeal for applying same styling to multiple elements Define each class in your.css like this: Notice the ‘. ’ II.

What styles can I apply? font-family, font-size, font-style, font-weight text-decoration (line-through, overline, underline, none) list-style-type (disc, square, circle, url) color, background-color text-align (left, center, right, justify) float (left, right, none) border-style, border-width, margin, padding –margin-left, margin-right, etc. background-image opacity width, height position Many more… III.

Examples of property values/units Predefined – xx-small, x-small, small, smaller, medium, large, x-large, xx-large 40% (of current size or screen size) 2em (2*size of of current font current style) 3ex (3*height of x in current font [rarely used]) 10px 12pt = 1 pc 23in 17cm 92mm III.

Color “color: yellow” black, white, red, blue, … “color: rgb(255, 255, 0)” “color: #FFFF00” “Web-safe colors”? Only use hex values: III.

Exercise #2: Write an embedded stylesheet that will… 1.Make every and section have 20pt size text 2.Put lines above all links instead of under them 3.Define a generic selector called “cat" that will italicize text

Exercise #3: Write an external stylesheet that will… 1.Using some relative size, make all text twice as large as text 2.Make normal paragraphs that are nested inside a table appear in bold.

Exercise #4: Where’s the bug? /* styles.css */ td {background-color: green; color: white} th {background-color: green; color: red} a {font-weight: bold; text-decoration: none} table {margin-left: 5em, border-style: groove, border-width: thick} div {border-style: inset; border-width: thick}.crazy {color: yellow; font-weight:700}.mild {color: gray; text-decoration: underline}

W3C CSS Validation Service Fig. 6.7CSS validation results. (Courtesy of World Wide Web Consortium (W3C).)

‘Div’ide and conquer -One of the most useful structure tags is the tag. -Allows you to divide your page into separate block-level sections -Why is this useful?

Organize my page according to block-level content (cats and dogs) The tag doesn’t render to the browser It’s used for structural organization and use with CSS

You can also ‘create’ visual HTML objects like menus, sidebars, and more.

Allows you to separate your content into smaller in-line sections Control styling for smaller parts of your page, such as text.

Centering Secrets Stylesheet:.tcenter {text-align: center}.dcenter {margin-left: auto; margin-right: auto; text-align: center} Usage: … …