Positioning and Printing Creating Special Effects with CSS.

Slides:



Advertisements
Similar presentations
Working with Web Tables
Advertisements

Week 10 Creating Positioned Layouts
15 LAYOUT Controlling the position of elements Creating site layouts Designing for different sized screens.
1 Cascading Style Sheets Continued Different kinds of selectors in a style sheet –Simple- Pseudo-Class –Contextual- Pseudo-Element –Class Image Styles.
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.
Part 5 Introduction to CSS. CSS Display - Block and Inline Elements A block element is an element that takes up the full width available, and has a line.
INTRODUCTORY Tutorial 7 Creating Liquid Layouts. XP Objectives Discern the differences among various types of layouts Create a liquid layout Create a.
CIS 1310 – HTML & CSS 6 Layout. CIS 1310 – HTML & CSS Learning Outcomes  Describe & Apply the CSS Box Model  Configure Float with CSS  Designate Positioning.
Creating Special Effects with CSS
Working with Cascading Style Sheets
Tutorial 6 Creating Fixed-Width Layouts
Week 7 Web Typography. 2 Understanding Type Design Principles.
TUTORIAL 4: CREATING PAGE LAYOUT WITH CSS Session 4.3.
XP 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
Tutorial 4 Creating Special Effects with CSS
Working with Cascading Style Sheets. 2 Objectives Introducing Cascading Style Sheets Using Inline Styles Using Embedded Styles Using an External Style.
Working with Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of a document.
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.
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.
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
Tutorial 4 Creating Special Effects with CSS
CSS Positioning Creating Special Effects with CSS CS202 Working with Cascading Style Sheets (Chapter 4) CS202 1.
COS 125 DAY 12. Agenda  Assignment 5 Corrected 7 A’s & 2 B’s No one got the 10 bonus points  Required that all rules were correct  test5.txt test5.txt.
1 Working with Cascading Style Sheet (CSS) (contd.)  What we will cover… 1. Color (decimal and hexadecimal representation) 2. Floating elements 3. Styling.
DHTML Positioning and Layout. What is DHTML? HTML and xHTML CSS JavaScript or VBScript.
Neal Stublen Course Road Map  Create web page layouts using CSS  Manage CSS  Test website validity  Create navigation menus using.
Tutorial 8 Enhancing a Web Site with Advanced CSS
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Tutorial 7.
HTML, CSS, and XML Tutorial 8 Enhancing a Web Site with Advanced CSS.
Web sites Design: Cascading Style Sheet (CSS) (Cont’d) Dimensions and Position of Elements –Width and Height Space –Table Cell Padding –Left and Top Position.
Chapter 6 Introducing Cascading Style Sheets Principles of Web Design, 4 th Edition.
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.
Cascading Style Sheets Positioning Controls Visibility.
INTRODUCTORY Tutorial 5 Using CSS for Layout and Printing.
CNIT 132 – Week 4 Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of.
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.
Cascading Style Sheets Positioning Controls Visibility.
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.
Cascading Style Sheets Class 3, Lecture 4 Rachel A Ober
CONTROLLING Page layout
Tutorial 4 Creating Page Layouts with CSS
Cascading Style Sheets CSS2 - a bit more advanced.
Relative, absolute, and Floating Positioning, Cascading Style Sheet, and Inheritance.
Introduction to Programming the WWW I CMSC Summer 2003 Lecture 6.
IN THE DOCUMENT OBJECT MODEL, EACH LINE OF HTML IS AN ELEMENT (AN OBJECT), ABLE TO HAVE ATTRIBUTES, PROPERTIES AND VALUES. CSS TELLS THE BROWSER HOW TO.
CIS67 Foundations for Creating Web Pages Professor Al Fichera Rev. September 22, 2010—All HTML code brought to XHTML standards. Reference for CIS127 and.
- 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.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
Tutorial 5 Working with Web Tables. New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 2 Objectives Learn and Apply the structure of.
Mimi Opkins.  One of the major benefits of using CSS is that you’re not forced to lay your sites out in tables.  The layout possibilities of CSS give.
Tutorial 4 Using CSS for Page Layout. Objectives Session 4.1 – Explore CSS layout – Compare types of floating layouts – Examine code for CSS layouts –
Laying out Elements with CSS
Working with Cascading Style Sheets
Cascading Style Sheets
Floating & Positioning
Objectives Create a media query Work with the browser viewport
Objectives Create a reset style sheet Explore page layout designs
6 Layout.
For the World Wide Web Positioning Objects with CSS
Cascading Style Sheets
Tutorial 4 Creating Special Effects with CSS
Positioning.
Presentation transcript:

Positioning and Printing Creating Special Effects with CSS

New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 2 Objectives Manage page layout with CSS Create stacked objects Apply styles to various media Hide elements from printing Create and apply printer styles Create and prohibit page breaks for printing New Perspectives on HTML and XHTML, Comprehensive

New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 3 Positioning Objects with CSS New Perspectives on HTML and XHTML, Comprehensive

New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 4 Positioning Objects with CSS Create div containers for each note Add a class attribute to apply a common set of styles Each note should have a unique id New Perspectives on HTML and XHTML, Comprehensive

New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 5 Positioning Objects with CSS CSS-P (CSS-Positioning) became part of the specification for CSS2, and positioning styles were some of the first CSS2 styles to be adopted by browsers position: type; top: value; right: value; bottom: value; left: value; Absolute positioning enables you to place an element at specific coordinates either on a page or within a containing element position: absolute; left: 100px; top: 50px New Perspectives on HTML and XHTML, Comprehensive

New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 6 Positioning Objects with CSS Relative positioning is used to move an element relative to its default position on the page position: relative; left: 100px; top: 50px You can fix an element at a specific spot in the document window while the rest of the page scrolls by setting the value of the position style to fixed You can assign the inherit position style to an element so that it inherits the position value of its parent element New Perspectives on HTML and XHTML, Comprehensive

New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 7 Positioning Objects with CSS New Perspectives on HTML and XHTML, Comprehensive

New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 8 Working with Overflow and Clipping If you want to force an element into a specified height and width, you have to define how the browser should handle a situation where content overflows the space allotted to the object overflow: type New Perspectives on HTML and XHTML, Comprehensive

New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 9 Working with Overflow and Clipping The clip style allows you to define a rectangular region through which the element’s content can be viewed clip: rect(top, right, bottom, left) New Perspectives on HTML and XHTML, Comprehensive

New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 10 Stacking Elements Elements placed using CSS positioning are stacked on top of elements that are not To specify a different stacking order, use the style: z-index: value New Perspectives on HTML and XHTML, Comprehensive

New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 11 Working with Different Media By default, a style sheet is applied to all devices, and each device must determine how best to match the styles to its own requirements... or New Perspectives on HTML and XHTML, Comprehensive

New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 12 Working with Different Media New Perspectives on HTML and XHTML, Comprehensive

New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 13 Working with Different Media You can use a single style sheet broken down into different sections for each media screen { body {font-size: 1em} h1 {font-size: 2em} print { body {font-size: 12pt} h1 {font-size: 16pt} handheld { body {font-size: 8pt} h1 {font-size: 12pt} tv { body {font-size: 16pt} h1 {font-size: 24pt} } New Perspectives on HTML and XHTML, Comprehensive

New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 14 Working with Different Media CSS uses media groups to describe how different media devices render content –Continuous or paged –Visual, aural, or tactile –Grid (for character grid devices) or bitmap –Interactive (for devices that allow user interaction) or static (for devices that allow no interaction) New Perspectives on HTML and XHTML, Comprehensive

New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 15 Working with Different Media New Perspectives on HTML and XHTML, Comprehensive

New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 16 Hiding Elements CSS has two styles that you can use to keep an element from being displayed in the output: the display style and the visibility style visibility: type The type attribute can be set to visible, hidden, collapse, or inherit New Perspectives on HTML and XHTML, Comprehensive

New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 17 Using Print Styles CSS defines printed pages by extending the box model New Perspectives on HTML and XHTML, Comprehensive

New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 18 Using Print Styles The general rule to create and define a page box {styles} Printed media can vary in size and orientation The size style allows the Web author to define the default dimensions and orientation of the printed page size: width height orientation New Perspectives on HTML and XHTML, Comprehensive

New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 19 Working with Page Breaks When a document is sent to the printer, the printer decides the location of the page breaks unless that information is included as part of the print style page-break-before: type page-break-after: type New Perspectives on HTML and XHTML, Comprehensive

New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 20 Working with Page Breaks The type style attribute has the following values: –Always –Avoid –Left –Right –Auto –Inherit New Perspectives on HTML and XHTML, Comprehensive

New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 21 Working with Page Breaks A widow occurs when only a few ending lines of an element appear at the top of a page An orphan is just the opposite: it occurs when only a few beginning lines of an element appear at the bottom of a page The styles to control the appearance of widows and orphans in the printout are: widow: value orphan: value New Perspectives on HTML and XHTML, Comprehensive

New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 22 Summary Worked with CSS selectors Created styles for lists Created and applied class styles Created a rollover effect Created a drop cap using a pseudo-element Managed page layout with CSS Worked with overflow and clipping styles