Positioning.

Slides:



Advertisements
Similar presentations
Copenhagen, 6 December 2004 Modern CSS Principles Miruna Bădescu Finsiel Romania.
Advertisements

Week 10 Creating Positioned Layouts
© 2011 Delmar, Cengage Learning Chapter 10 Positioning Objects with AP Divs.
15 LAYOUT Controlling the position of elements Creating site layouts Designing for different sized screens.
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.
CSS provides a way to stray away from the traditional methods of using tables to lay out pages. Success with this technique depends on understanding of.
TUTORIAL 4: CREATING PAGE LAYOUT WITH CSS Session 4.3.
Ch. 6 Web Page Design – Absolute Positioning, Image Maps, and Navigation Bars Mr. Ursone.
Using CSS for Page Layout. Types of HTML Elements Block-Level Element –Creates blocks of content e.g. div, h1..h6, p, ul, ol, li, table, form –They start.
MORE Cascading Style Sheets (The Positioning Model)
Eat Your Words! Creating webpage Layout. CONTENT The Layout of a Webpage HEADER FOOTER Each of these sections represents a ‘div’ (or divider). By linking.
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
Technologies for web publishing Ing. Václav Freylich Lecture 7.
Cascading Style Sheets. Defines the presentation of one or more web pages Similar to a template Can control the appearance of an entire web site giving.
THE BOX MODEL Putting layouts together with CSS. The Box Model  How would you describe a box?  Container?  Tags or elements are “containers”  puts.
Layout with Styles Castro Chapter 11. Tables vs. CSS You can produce “liquid layouts” (layouts that stretch as the browser is resized) using tables or.
Cascading Style Sheets Positioning Controls Visibility.
Positioning and Printing Creating Special Effects with CSS.
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 Page Layouts with CSS
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.
Today’s objectives  Announcements  Positioning  Measurement units.
THE NORMAL DOCUMENT FLOW from Quick Tip: Utilizing Normal Document Flow by Alex Rodrigues on Web tuts.
Ch 11 HTML and CSS Web Standards Solutions A Web Standardistas’ Approach.
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.
CHAPTER 15 Floating and Positioning. FLOAT VS. POSITION  Floating an element moves it to the left or right, allowing the following text to wrap around.
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™ (CSS)
CSS Layouts: Positioning and Navbars
Webpage layout using CSS
Css Units: REM, VH & VW Adrian Horsham.
Cascading Style Sheets
Floating & Positioning
Putting Things Where We Want Them
CS3220 Web and Internet Programming Page Layout with CSS
CS3220 Web and Internet Programming Page Layout with CSS
The Internet 10/25/11 XHTML Tables
CSS Applications to XML 19-Sep-18.
PAGE LAYOUT - 2.  The div tag equipped with CSS rules produces good looking pages.  With CSS, the div tag can easily be positioned anywhere on the page.
Objectives Create a reset style sheet Explore page layout designs
Styles and the Box Model
Controlling Layout with Style Sheets
Second CSS Lecture Applications to XML
Positioning.
MORE Cascading Style Sheets (The Positioning Model)
Tutorial 6 Creating Dynamic Pages
HTML – Organizing Page Content
HTML – Organizing Page Content
Cascading Style Sheets
Web Development & Design Foundations with H T M L 5
More CSS 22-Feb-19.
Floating and Positioning
Tutorial 4 Creating Special Effects with CSS
CS3220 Web and Internet Programming Page Layout with CSS
Positioning.
CSS Boxes CS 1150 Fall 2016.
CSS Applications to XML 20-May-19.
The div Element and CSS for layout
CSc 337 Lecture 5: Grid layout.
CSS Applications to XML 3-Jul-19.
Cascading Style Sheets™ (CSS)
Positioning Boxes Using CSS
CGS 3066: Web Programming and Design Fall 2019 CSS Part 2
Presentation transcript:

Positioning

Positioning Elements have position value of static by default TOP Elements have position value of static by default Using a value other than static makes it a positioned element May use: top, left, bottom, & right properties to control placement ELEMENT LEFT RIGHT BOTTOM

CSS Position Properties static relative absolute fixed inherit

S T A I C div‘s are block elements – automatically fall on next line from element above them

Relative positioning Renders in normal page flow Then shifts via left, right, top, and bottom relative to that original position

200px from where its left would have been Acts like static, but power to offset with top, right, bottom, and left 100 px 200px from where its left would have been

R E L A T I V Child elements get coordinate system relative to parent’s position 200 px 100px If we move box2 inside box1, then it will offset 200px from the left of box1

Absolute Positioning Removes element from normal page flow Positions via left, right, top, and bottom based on edges of viewport Viewport = what you can see in browser

A B S O L U T E Element removed from normal flow. Put anywhere, won’t affect flow. Acts like it has a strip of velcro on it. You position it wherever and it sticks there.

A B S O L U T E Can use top, bottom, left & right to stretch across page without width. Acts like it has a strip of velcro on it. You position it wherever and it sticks there.

Absolute Child elements will get new coordinate system relative to parent’s position just like with relative positioning. BE CAREFUL: If user has changed resolution or resized their window, your absolutely positioned elements may not show at all or may be on top of or underneath other content you don’t intend!

Fixed Positioning Affixes element to specific place in window, where it will stay regardless of scrolling

F I X E D Acts like absolute positioned…EXCEPT it doesn’t move when scrolled.

Fixed BE CAREFUL: If user has changed resolution or resized their window, your fixed positioned elements may not show at all or may be on top of or underneath other content you don’t intend!

Z-iNDEX control where element appears in the depth of field (front to back) By default, elements added later in the html have higher z-index (are closer to you and will sit on top of other elements when they occupy the same space). You can set values specifically. Higher numbers stacked on TOP of lower numbers.

Z-iNDEX Ex: box1 will sit on top of box2 if the two occupy same space on page. #box1{ z-index: 2; } #box2{ z-index: 1;

  static relative absolute fixed 1. Default value for all HTML elements 2. Elements will stack vertically on top of one another like blocks. 3. Elements can be shifted using left, right, top, and bottom properties. 4. Width & height properties can be set for elements. 5. Defines new coordinate system for child elements. 6. Pulls element out of normal flow. 7. Will not "interact" with other elements at all (be shifted by or shift them). 8. Scrolls with the document.

  static relative absolute fixed 1. Default value for all HTML elements X 2. Elements will stack vertically on top of one another like blocks. 3. Elements can be shifted using left, right, top, and bottom properties. 4. Width & height properties can be set for elements.  X X  5. Defines new coordinate system for child elements. 6. Pulls element out of normal flow. 7. Will not "interact" with other elements at all (be shifted by or shift them). 8. Scrolls with the document.