IDM 221. Web Design I. IDM 221: Web Authoring I 1

Similar documents
IDM 221. Web Design I. IDM 221: Web Authoring I 1

2005 WebGUI Users Conference

Positioning in CSS: There are 5 different ways we can set our position:

Unit 20 - Client Side Customisation of Web Pages. Week 2 Lesson 4 The Box Model

Thinking inside the box

Styles, Style Sheets, the Box Model and Liquid Layout

FLOATING AND POSITIONING

Unit 20 - Client Side Customisation of Web Pages. Week 2 Lesson 4 The Box Model

This is an H1 Header. This is an H2 Header. This is an H3 Header

First Diploma Unit 10 Client Side Web. Week 4 -The CSS Box model

Using CSS for page layout

IDM 221. Web Design I. IDM 221: Web Authoring I 1

BOOTSTRAP GRID SYSTEM

What is the box model?

Responsive Web Design (RWD)

Chapter 3 CSS for Layout

COMS 359: Interactive Media

HTML Organizing Page Content

Page Layout. 4.1 Styling Page Sections 4.2 Introduction to Layout 4.3 Floating Elements 4.4 Sizing and Positioning

CHRIS SAUVE 2

HTML Organizing Page Content

Create a three column layout using CSS, divs and floating

IDM 221. Web Design I. IDM 221: Web Authoring I 1

Web Design and Implementation

The Importance of the CSS Box Model


FRONT END DEVELOPER CAREER BLUEPRINT

Chapter 16: PAGE LAYOUT WITH CSS

The CSS Box Model. Motivation. CSS Box Model. CSE 190 M (Web Programming), Spring 2008 University of Washington

CSCU9B2: Web Tech Lecture 3

COMM 2555: Interactive Digital Communication / Spring 2018 Lab 9: Basic layout techniques with CSS

8/19/2018. Web Development & Design Foundations with HTML5. Learning Objectives (1 of 2) More on Relative Linking. Learning Objectives (2 of 2)

Agenda. Combining Rules & Selectors Classes, IDs and DIVs

INFS 2150 Introduction to Web Development

INFS 2150 Introduction to Web Development

When you complete this chapter, you will be able to:

Business Applications Page Format

GDES218. Using Faux Column Technique In this project you will learn how to use background images to create a layout that uses faux column technique.

CLASSES are a way to select custom elements without using a tag name

AR0051 content/style. Michelle Bettman Henry Kiksen. Challenge the future

HTML and CSS a further introduction

Wanted! Introduction. Step 1: Styling your poster. Activity Checklist. In this project, you ll learn how to make your own poster.

ORB Education Quality Teaching Resources

Zen Garden. CSS Zen Garden

TAG STYLE SELECTORS. div Think of this as a box that contains things, such as text or images. It can also just be a

Designing the Home Page and Creating Additional Pages

Website Design (Weekday) By Alabian Solutions Ltd , 2016

brand rationale logo colour typography graphics & images GREEN BISHOP BRAND IDENTITY GUIDELINES

CSC 337. Cascading Style Sheets. Marty Stepp, Rick Mercer

Let's take a look at what CSS looks like in Dreamweaver using the "Embedded" coding which is the styles are within the html code and not separate.

KNOWLEDGE CENTER SERVICE. Customization Guide

What is the Box Model?

HTML for D3. Visweek d3 workshop

Designing and Developing a Website. 7 May Examination Paper. Time: 3 hours

Responsive web design (RWD) CSS3 Media queries. Mobile vs desktop web sites. Web Development 1 CS1115/CS5002

Building Page Layouts

CSE 154 LECTURE 5: FLOATING AND POSITIONING

Cascading Style Sheets for layout II CS7026

Schrödinger's Website

2 December NCFE Corporate Guidelines. Introduction

HTML. UC Berkeley Graduate School of Journalism

Website Design (Weekend) By Alabian Solutions Ltd , 2016

Produced by. Web Development. Eamonn de Leastar Department of Computing, Maths & Physics Waterford Institute of Technology

EECS1012. Net-centric Introduction to Computing. Lecture 5: Yet more CSS (Float and Positioning)

What do we mean by layouts?

More CSS. <link href="filename" type="text/css" rel="stylesheet" /> CS380

Web Site Design and Development Lecture 9. CS 0134 Fall 2018 Tues and Thurs 1:00 2:15PM

Block & Inline Elements

How to lay out a web page with CSS

Doing more with Views. Creating an inline menu

CSS for Page Layout Robert K. Moniot 1

CSC309 Programming on the Web week 3: css, rwd

Typography is the art and technique of arranging type in order to make language visible.

Styling of Controls Framework

ITNP43: HTML Lecture 5

CSS. MPRI : Web Data Management. Antoine Amarilli Friday, December 7th 1/43

Chapter 7 BMIS335 Web Design & Development

Week 5 jquery and the DOM

Cascading Style Sheets (CSS)

Page Layout Using Tables

CSS Box Model. Cascading Style Sheets

Introduction to Computer Science Web Development

Introduction to HTML & CSS. Instructor: Beck Johnson Week 5

There are 3 places you can write CSS.

Introduction to Computer Science Web Development

Getting Started with Eric Meyer's CSS Sculptor 1.0

Responsive Grid. Grid Variations. Built with responsive 12 column grid, layouts and components. LOGO HEADER IMAGE SECONDARY NAVIGATION FOOTER

Guidelines for doing the short exercises

CSS Exercises. Create a basic CSS layout Use BlueFish to open layout.html Create a layout using <div> tags Use a browser (Firefox) to view your page

CSS worksheet. JMC 105 Drake University

MichPA Content Guide. Table of Contents. Website Section Overview. Global Banner & Navigation. Content Area Client editable

COMP519 Web Programming Lecture 8: Cascading Style Sheets: Part 4 Handouts

Fundamentals of Web Technologies. Agenda: CSS Layout (Box Model) CSS Layout: Box Model. All HTML elements can be considered as a box or a container

Brand Standards Manual. Copyright March 2007

WEB DESIGNER CAREER BLUEPRINT

How to lay out a web page with CSS

CSS3 Basics. From & CSS Visual Dictionary Learning Curve Books, LLC

USER GUIDE. MADCAP FLARE 2017 r3. QR Codes

Client-Side Web Technologies. CSS Part II

Unit 20 - Client Side Customisation of Web Pages WEEK 5 LESSON 6 DESIGNING A WEB-SITE

Transcription:

IDM 221 Web Design I IDM 221: Web Authoring I 1

Week 7 IDM 221: Web Authoring I 2

Page Layout Part 1 IDM 221: Web Authoring I 3 Part 1 because part 2 is coming next term (RWD, Flexbox, Grids)

Posi%on An Element posi&on top bo*om le. right z-index IDM 221: Web Authoring I 4 Use these properties to position elements on a page. Let's look at these individually.

Posi%on sta%c rela%ve fixed absolute s%cky The position property determines how an element is positioned. IDM 221: Web Authoring I 5 Possible values are static, absolute, fixed and relative. Static is the default value, which means the element is placed in the normal flow of the page. Relative means the element is positioned relative to it's position in the normal flow, again based on the top, left, bottom and right properties. Absolute means the element is removed from the flow and positioned relative to the closest containing block that is also positioned. The position is determined by the top, left, bottom and right properties. Fixed means the element is positioned absolutely relative to the browser window. The position again is determined by the top, left, bottom and right properties. Sticky means the element is positioned based on the user's scroll position.

Sta$c Posi$on IDM 221: Web Authoring I 6

IDM 221: Web Authoring I 7 In normal flow, each block-level element sits on top of the next one. Since this is the default way in which browsers treat HTML elements, you do not need a CSS property to indicate that elements should appear in normal flow. example: position-static

Rela%ve Posi%on IDM 221: Web Authoring I 8

IDM 221: Web Authoring I 9 Relative positioning moves an element in relation to where it would have been in normal flow. For example, you can move it 10 pixels lower than it would have been in normal flow or 20% to the right.

<p>lorem ipsum dolor sit amet, consectetur adipisicing elit.</p> <p class="example">ut enim ad minim veniam, quis nostrud exercitation.</p> p.example { position: relative; left: 100px; top: 10px; } IDM 221: Web Authoring I 10 example: position-relative

Absolute Posi,on IDM 221: Web Authoring I 11

IDM 221: Web Authoring I 12 When the position property is given a value of absolute, the box is taken out of normal flow and no longer affects the position of other elements on the page. (They act like it is not there.) The box offset properties (top or bottom and left or right) specify where the element should appear in relation to its containing element.

<h1>my Awesome Web Page</h1> <p>lorem ipsum dolor sit amet, consectetur adipisicing elit. </p> h1 { position: absolute; left: 500px; top: 0; width: 250px; } IDM 221: Web Authoring I 13 example: position-absolute and position-absolute-2

Fixed Posi*on IDM 221: Web Authoring I 14

IDM 221: Web Authoring I 15 Fixed positioning is a type of absolute positioning that requires the position property to have a value of fixed. It positions the element in relation to the browser window. Therefore, when a user scrolls down the page, it stays in the exact same place. It is a good idea to try this example in your browser to see the effect.

<h1>my Awesome Web Page</h1> <p>lorem ipsum dolor sit amet, consectetur adipisicing elit. </p> h1 { position: fixed; left: 0; top: 0; width: 100%; } IDM 221: Web Authoring I 16 example: position-fixed

S"cky Posi"on IDM 221: Web Authoring I 17 Sticky positioning is a newer CSS property. It combines static and fixed positioning techniques, and uses the user's scroll position on the page to determine the position of the element. The basic concept is the element is positioned statically until some specific scroll condition is met, at which point the position of the element becomes fixed. Let's look at an example. example: position-sticky

z-index IDM 221: Web Authoring I 18

IDM 221: Web Authoring I 19 When you start positioning elements and messing with the natural flow of the page, there is the possibility that content will begin to overlap or fight for a specific spot on the page. The z-index property helps us deal with the issue by defining the order of our content. Think of it like layers in your graphic design software.

.thing1,.thing2 { height: 100px; width: 100px; position: absolute; }.thing1 { left: 0; top: 0; z-index: 10; }.thing2 { left: 20px; top: 20px; z-index: 20; } IDM 221: Web Authoring I 20 Why did I use 10 and 20 instead of 1 and 2?

Float IDM 221: Web Authoring I 21 By default, block elements flow from top to bottom. When you float an element, it's taken out of the flow of the document. Because of that, any elements that follow the floated element flow into the space that's left by the floated element.

<div class="wrapper"> <aside> <p>lorem ipsum...</p> </aside> <main> <p>lorem ipsum...</p> </main> <footer> <p>lorem ipsum...</p> </footer> </div> IDM 221: Web Authoring I 22

main { margin: 0; padding: 0 20px; } aside { border: 1px solid black; float: right; margin: 0 0 10px 20px; padding: 0 20px; width: 250px; } IDM 221: Web Authoring I 23 The basic skills for floating an element include first using the float property to define whether you want the element floated to the left or right. You also have to set a width of the floated element. In the example, the aside is 250px and floated to the right. The main element that follows flows into the space to the left of the aside.

footer { border-top: 1px solid lightgray; clear: both; font-size: 0.88rem; } IDM 221: Web Authoring I 24 By default, any content that follows the floated element will fill in the space to the side of the floated element. If you want to stop the flow of elements into the space behind a floated element, you can use the clear property. In this example, this property is used to stop the footer from flowing into the space next to the aside. The value of this property can be left, right or both and works whether the floated element is floated to the left or right.

Float Examples Basics 2 Column Fixed Width 2 Column Fluid Width Grid System IDM 221: Web Authoring I 25 Examples are available in the examples folder.

Exercise! h"p://digm.drexel.edu/crs/idm221/exercises/layouts IDM 221: Web Authoring I 26

For Next Week... IDM 221: Web Authoring I 27 Work