CSS for Page Layout Robert K. Moniot 1

Similar documents
Using CSS for page layout

COMS 359: Interactive Media

CSS Layout Part I. Web Development

Styles, Style Sheets, the Box Model and Liquid Layout

CSCU9B2: Web Tech Lecture 3

Zen Garden. CSS Zen Garden

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

INFS 2150 Introduction to Web Development

INFS 2150 Introduction to Web Development

[PACKT] HTML5, CSS3, and jquery. Dreamweaver CS5.5 Mobile. and Web Development with

Building Page Layouts

HIERARCHICAL ORGANIZATION

HTML Organizing Page Content

How to lay out a web page with CSS

Block & Inline Elements

Create a three column layout using CSS, divs and floating

Programmazione Web a.a. 2017/2018 HTML5

ADOBE 9A Adobe Dreamweaver CS4 ACE.

HTML and CSS a further introduction

Creating HTML files using Notepad

Assignments (4) Assessment as per Schedule (2)

Media Types & Media Features

Lecture : 3. Practical : 2. Course Credit. Tutorial : 0. Total : 5. Course Learning Outcomes

CIS 1350 Final Project Part 1 of 4

COMSC-031 Web Site Development- Part 2

Parashar Technologies HTML Lecture Notes-4

WEBSITE PROJECT 2 PURPOSE: INSTRUCTIONS: REQUIREMENTS:

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

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

Index LICENSED PRODUCT NOT FOR RESALE

BIM222 Internet Programming

CompuScholar, Inc. Alignment to Utah's Web Development I Standards

Introduction to WEB PROGRAMMING

Cascading Style Sheets for layout II CS7026

CSC309 Winter Lecture 2. Larry Zhang

Dreamweaver CS3 Lab 2

Client-Side Web Technologies. CSS Part II

The Importance of the CSS Box Model

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

subject to an additional IP rights grant found at polymer.github.io/patents.txt -->

Perfect Student Midterm Exam March 20, 2007 Student ID: 9999 Exam: 7434 CS-081/Vickery Page 1 of 5

CSS: Layout, Floats, and More

Deccansoft Software Services

HTML CS 4640 Programming Languages for Web Applications

Page Layout Using Tables

12/9/2012. CSS Layout

INFS 2150 Introduction to Web Development

INFS 2150 Introduction to Web Development

1/6/ :28 AM Approved New Course (First Version) CS 50A Course Outline as of Fall 2014

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

Getting Started with Eric Meyer's CSS Sculptor 1.0

INFS 2150 Introduction to Web Development

INFS 2150 Introduction to Web Development

Website Development with HTML5, CSS and Bootstrap

Cascading Style Sheet

Getting Started with CSS Sculptor 3

CS193X: Web Programming Fundamentals

HTML5. HTML5 Introduction. Form Input Types. Semantic Elements. Form Attributes. Form Elements. Month Number Range Search Tel Url Time Week

NEW WEBMASTER HTML & CSS FOR BEGINNERS COURSE SYNOPSIS

AGENDA :: MULTIMEDIA TOOLS :: (1382) :: CLASS NOTES

Index. alt, 38, 57 class, 86, 88, 101, 107 href, 24, 51, 57 id, 86 88, 98 overview, 37. src, 37, 57. backend, WordPress, 146, 148

HTML-5.com itemscopehttp://data-vocabulary.org/breadcrumb<span itemprop="title">html 5</span> itemscopehttp://data-vocabulary.

Layout with Layers and CSS

CSS worksheet. JMC 105 Drake University

Cascading Style Sheets CSCI 311

HTML5, CSS3, JQUERY SYLLABUS

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

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

Guidelines for doing the short exercises

Module 2 (VII): CSS [Part 4]

Using Dreamweaver CC. Logo. 4 Creating a Template. Page Heading. Page content in this area. About Us Gallery Ordering Contact Us Links

GIMP WEB 2.0 MENUS. Web 2.0 Menus: Horizontal Navigation Bar with Dynamic Background Image

Web Design and Implementation

CSC309 Programming on the Web week 3: css, rwd

Word 2016: Using Section Breaks

THIRD EDITION. CSS Cookbook. Christopher Schmitt foreword by Dan Cederholm O'REILLY 8. Beijing Cambridge Farnham Koln Sebastopol Taipei Tokyo

Web Engineering CSS. By Assistant Prof Malik M Ali

FLOATING AND POSITIONING

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

16. HTML5, HTML Graphics, & HTML Media 웹프로그래밍 2016 년 1 학기 충남대학교컴퓨터공학과

CSS.

USER GUIDE MADCAP FLARE Tables

Tutorial 2 Editor Brackets

HTML5: Adding Style. Styling Differences. HTML5: Adding Style Nancy Gill


HTML Organizing Page Content

Web Site Design and Development Lecture 24

Creating and Building Websites

Taking Fireworks Template and Applying it to Dreamweaver

Chapter 7 BMIS335 Web Design & Development

GIMP WEB 2.0 MENUS. Web 2.0 Menus: Horizontal Navigation Bar

Session 4. Style Sheets (CSS) Reading & References. A reference containing tables of CSS properties

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

Chapter 3 Style Sheets: CSS

Web Programming and Design. MPT Junior Cycle Tutor: Tamara Demonstrators: Aaron, Marion, Hugh

CREATING A WEBSITE USING CSS. Mrs. Procopio CTEC6 MYP1

2005 WebGUI Users Conference

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

Before you begin, make sure you have the images for these exercises saved in the location where you intend to create the Nuklear Family Website.

Web Programming Step by Step

Transcription:

CSS for Page Layout 2015 Robert K. Moniot 1

OBJECTIVES In this unit, you will learn: How to use style sheets for layout Controlling text flow, margins, borders, and padding Controlling visibility of elements dynamically Aligning and positioning elements, and text within elements Tips for debugging style sheets A technique for working around browser incompatibility 2015 Robert K. Moniot 2

CSS Box Model All block-level elements are considered to be inside a box surrounded by padding, a border, and a margin. Typically the border is black, and margin and padding provide space around it. Margin Border Padding Content 2015 Robert K. Moniot 3

Borders, Margins, Padding Widths can be set all around (e.g. border-width, margin) or on each side individually (e.g. bordertop-width, margin-top). Different border styles can be selected with borderstyle. Default is none, i.e. border is invisible. 2015 Robert K. Moniot 4

Floats Block-level objects can be floated, so that they are positioned all the way to left or right on a page. Usually used for images, but also useful for text whose width has been made less than full page. Position specified by float property, with values left or right. Adjacent floats are rendered next to each other if space allows. 2015 Robert K. Moniot 5

Text Flow Around Float Text following a float flows around it unless the clear attribute is used: clear: left no floats on left side of text clear: right no floats on right side of text clear: both no floats on either side clear: none default, floats OK on both sides Example 2015 Robert K. Moniot 6

Overflow Floating elements have no effect on size of containing element. A large image with a small amount of text can overflow its box. Example Correct this using overflow: hidden on containing element. Corrected Example 2015 Robert K. Moniot 7

Centering Center a block-level element by Giving it a width less than 100% Setting equal margins left and right (use auto) Alignment of block content is not affected use text-align to control its alignment. Example 2015 Robert K. Moniot 8

New HTML5 elements New in HTML5: header, section, footer, aside, nav, article, figure, figcaption, hgroup No default styling except display:block Site can set style rules so pages using these follow uniform look Also helpful for Semantic Web Example: without style Example: with style 2015 Robert K. Moniot 9

Positioning Elements can be positioned out of the normal flow by using the position attribute, with values: relative moved relative to where it would otherwise go absolute moved to given location on page, scrolls with page fixed located at fixed position in window, does not scroll with page Example 2015 Robert K. Moniot 10

Controlling display Rendering of elements can be controlled using display property. Values: none : element will not be rendered inline : element will be rendered in-line with surrounding content, like a <span> block : element will be rendered as a block, i.e. with line break before and after, like a <div> Use to change block elements to inline or vice versa Can change dynamically, e.g. using hover pseudoclass Example 2015 Robert K. Moniot 11

Invisibility There is also a visibility:hidden property that makes an element invisible, but it still takes up space in the rendered document. Use this if you will be changing visibility of object and don t want location of elements around it to change 2015 Robert K. Moniot 12

Debugging Styles Firebug for Firefox is a powerful tool for debugging style sheets. http://getfirebug.com Or use Firefox Tools Developer Style Editor To see what style rules apply to element: Click on element in page source displayed below rendered page. Or right-click on element in rendered page and select Inspect Element. Example 2015 Robert K. Moniot 13

Compatibility Issues Browsers do not all comply with W3C standards. Internet Explorer has been a particular offender, but is better now. Example shows workaround to include IE-only code Place IE-specific rules in special stylesheet Proprietary IE conditional comment ignored by other browsers Nowadays need to turn on Compatibility View to get bad old IE behavior Example 2015 Robert K. Moniot 14

Compatibility, cont'd JavaScript & PHP provide more general facilities to detect browser make and version and adapt style rules appropriately. Bugs in code can make browsers behave differently always validate HTML and CSS before blaming browser. Compatibility with major browsers listed in documentation at w3schools.com. Install different browsers and test. 2015 Robert K. Moniot 15