Session 4: CSS Positioning Fall 2009 LIS Web Team.

Slides:



Advertisements
Similar presentations
J ENWARE Chapters 14 & 15 Learning Web Design, Fourth Edition by Jennifer Niederst Robbins Copyright © 2012.
Advertisements

Web Pages Week 10 This week: CSS Next week: CSS – Part 2.
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.
Very quick intro HTML and CSS. Sample html A Web Title.
Session 4: CSS Positioning Fall 2006 LIS Web Team.
Advance CSS (Menu and Layout) Miftahul Huda. CSS Navigation MENU It's truly remarkable what can be achieved through CSS, especially with navigation menus.
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.
Class four: the box model and positioning. is an HTML tag which allows you to create an element out of inline text. It doesn’t mean anything! try it:
Unit 20 - Client Side Customisation of Web Pages
Tutorial 4: Creating page layout with css
Session 4: CSS Positioning Fall 2007 LIS Web Team.
TUTORIAL 4: CREATING PAGE LAYOUT WITH CSS Session 4.3.
Lecture Cascading Style Sheets (CSS) Internal Style Sheets Classes.
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.
ITP 104.  While you can do things like this:  Better to use styles instead:
Technologies for web publishing Ing. Václav Freylich Lecture 7.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Copyright © Terry Felke-Morris CSS Flow & Positioning 1 Copyright © Terry Felke-Morris.
 Word doc for you to download › Link at the beginning of class › 10 Questions › Answers to be added inline  Post to Sakai when completed › No resubmits.
WRA HTML & CSS – BUILDING WEBPAGES. TODAY’S AGENDA Review: external stylesheets Review: transforming a list Intro: the object Intro: the.
Interface Programming 1 Week 3. Interface Programming 1 CALENDAR.
Web Design I Spring 2009 Kevin Cole Gallaudet University
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.
Web Development & Design Foundations with HTML5 7th Edition
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Internet Technology Dr Jing LU Updated Dr Violet Snell / Dr Kalin Penev 1 Internet Technology (week 6)  Recap: Validating HTML  Page Layout.
CSS Fun damentals The Document Hierarchy Element Relationships The Box Model.
INTRODUCTORY Tutorial 5 Using CSS for Layout and Printing.
11/12/2015 Box Model Reed Crouch. 11/12/2015  HTML elements can be considered as boxes. In CSS, the term "box model" is used when referring to layout.
Web Design (12) CSS Introduction. Cascading Style Sheets - Defined CSS is the W3C standard for defining the presentation of documents written in HTML.
CONTROLLING Page layout
5 th ed: Chapter 4 4 th ed: Chapter 5 SY306 Web and Databases for Cyber Operations SlideSet #5: Advanced CSS.
Today’s objectives  Announcements  Positioning  Measurement units.
Week 5.  Normal document flow  Affecting document flow with float and position properties using CSS  Using these properties to create layouts.
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.
 Add one element at a time  If it doesn’t do what you want, › Delete it › DON’T just keep piling on more items.
ACT102 INTRODUCTION TO WEB DESIGN. Content Padding Border Margin.
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.
CSS.
Laying out Elements with CSS
Cascading Style Sheets Layout
The Box Model in CSS Web Design – Sec 4-8
CSS Layouts: Positioning and Navbars
The Box Model in CSS Web Design – Sec 4-8
Webpage layout using CSS
Cascading Style Sheets (Layout)
Laying out a website using CSS and HTML
Fixed Positioning.
Controlling Layout with Style Sheets
CSS Borders and Margins.
MORE Cascading Style Sheets (The Positioning Model)
HTML5 Level I Session III
HTML5 Level I Session III
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.
Web Development & Design Foundations with H T M L 5
Floating and Positioning
Session 4: CSS Positioning
Laying out Elements with CSS
CSc 337 Lecture 5: Grid layout.
ITI 133: HTML5 Desktop and Mobile Level I
Session 4: CSS Positioning
Positioning Boxes Using CSS
CGS 3066: Web Programming and Design Fall 2019 CSS Part 2
Presentation transcript:

Session 4: CSS Positioning Fall 2009 LIS Web Team

Why use CSS? Cleaner code - Less code

Positioning – what is it? Positioning refers to the layout of the items on your page. It also refers to the “position” descriptor in CSS rules (more on this later)

Normal Flow – no “positioning” Left to Right, Top to Bottom

Normal Flow – no “positioning” Left to Right, Top to Bottom Top left of the page = (0,0)

Normal Flow This is a paragraph to which I have set the width. If the next paragraph fits next to it on the right, it will line up. The yellow box is the container (more on this)

Normal Flow This is a paragraph to which I have set the width. However, if the second paragraph is too wide to fit the container, it will shift down.

Normal Flow This is a paragraph to which I have set the width. However, if the second paragraph is too wide to fit the container, it will shift down. This is the basic principle of Normal Flow

Box Model All of the items in your webpage generate invisible “boxes” – you have to figure out how all of those boxes will fit into your page, like a puzzle. Image with link Image Regular text Small print text, bullet list Set of links (navigation)

Box Model Content Padding Border Margin

Box Model Think of it like an egg: The yolk is the content The albumen is the padding The shell is the border The margin is how far the egg is from anything else (another tiny egg, perhaps)

Margin and Padding styleX { margin: 10px 10px 10px 10px; padding: 5px 5px 5px 5px; } OR styleX { margin: 10px; padding: 10px; } OR styleX { margin: 10px 15px; padding: 5px 10px; } TRBL top – right – bottom - left Shorthand: Just one number = all 4 sides Two numbers = top/bottom, left/right

Interrupt the Flow Absolute Relative Float When you want to do fancier layout, you can position “boxes” or “containers.” By doing this, you interrupt the normal (top to bottom, left to right) flow. You can do this in three ways; Float, Absolute, and Relative.

Float This is the normal flow of a document; from top to bottom, left to right. When the floated text is added, it moves to the top right corner of the containing element, in this case the. Normal text flows around the floated text. This text is floated right. This is the normal… This text is floated right..float {float:right;} HTML CSS

Absolute This text is absolutely positioned. This is the normal… This text is absolutely positioned. … top to bottom….abs {position: absolute; top: 40px; left: 80;} HTML CSS This is the normal flow of a document; from top to bottom, left to right. When you add the absolutely positioned text, it moves to the coordinates you set based on the top left corner of the containing element, in this case the. Normal text flows over the absolutely positioned text. There is no gap where the text is taken from.

Relative This text is relatively positioned. This is the normal… This text is relatively positioned. … from top to bottom….rel {position: relative; top: -50px; left: -150px} HTML CSS This is the normal flow of a document; This text is relatively positioned from top to bottom, left to right. When you add the relatively positioned text, it moves to the coordinates you set based on the top left corner of the containing element, in this case the. Normal text flows as normal, but a gap is left where the relative text used to be, and the text overlaps with the newly positioned relative text if they are in the same area.

My Resume Content goes here HTML

#container #banner #nav#content #footer

home contact My Resume Resume text Copyright info here HTML

body { font-size: 1em; } #container { width: 920px; } #banner { width: 920px; height: 120px; } #nav { float: left; width: 200px; } #content { width: 720px; } #footer { font-size:.8em; } CSS

Exercises