Cascading Style Sheets CSS2 - a bit more advanced.

Slides:



Advertisements
Similar presentations
15 LAYOUT Controlling the position of elements Creating site layouts Designing for different sized screens.
Advertisements

CSS Layout Crash Course An Advance CSS Tutorial. Inline vs. Block Many HTML elements have a default display setting of Block. Block elements take up the.
Today CSS HTML A project.
CSS CSS Precise Aesthetic Control. Cascading Style Sheets Though they can be put in HTML header, usually a separate page that the HTML links to Contains.
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 CSS. What is it? Another file format ! its not like html Describes the looks of “selectors” in a.css file (example.css) in the.
CIS 1310 – HTML & CSS 6 Layout. CIS 1310 – HTML & CSS Learning Outcomes  Describe & Apply the CSS Box Model  Configure Float with CSS  Designate Positioning.
กระบวนวิชา 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.
© 2010, Robert K. Moniot Chapter 5 CSS : Cascading Style Sheets 1.
Creating Special Effects with CSS
Working with Cascading Style Sheets
AD Intermediate Computer Graphics | spring 2008 | Daria Tsoupikova | School of Art and Design | UIC CSS Cascading Style Sheets.
XP 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
Tutorial 4 Creating Special Effects with CSS
The.htm/.html Mystery When saving the template files in Internet Explorer, they will be named.htm by default. To be consistent with how the code was written.
MORE Cascading Style Sheets (The Positioning Model)
Working with Cascading Style Sheets. 2 Objectives Introducing Cascading Style Sheets Using Inline Styles Using Embedded Styles Using an External Style.
Principles of Web Design 6 th Edition Chapter 4 – Cascading Style Sheets.
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 Dreamweaver. Styles Determine how the HTML code will display Determine how the HTML code will display Gives designers much more.
XP Tutorial 7New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks.
LING 408/508: Programming for Linguists
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.
Chapter 7 Web Typography Principles of Web Design, 4 th Edition.
Tutorial 4: Using CSS for Page Layout. 2 Objectives Session 4.1 Explore CSS layout Compare types of floating layouts Examine code for CSS layouts View.
Tutorial 4 Creating Special Effects with CSS. XP Objectives Work with CSS selectors Create styles for lists Create and apply class styles Create a rollover.
MORE Cascading Style Sheets (The Positioning Model)
Tutorial 4 Creating Special Effects with CSS
CSS Positioning Creating Special Effects with CSS CS202 Working with Cascading Style Sheets (Chapter 4) CS202 1.
Cascading Style Sheets by Pavlovic Nenad by. Presentation Contents  What is CSS?  Why CSS?  Types of Style Sheets  Style Sheets Syntax  Box Formatting.
CSS Netcentric. What is CSS O CSS stands for Cascading Style Sheets O Styles define how to display HTML elements O Styles were added to HTML 4.0 to solve.
CIS 1315 – Web Development for Educators CIS 1315 HTML Tutorials 3 & 4: Working With CSS.
Cascading Style Sheets CSS by Pavlovic Nenad by. 2Cascading Style Sheets Presentation Contents What are CSS? What are CSS? History of CSS History of CSS.
CSS = Cascading Style Sheet CSS consists of rules to display, style and decorate HTML elements Why CSS ? – Separate decoration from HTML markup (Ex :,,…)
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Tutorial 7.
Lecture 2 - HTML and CSS Review SFDV3011 – Advanced Web Development 1.
Advanced Cascading Style Sheets (CSS) Lecture # July 2013.
 2008 Pearson Education, Inc. All rights reserved Cascading Style Sheets™ (CSS)
Chapter 6 Introducing Cascading Style Sheets Principles of Web Design, 4 th Edition.
Svetlin Nakov Telerik Corporation
 Cascading Style Sheets (CSS) ◦ Used to specify the presentation of elements separately from the structure of the document.  Inline style ◦ declare.
Introducing Cascading Style Sheets. Cascading Style Sheet Basics  Cascading Style Sheet Basics  Creating Styles  Using Styles  Manipulating Styles.
XP Review 2 New Perspectives on JavaScript, Comprehensive1 Introducing Cascading Style Sheets Formatting Web Pages with CSS.
THE BOX MODEL Putting layouts together with CSS. The Box Model  How would you describe a box?  Container?  Tags or elements are “containers”  puts.
LING 408/508: Programming for Linguists Lecture 10 September 30 th.
INTRODUCTORY Tutorial 5 Using CSS for Layout and Printing.
Positioning and Printing Creating Special Effects with CSS.
CNIT 132 – Week 4 Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of.
Web Foundations MONDAY, OCTOBER 7, 2013 LECTURE 7: CSS LINK COLORS, INTERMEDIATE CSS.
Copyright © Osmosys O S M O S Y SO S M O S Y S D e p l o y i n g E x p e r i e n c e & E x p e r t i s e™ CSS Training.
Tutorial 4 Creating Special Effects with CSS. New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 2 Objectives Work with CSS selectors.
Tutorial 4 Creating Special Effects with CSS. New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 2 Objectives Work with CSS selectors.
Tutorial 4 Creating Special Effects with CSS. XP Objectives Work with CSS selectors Create styles for lists Create and apply class styles Create a rollover.
Maureen Smith Professor Tutorial 4.  Review  Session 4.1  Session 4.2  Session 4.3  Review.
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.
- WE’LL LOOK AT THE POSITION PROPERTY AND HOW CSS RESOLVES CONFLICTS BETWEEN STYLING INSTRUCTIONS The position property; CSS specificity hierarchy.
Understanding CSS Cascading Style Sheets control the presentation of content in HTML pages Style Sheets separate formatting from the content –Styles defined.
CH 12 CSS Style Sheets 1. Objective What is CSS? Selecting elements Different rules for different media Importing style sheets 2.
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.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
Internet & World Wide Web How to Program, 5/e 1. 2.
Laying out Elements with CSS
Cascading Style Sheets™ (CSS)
Cascading Style Sheets
IS333: MULTI-TIER APPLICATION DEVELOPMENT
MORE Cascading Style Sheets (The Positioning Model)
Tutorial 4 Creating Special Effects with CSS
Cascading Style Sheets™ (CSS)
Presentation transcript:

Cascading Style Sheets CSS2 - a bit more advanced

“…”; url( … ); media types can follow media_type {…css…} akin to: if( media_type == true ) { } “fancy.css” print, screen;

CSS use in html Internally … …css… … Externally

Display display: none; (hide) display: inline; (fits in the line) display: block; (alone on its own line) display: table-row, table-column, table-cell, inline-table

Printing page-break-before page-break-after page-break-inside auto, always, avoid, left, {margin properties…}

pseudo-class selectors selector:pseudoClass used for generic situations and events :link :visited :hover :active :focus :first-child :lang etc a:visited anchor tags the user clicked on before

Example.myclass:hover the pseudo-class is PART of the selector Browser’s search: Find all tags with class=”myclass” Is the mouse ‘hovering’ over that tag?

text pseudo-element selectors :before = before the content :after = after the content {content: “text”} = lets you insert text! :first-letter :first-line

event pseudo-element selectors :visited (visited anchor link) :active (working anchor link) :hover (mouse over) :focus (forms)

Box Model All Elements (tags) have a box around them. width, height margin, padding,border position: top,left,bottom,right

Positions & Dimensions width, height top,left,bottom,right must be positioned to use auto or inherit (used in CSS cascades) ##% = relative to parent units: mm,cm,in,px,pt,pc,em,ex

Relative Units Save YOU time long-term % percentage of available size em 1= size of 1 (one) line of parent’s text ex 1= half of em = 0.5 em

example h1{ font-size: 0.5em; } ALL tags are now half size (50%) note - text height based

absolute Positioning positions relative to PARENT position scrolls with the PARENT position bottom is the bottom of document going off the page can cause browser to make document larger negative positions (left/right/top/bottom) are allowed

video

fixed Positioning positioned ON THE WINDOW bottom is the bottom of the window’s page viewing area does NOT scroll with the the page adjusts to when the window does

video

z-index Layering control Multiple positioned boxes overlapping cause a layering problem, this solves it only works on boxes that are positioned 0 and up back to front auto = default behavior

video

float Positioning left or right The box moves to the left or right of the area (contained by parent) text flows around the box works diagrams or photos in text documents

video

relative Positioning Position relative to the text flow (sibling text and tags) If the text moves, it moves Example: sub-text or super-text (1 st 2 nd X² ) negative positions allowed

video

tricks bugs (look up the Acid Tests for CSS) there are IE specific comments that help in coding around IE bugs Absolute positioning inside a PARENT with relative positioning can be useful Combining positioning, tables, float can create interesting situations (bugs too)

Inspectors & Editors Most desktop browsers have add-ons for developers to do layout Firefox’s Web Developer add-on has LIVE CSS editing that displays changes instantly FireBug provides an inspector for firebug

HINT Inspectors like FireBug View properties of a tag View built-in browser CSS properties of a tag You can change any CSS property you can see and copy them from other tags

video