Cascading Style Sheets Positioning Controls Visibility.

Slides:



Advertisements
Similar presentations
LIS650 lecture 4 Thomas Krichel today CSS Properties –Box properties-- List properties –Table properties-- Classification properties –(Audio.
Advertisements

© 2010 Delmar, Cengage Learning Chapter 9 Positioning Objects with AP Div Tags.
© 2011 Delmar, Cengage Learning Chapter 10 Positioning Objects with AP Divs.
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.
With CSS, a color is most often specified by: a HEX value - like "#ff0000" an RGB value - like "rgb(255,0,0)" a color name - like "red“ Example h1.
CIS 1310 – HTML & CSS 6 Layout. CIS 1310 – HTML & CSS Learning Outcomes  Describe & Apply the CSS Box Model  Configure Float with CSS  Designate Positioning.
Cascading Style Sheets Color and Background Controls Border and Margin Controls (Boxes)
Tutorial 6 Creating Fixed-Width Layouts
TUTORIAL 4: CREATING PAGE LAYOUT WITH CSS Session 4.3.
An Introduction to Cascading Style Sheets CSS Layout, and the CSS Box Model Nick Foxall SM5312 week 9: CSS Layout.
XP 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
Tutorial 4 Creating Special Effects with CSS
Document Layout. Creating Whitespace2 n Horizontal space –Within line of text –Netscape – – –If no room, will shorten the space to fit on current line.
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.
CSS to Know And this is just the beginning. What to What?  Tags = regular HTML  Ids = #id, only one hashtag per page  Class =.class, many as you want.
Svetlin Nakov Telerik Web Design Course html5course.telerik.com Manager Technical Training
Web Development & Design Foundations with XHTML Chapter 6 Key Concepts.
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.
Cascading Style Sheets CSS. CSS Positioning Normal Flow Top -> bottom | left -> right Arranged in the order they appear in the code make room for one.
Cascading Style Sheets CSS. div … Used like a container to group content Gives context to the elements in the grouping Give it a descriptive name with.
Tutorial 4 Creating Special Effects with CSS
CSS Positioning Creating Special Effects with CSS CS202 Working with Cascading Style Sheets (Chapter 4) CS202 1.
DHTML Positioning and Layout. What is DHTML? HTML and xHTML CSS JavaScript or VBScript.
Copyright © Terry Felke-Morris CSS Flow & Positioning 1 Copyright © Terry Felke-Morris.
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.
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.
Svetlin Nakov Telerik Corporation
THE BOX MODEL Putting layouts together with CSS. The Box Model  How would you describe a box?  Container?  Tags or elements are “containers”  puts.
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.
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.
Cascading Style Sheets Class 3, Lecture 4 Rachel A Ober
CONTROLLING Page layout
Tutorial 4 Creating Page Layouts with CSS
Styles for webpages. Multi-column layout #navcol {position: absolute; top: 5px; left: 5px; width:260px; background-color: black; border:none; z-Index:0}
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.
- WE’LL LOOK AT THE POSITION PROPERTY AND HOW CSS RESOLVES CONFLICTS BETWEEN STYLING INSTRUCTIONS The position property; CSS specificity hierarchy.
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.
Introduction to Programming the WWW I CMSC Summer 2004 Lecture 8.
Cascading Styles Sheets Positioning HTML elements.
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.
Laying out Elements with CSS
Cascading Style Sheets Layout
Cascading Style Sheets Boxes
CSS Layouts: Grouping Elements
Cascading Style Sheets
Floating & Positioning
Putting Things Where We Want Them
Objectives Create a reset style sheet Explore page layout designs
Cascading Style Sheets
Positioning.
MORE Cascading Style Sheets (The Positioning Model)
Cascading Style Sheets
Cascading Style Sheets
Cascading Style Sheets™ (CSS)
The Box Model.
Tutorial 4 Creating Special Effects with CSS
Positioning.
Positioning.
CSS Boxes CS 1150 Fall 2016.
Cascading Style Sheets™ (CSS)
Positioning Boxes Using CSS
Presentation transcript:

Cascading Style Sheets Positioning Controls Visibility

Positioning in the Window The browser window has 2 specific areas— the window and the active browser window. The active browser window refers to the area where the HTML document is rendered.

The active window should be considered a rectangle. The rectangle has a position in the window. The top left corner is the position of the element in the window. The element (based on its defined or specified width and height) expands to fill in the rectangle. The default for the first object in the window is (0,0)

Position Types Static –Defined based on the position of the element in the body of the document. Relative –Defined based on its parent object Absolute –Defined based on a rectangle starting from the top-left corner. Fixed –Not supported in IE or Netscape

Defining an Object Position To position an element, You define the type of position And the top-left corner of the object in the window Example –{ position: absolute; top : 3em; left : 5em;} –An object using this style definition would be positioned in the top of the window 3ems down and 5ems from the margin.

Defining the margins Options for top and left –A value em or px a percentage –relative to the parent’s width auto (based on the browser calculation and the absolute position) Right and Bottom are also options but are not supported by all browsers

Defining a negative value for –Top will cause the element to be raised above –Left will cause the element to be moved on the opposite side of the margin.

Stacking objects 3-D positioning You can use a position style called the z-index to give the sense of a 3 rd dimension (or stacking of the objects) in relationship to one another. Objects which are stacked are given z-index starting with 0. In order to cause the position to happen, you use the position, top, left and z-index to define the object position. You can change the appearance by redefining the width and height. If you don’t set the z-index, the elements stack in the opposite order and the large one is set on top

You may use the position styles to lay a series of the same object on top of itself. Set the first object as absolute with a top and left and a z-index of 0. Set the second object as absolute with a higher top and a further left value and a z-index of 1. Set the third object as absolute with a higher top and a further higher left value and a z-index of 2.

Example.pos1 {position:absolute; z-index:0}.pos2 {position:absolute; top: 2em; left: 3em; z- index:1;}.pos3 {position:absolute; top:5em; left;7em; z- index:2;}

Example To make them seem like a progression, change the side of the image (width and height)

.pos1 {position:absolute;z-index:0;}.pos2 {position:absolute; top: 2em; left: 3em; width: 10em; height: 25em; z-index:1;}.pos3 {position:absolute; top:5em; left;7em; width: 5em; height: 15em; z-index:2;}

Absolute within a Relative If you use position an object using an absolute style within a relative element, the absolute object will appear in an absolute place within the relative box. May be used to put a background image in a paragraph.

Relative within an Absolute The absolute object is positioned—the relative object is positioned within the limits of the absolute window. If you move the absolute object— everything moves.

Visibility You may set the visibility of an object to be hidden. This will cause the space for the object to be allocated in the page and a big rectangle placed where the object should be in the page. With a visibility setting the object is allotted space in the page—with display set to none, no space is set in the page.

Clipping an Object You can cause the portions of an object to be clipped Style – clip: rect(top,right,bottom,left) –The values are distances from the element’s origin.

Overflowing an Object Defines how an object is displayed when it doesn’t fit in area. overflow: –Scroll Sets the scroll bars around the visible area –Hidden Hides the overflow area and the scroll bars –Visible Causes the clipped area to shop up over the area. –Auto Allows the browser to define how to handle this overflow.