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

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

INFS 2150 Introduction to Web Development

INFS 2150 Introduction to Web Development

Client-Side Web Technologies. CSS Part II

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

FLOATING AND POSITIONING

Web Design and Implementation

Assignments (4) Assessment as per Schedule (2)

CSS Selectors. element selectors. .class selectors. #id selectors

Building Page Layouts

Web Programming Step by Step

CSS: Lists, Tables and the Box Model

Internet Programming 1 ITG 212 / A

BIM222 Internet Programming

CSS مفاهیم ساختار و اصول استفاده و به کارگیری

ITNP43: HTML Lecture 5

Creating Layouts Using CSS. Lesson 9

CSS Box Model. Cascading Style Sheets

What is the Box Model?

Parashar Technologies HTML Lecture Notes-4

Using CSS for page layout

Appendix D CSS Properties and Values


CSS Cascading Style Sheets

<style type="text/css"> <!-- body {font-family: Verdana, Arial, sans-serif} ***set font family for entire Web page***

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

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

Cascading Style Sheets CSCI 311

Module 2 (VII): CSS [Part 4]

Introduction to Web Design CSS Reference

Introduction to Web Design CSS Reference

CSCU9B2: Web Tech Lecture 3

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

CSC309 Programming on the Web week 3: css, rwd

INFS 2150 Introduction to Web Development

INFS 2150 Introduction to Web Development

COSC 2206 Internet Tools. CSS Cascading Style Sheets

COMS 359: Interactive Media

Make a Website. A complex guide to building a website through continuing the fundamentals of HTML & CSS. Created by Michael Parekh 1

What do we mean by layouts?

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

Table of Contents. MySource Matrix Content Types Manual

Styles, Style Sheets, the Box Model and Liquid Layout

Note: The screenshots in this document were taken on Windows in Firefox, which may differ from your system.

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

The Importance of the CSS Box Model

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

CSS: Layout Part 2. clear. CSS for layout and formatting: clear

Welcome Please sit on alternating rows. powered by lucid & no.dots.nl/student

UNIVERSITI TEKNOLOGI MALAYSIA TEST 1 SEMESTER II 2012/2013

CSS Styles Quick Reference Guide

Networks and Web for Health Informatics (HINF 6220) Tutorial 8 : CSS. 8 Oct 2015

Website Design (Weekday) By Alabian Solutions Ltd , 2016

Cascading Style Sheets (Part II)

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

Controlling Appearance the Old Way

COMSC-031 Web Site Development- Part 2

CSS for Page Layout Robert K. Moniot 1

HTML Organizing Page Content

Cascade Stylesheets (CSS)

Table Basics. The structure of an table

Web Engineering CSS. By Assistant Prof Malik M Ali

Cascading Style Sheets

Website Design (Weekend) By Alabian Solutions Ltd , 2016

Cascading Style Sheets (CSS)

Introduction to Multimedia. MMP100 Spring 2016 thiserichagan.com/mmp100

CSCB20 Week 7. Introduction to Database and Web Application Programming. Anna Bretscher Winter 2017

12/9/2012. CSS Layout

Adding CSS to your HTML

Introduction to WEB PROGRAMMING

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

CSS: Layout, Floats, and More

c122sep2214.notebook September 22, 2014

CASCADING STYLESHEETS

Chapter 1 True/False Instructions: Circle T if the statement is true or F if the statement is false.

Web Design and Development Tutorial 03

CSS.

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

IMY 110 Theme 6 Cascading Style Sheets

ID1354 Internet Applications

Page Layout Using Tables

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

ADOBE 9A Adobe Dreamweaver CS4 ACE.

Block & Inline Elements

USER GUIDE. MADCAP FLARE 2017 r3. QR Codes

INTERNATIONAL UNIVERSITY OF JAPAN Public Management and Policy Analysis Program Graduate School of International Relations

CSS Design and Layout Basic Exercise instructions. Today's exercises. Part 1: Arrange Page into Sections. Part 1, details (screenshot below)

Cascading Style Sheets for layout II CS7026

How to lay out a web page with CSS

HTML Organizing Page Content

CSS: Cascading Style Sheets

Introduction to CSS. 2 Sep 13. Derek Peacock. An introduction to defining CSS style rules using tags, classes and ids.

Getting Started with Eric Meyer's CSS Sculptor 1.0

Tutorial 4: Creating Special Effects with CSS

CSS for Designers. Capabilities to Know & Pitfalls to Avoid. R. Scott Granneman. Jans Carton

HTML & CSS. SWE 432, Fall 2017 Design and Implementation of Software for the Web

Zen Garden. CSS Zen Garden

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

3.1 Introduction. 3.2 Levels of Style Sheets. - The CSS1 specification was developed in There are three levels of style sheets

- The CSS1 specification was developed in CSS2 was released in CSS2.1 reflects browser implementations

Transcription:

Page Layout contents of this presentation are Copyright 2009 Marty Stepp and Jessica Miller 4.1 Styling Page Sections 4.2 Introduction to Layout 4.3 Floating Elements 4.4 Sizing and Positioning 2 1

4.1 Styling Page Sections Page layout allows to break browser's default pattern where each block element appears below the last Example (see figure): Announcements scroll down the center of the page and contain images hover to the right of the text News stories go in boxes on the left, nested within the main section Events are always visible when the user scrolls down We need to group contents of the page into major sections and apply styles to each section 3 4.1 Styling Page Sections The sections in the previous example: The main central announcements, The news items on the left, and the calendar on the right See the figure with a rough sketch of those sections First we need to learn new HTML tags to represent sections of a page 4 2

4.1.1 Page Sections (div) The div element is a block element that represents a division or section of a page we wrap each major section's group of paragraphs, headings, and other content in a div By default, a div has no onscreen appearance But if we give it a class or id, we can apply CSS styles to it and its contents as a group 5 Page Sections (div) 6 3

4.1.3 CSS Context Selectors Context selector is a CSS rule that applies only to elements that reside inside another particular element 7 CSS Context Selectors 8 4

4.2 Introduction to Layout Browsers use a standard layout for pages: Block elements such as p and h1 are laid out in the order they appear in the document, from top to bottom Each new block element causes a line break Ablock element's width is equal to the entire page width in the browser A block element's height is just enough to fit its text and contents. Within a block element, inline elements and text flow from left to right, top to bottom, wrapping to the next line as needed 9 4.2.1 The CSS Box Model CSS Box Model is the set of rules that governs the size, shape, spacing, borders, and margins of page elements 10 5

Borders Each element can have a surrounding line called a border. The element's four sides can accept a border: top, bottom, left, and right A border has: a thickness, specified in px, pt, em (=16pt), %, or a general width: thin, medium, or thick a style, which is one of the following: none, hidden, dotted, dashed, double, groove, inset, outset, ridge, or solid a color (specified as seen previously for text and background colors) 11 Padding Padding gives blank space between the inline contents of an element and its border Padding can be applied to any of the following four regions: bottom, left, right, and top. Padding is specified simply as a size, in the standard CSS size units such as px, pt, em or %. 12 6

Margins A margin gives a separation between neighboring elements can be set on any or all of the four sides of the element margins are outside the element and transparent; they don't contain the element's background color 13 4.3 Floating Elements The browser's normal layout may not position an element the way you want. For example: multiple columns of text an image on the side of your page with text wrapping around it a sidebar of useful links 14 7

Width Normally a block element is given a width equal to the entire page width Setting a width property value, you can control how wide that element and its content appear in the browser 15 4.3.1 The float Property The CSS float property lifts an element up from the normal content flow and shifts it to either the left or right edge of the page, where it hovers or floats above other content Any nearby elements text wraps around the floating element as necessary 16 8

The float Property 17 4.3.2 The clear Property The clear property disallows any floating elements from overlapping some other element 18 9

4.3.3 Making Floating Elements Fit problem 19 Making Floating Elements Fit 20 10

4.4 Sizing and Positioning The default position of block elements is stacked vertically down the page The default position of inline elements is in a leftto right flow from top to bottom within their enclosing block elements A block element's default width is 100% of the page width, and its default height is the height of its inline content An inline element's default size is just large enough to fit its contents It's possible to change these defaults 21 4.4.1 Width and Height 22 11

Centering Block Elements 23 4.4.2 Positioning Relative positioning: Setting the location of an element to an offset from its normal static position Absolute positioning: Setting the location of an element to an offset from the block element containing it Fixed positioning: Setting the location of an element to an absolute location on the browser screen 24 12

Fixed Positioning 25 13