THE NORMAL DOCUMENT FLOW from Quick Tip: Utilizing Normal Document Flow by Alex Rodrigues on Web tuts.

Slides:



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

Copenhagen, 6 December 2004 Modern CSS Principles Miruna Bădescu Finsiel Romania.
Week 10 Creating Positioned Layouts
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.
Cascading Style Sheets
Layout using CSS. Using multiple classes In the head:.important{font-style:italic;}.title{color:red;} In the body: Here's a type of paragraph that is.
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.
1 Pengantar Teknologi Internet W03: CSS Cascading Style Sheets.
CIS 1310 – HTML & CSS 6 Layout. CIS 1310 – HTML & CSS Learning Outcomes  Describe & Apply the CSS Box Model  Configure Float with CSS  Designate Positioning.
Tutorial 4: Creating page layout with css
Week 9 Using the Box Properties. 9-2 The CSS Visual Formatting Model Describes how the element content boxes should be displayed by the browser –Based.
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.
XP 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
Tutorial 4 Creating Special Effects with CSS
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.
CSS (Cascading Style Sheets): How the web is styled Create Rules that specify how the content of an HTML Element should appear. CSS controls how your web.
Svetlin Nakov Telerik Web Design Course html5course.telerik.com Manager Technical Training
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.
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.
CSS Positioning Creating Special Effects with CSS CS202 Working with Cascading Style Sheets (Chapter 4) CS202 1.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 6 Key Concepts 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.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Tutorial 7.
CSCE 102 – Chapter 6 (Web Design and Layout) CSCE General Applications Programming Benito Mendoza Benito Mendoza 1 By Benito Mendoza.
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.
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 Fun damentals The Document Hierarchy Element Relationships The Box Model.
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.
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.
Cascading Style Sheets (CSS) Part II IT210: Web-based IT.
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.
CSS - Quiz #3 Lecture Code:
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.
HTML and Dreamweaver November 11th. Agenda Box Model Displaying and positioning elements – Padding – Margin – Float – Display – Position HTML Demo.
BEGINNER WEB DESIGN. INTRODUCTION Vocabulary Design Tools of the Trade HTML CSS.
CSS Layout Cascading Style Sheets. Lesson Overview  In this lesson, we’ll cover:  Brief CSS review  Creating sections with the tag  Creating inline.
HTML 5 AND CSS Dr Mohd Soperi Mohd Zahid Semester /16.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
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.
Working with Cascading Style Sheets
Cascading Style Sheets Layout
CSS Layouts: Grouping Elements
Webpage layout using CSS
Floating & Positioning
Putting Things Where We Want Them
Web Development & Design Foundations with HTML5 7th Edition
The Internet 10/25/11 XHTML Tables
Styles and the Box Model
Controlling Layout with Style Sheets
MORE Cascading Style Sheets (The Positioning Model)
HTML – Organizing Page Content
HTML – Organizing Page Content
Web Development & Design Foundations with H T M L 5
Floating and Positioning
Positioning.
The div Element and CSS for layout
Positioning Boxes Using CSS
Presentation transcript:

THE NORMAL DOCUMENT FLOW from Quick Tip: Utilizing Normal Document Flow by Alex Rodrigues on Web tuts

THE DOCUMENT FLOW THE NORMAL DOCUMENT FLOW is how a html page is presented when you do nothing to it. That is an HTML document without any structural / CSS styling. When people first start to build websites, they're often eager to tackle all sorts of fancy tricks, without learning fundamentals…. The first step towards all those fancy tricks is understanding Normal Document Flow. HTML ELEMENTS Previously we looked at a few different HTML elements… We basically discovered that each HTML tag can be considered an HTML element. Browsers display different HTML elements in various ways. There are two main element types that we need to concentrate on. These are called inline elements and block-level elements.

INLINE ELEMENTS Inline elements include items like anchor tags, images and spans. These elements often define text and data. It may seem obvious but by default inline elements display ‘inline’. Meaning you can have multiple elements in one line, up until the width of their containing element is reached, at which point they continue onto the next line. DEMO 1

BLOCK LEVEL ELEMENTS Block-level elements are things like divs and paragraphs (plus some HTML5 elements like article and section) and have very different properties by default. Browsers will (by default) format block-level elements with a line break before and after. In other words, block-level elements will always start on a new line (stacking up like blocks) unless otherwise styled. Block-level elements are often used to contain inline elements or even other block-level elements. Think of them as the "structural" element of the two.

STYLING BLOCK vs INLINE There are a few key concepts to remember when styling block level vs inline elements: 1)You can to determine the width and height of a block-level element, but not inline elements. 2)We can add margins and padding to both block and inline elements, but with inline elements they wont influence the dimensions of their container. DEMO 2 However, in all cases we can alter how the browser displays an element using the CSS display property element { display: block; /*or inline, for example*/ }

INLINE BLOCK & NONE In addition to the common block and inline display attributes, there are a few less often encountered examples; display: inline-block and display: none; For example, what if you want to display an element inline, but style it like a block-level element? INLINE BLOCK Inline-block elements preserve properties such as width, height, margin and padding as they're applied to normal block level elements, whilst maintaining the structural qualities of an inline element. NONE Finally, the last display value is ‘none'. Any element that has its display property set to "none" simply doesn't show up on the page; it's visually (along with all elements contained within it) removed from the document.

EXERCISE Visit the web tuts article and complete the exercise - herehere

CSS POSITION PROPERTIES from CSS Positioning 101 by NOAH STOKES on A List Apart

THE CSS POSITION PROPERTY Now that we understand the NORMAL HTML DOCUMENT FLOW the next step to mastering website layouts is understanding the CSS position property. In the article CSS Positioning 101 NOAH STOKES describes building websites as like playing with building blocks as a child. He suggests that in this setting the NORMAL DOCUMENT FLOW could be imagined as similar to law of gravity. So the ‘normal flow’ is how your elements stack one on top of each other… however, what we can do is give those blocks properties that enable them to defy the law of gravity. This is where CSS positioning comes in. The CSS specification offers us five position properties: static, relative, absolute, fixed, and inherit.

STATIC & RELATIVE The static and relative position properties behave a-lot like your childhood building blocks—they stack as you would expect. EXAMPLE 1 **Note that static is the default position value of an element, should you fail to apply any other value. The static value is for simple, single-column layouts where each block element must sit on top of the next one. Relatively positioned elements behave just like statically positioned elements, with one exception; they create a new coordinate system for their child elements. So this means that you can offset child elements with the top, left, bottom and right css properties. EXAMPLE 2

ABSOLUTE Unlike the static and relative values, an absolutely positioned element is removed from the normal flow. This means you can put it anywhere, and it won’t affect or be affected by any other element in the flow. Think of it as an element with a giant strip of velcro on its back. Just tell it where to stick and it sticks. Just like relative elements, absolute elements create a new coordinate system for their child elements. EXAMPLE 3 **Note the offset coordinates are in respect to each parent element.

FIXED and INHERIT FIXED An element with position: fixed shares all the rules of an absolutely positioned element, except that the viewport (browser/device window) positions the fixed element, as opposed to any parent element. Additionally, a fixed element does not scroll with the document…. It stays fixed to the screen. EXAMPLE 4 INHERIT This works as the name implies: The element inherits the value of its parent element. Ultimately, you can type inherit or the parent element’s value and get the same result.