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.

Slides:



Advertisements
Similar presentations
Week 10 Creating Positioned Layouts
Advertisements

15 LAYOUT Controlling the position of elements Creating site layouts Designing for different sized screens.
CSS Internet Engineering Spring 2014 Bahador Bakhshi CE & IT Department, Amirkabir University of Technology.
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.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Chapter 7 Page Layout Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
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.
CIS 1310 – HTML & CSS 6 Layout. CIS 1310 – HTML & CSS Learning Outcomes  Describe & Apply the CSS Box Model  Configure Float with CSS  Designate Positioning.
Floating Elements CS380.
Tutorial 4: Creating page layout with css
CSCI N241: Fundamentals of Web Design Copyright ©2006  Department of Computer & Information Science Using CSS for Float Layouts.
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.
CSS, cont. October 12, Unit 4. Creating a Sidebar We know how to create a sidebar –Use the float property div#sidebar{ float: left; } Item1 Item2 Item3.
Web-based Application Development Lecture 9 February 7, 2006 Anita Raja.
An Introduction to Cascading Style Sheets CSS Layout, and the CSS Box Model Nick Foxall SM5312 week 9: CSS Layout.
MORE Cascading Style Sheets (The Positioning Model)
Web Development & Design Foundations with XHTML Chapter 6 Key Concepts.
Working with Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of a document.
Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.
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.
Technologies for web publishing Ing. Václav Freylich Lecture 7.
Neal Stublen Course Road Map  Create web page layouts using CSS  Manage CSS  Test website validity  Create navigation menus using.
 Website development process  CSS  Javascript.
CSS = Cascading Style Sheet CSS consists of rules to display, style and decorate HTML elements Why CSS ? – Separate decoration from HTML markup (Ex :,,…)
Tutorial #6 – Creating Fixed Width Layouts. Tutorial #5 Review – Box Model Every html element is surround by a box Content, Padding, Border, Margin Can.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
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.
CSS Layout Cascading Style Sheets. Lesson Overview  In this lesson, you will learn:  float & clear  display & visibility.
Eric Meyer on CSS Project 12 pp Project 12 Files.
Cascading Style Sheets (CSS) Part II IT210: Web-based IT.
CONTROLLING Page layout
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring 2016 CSS Positioning 1.
CIS67 Foundations for Creating Web Pages Professor Al Fichera Rev. September 22, 2010—All HTML code brought to XHTML standards. Reference for CIS127 and.
HTML and Dreamweaver November 11th. Agenda Box Model Displaying and positioning elements – Padding – Margin – Float – Display – Position HTML Demo.
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 5 pp HTML Elements & Attributes Format Content Or Examples This Text Is A Hyperlink.
Cascading Style Sheets for layout
Laying out Elements with CSS
Cascading Style Sheets Layout
CSS Layouts: Positioning and Navbars
CSS Layouts: Grouping Elements
Webpage layout using CSS
Floating & Positioning
Advanced CSS BIS1523 – Lecture 20.
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
Styles and the Box Model
Controlling Layout with Style Sheets
Positioning.
MORE Cascading Style Sheets (The Positioning Model)
Float Property Elements that seem to “float" on the right or left side of either the browser window or another element are often configured using.
HTML – Organizing Page Content
HTML – Organizing Page Content
Web Development & Design Foundations with H T M L 5
Web Development & Design Foundations with H T M L 5
More CSS Page layout Boriana Koleva Room: C54
Floating and Positioning
CS3220 Web and Internet Programming Page Layout with CSS
Positioning.
Positioning.
Laying out Elements with CSS
The Internet 10/20/11 CSS Layout
CSc 337 Lecture 5: Grid layout.
Positioning Boxes Using CSS
CGS 3066: Web Programming and Design Fall 2019 CSS Part 2
Presentation transcript:

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 it.  Positioning is a way to specify the location of an element anywhere on the page.  Normal flow is top to bottom, left to right

FLOAT  Moves element as far as possible to right or left allowing following content to wrap around it.

THINGS TO REMEMBER ABOUT FLOAT  A floated element is like an island in a stream – the stream has to flow around it  Floats stay in the content area of the containing element  Margins are maintained

FLOATING NON-IMAGES  Always provide a width for floated elements  Floated inline elements behave as block elements  Margins on floated elements do not collapse

HOW DO YOU TURN TEXT WRAPPING OFF??  Use the attribute clear: p { clear: left; }

USING FLOATS TO CREATE COLUMNS  For 2-column layout, you can do:  Float one div and add a wide margin on the side of the text element that araps around it  Float both divs to the left or right  Float one div to the left and the second div to the right  Need to be sure that every float has a specified width  Total width of all columns (don’t forget padding, borders and margins) cannot exceed the width of the browser

POSITIONING  Two types:  relative  moves the box relative to original position  space the element would have occupied in the normal flow is preserved as an empty space  absolute  elements are removed from normal flow  positioned with respect to the browser window or a containing element

HOW TO SPECIFY POSITION  Provide values for each of the offset properties representing the distance the element should be moved away from that respective edge.  top  left  bottom  right

RELATIVE POSITIONING

ABSOLUTE POSITIONING