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

Similar documents
Assignments (4) Assessment as per Schedule (2)

Adding CSS to your HTML

What is the Box Model?

Client-Side Web Technologies. CSS Part II

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

The Importance of the CSS Box Model

CSS: Cascading Style Sheets

INFS 2150 Introduction to Web Development

INFS 2150 Introduction to Web Development

COMS 359: Interactive Media

Fundamentals of Web Technologies. Agenda: HTML Links 5/22/2017. HTML Links - Hyperlinks HTML Lists

FLOATING AND POSITIONING

BIM222 Internet Programming

Styles, Style Sheets, the Box Model and Liquid Layout

Web Programming and Design. MPT Senior Cycle Tutor: Tamara Week 2

Web Design and Implementation

Building Page Layouts

Internet Programming 1 ITG 212 / A

ITNP43: HTML Lecture 5

Cascading Style Sheets (CSS)

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

CSS MOCK TEST CSS MOCK TEST III

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

Session 3.1 Objectives Review the history and concepts of CSS Explore inline styles, embedded styles, and external style sheets Understand style

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

Appendix D CSS Properties and Values

Using CSS for page layout

IBM Forms V8.0 Custom Themes IBM Corporation

CSS: Lists, Tables and the Box Model

Page Layout Using Tables

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

Introduction to Computer Science Web Development

CSS Box Model. Cascading Style Sheets

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

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

Introduction to Computer Science Web Development

Web Design and Development ACS Chapter 12. Using Tables 11/23/2017 1

The Benefits of CSS. Less work: Change look of the whole site with one edit

Create a three column layout using CSS, divs and floating

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

INFS 2150 Introduction to Web Development

INFS 2150 Introduction to Web Development

Chapter 3 Style Sheets: CSS

CSS Cascading Style Sheets

Cascading Style Sheets CSCI 311

Lab Introduction to Cascading Style Sheets

Creating Layouts Using CSS. Lesson 9

Notes - CSS - Flexbox

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

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

BORDER IMAGES THE BACKGROUND IMAGE PROPERTIES. Learning Web Design, 5e

Block & Inline Elements

Parashar Technologies HTML Lecture Notes-4

Web Design and Development Tutorial 03

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

Mark Scheme. Edexcel Level 2 Certificate in Digital Applications. Unit 5: Coding for the Web

c122sep2214.notebook September 22, 2014

Unit 10 - Client Side Customisation of Web Pages. Week 5 Lesson 1 CSS - Selectors

3. Each of these mark examples contains an error. a. <input name= country value= Your country here. /> b. <checkbox name= color value= teal />

To link to an external stylesheet, the link element is placed within the head of the html page:

CSS Handout. CS 4173 Summer about 70 more properties includes all of CSS1 includes properties for non-screen presentation

COMS 359: Interactive Media

2005 WebGUI Users Conference

Introduction to Computer Science Web Development

What do we mean by layouts?

CSS FOUNDATIONS IN-DEPTH. The nitty-gritty of css...

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

CMPT 165 INTRODUCTION TO THE INTERNET AND THE WORLD WIDE WEB

CSC309 Programming on the Web week 3: css, rwd

VISA/APCO/STAC 2P61 WEBSITE CREATION Fall Term 2012

Development Technologies. Agenda: phpmyadmin 2/20/2016. phpmyadmin MySQLi. Before you can put your data into a table, that table should exist.

CSS for Page Layout Robert K. Moniot 1

Certified CSS Designer VS-1028

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

INFS 2150 Introduction to Web Development

INFS 2150 Introduction to Web Development

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

Designing the Home Page and Creating Additional Pages

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

How to lay out a web page with CSS

CSS: The Basics CISC 282 September 20, 2014

Getting Started with CSS Sculptor 3

CSS.

Mark Scheme (Results)

Website Design (Weekday) By Alabian Solutions Ltd , 2016

Cascade Stylesheets (CSS)

TUTORIAL MADCAP FLARE Tripane and PDF

Introduction to Web Design CSS Reference

Introduction to Web Design CSS Reference

Web Engineering CSS. By Assistant Prof Malik M Ali

CSC Website Design, Spring CSS Flexible Box

Web Site Design and Development Lecture 13

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

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

CSS 1: Introduction. Chapter 3

Taking Fireworks Template and Applying it to Dreamweaver

Zen Garden. CSS Zen Garden

Mark Scheme. June Pearson Level 2 Certificate in Digital Applications. Unit 5: Coding for the Web

Stickers! Introduction. Step 1: Colourful coding sticker

SASS Variables and Mixins Written by Margaret Rodgers. Variables. Contents. From Web Team. 1 Variables

Transcription:

ITU 07204: Fundamentals of Web Technologies Lecture 6: CSS Layouts (Intro) Dr. Lupiana, D FCIM, Institute of Finance Management Semester 2 Agenda: CSS Layout (Box Model) 2 CSS Layout: Box Model All HTML elements can be considered as a box or a container Each having margin, border, padding and the actual content 3 1

CSS Layout: Box Model Border Content Padding 4 CSS Layout: Box Model Margin 5 CSS Layout: Box Model: Height/Width When you set the height and width properties of an HTML element, you just set the width and height of the content area To calculate the full size of an element, you MUST also consider width of the padding and borders properties 6 2

CSS Layout: Box Model: Height/Width Height and width properties can have the following values: length; specifies height or width in px, pt or cm auto; this is default (the browser calculates the height and width) %; specifies height or width in % of the height or width of the containing element respectively 7 CSS Layout: Box Model: Height/Width The following example demonstrates how height and width properties can be used 8 CSS Layout: Box Model: Height/Width The width and height properties can be overridden by the max-width and max-height properties respectively The width or height of an element becomes auto until the maximum width or height is reached The max-width property is used to set the maximum width of an element It prevents the width property from becoming larger than the specified by max-width 9 3

CSS Layout: Box Model: Height/Width The max-width property can have the following values: length; specifies width in px, pt or cm %; specifies width in % of the containing element none; this is default (means there is no maximum width) 10 CSS Layout: Box Model: Height/Width The max-height property is used to set the maximum height of an element It prevents the height property from becoming larger than the specified by max-height The max-width and max-height properties are useful for developing responsive websites Responsive websites are websites that their layouts and contents are responsive to screen size of a device 11 CSS Layout: Box Model: Height/Width Why max-width and max-height properties are useful for developing responsive websites With max-width and max-height properties, the width and height, respectively, of an element is auto until the maximum width or height is reached This means the size of the element, and so its content, readjusts as screen size of a device becomes smaller 12 4

CSS Layout: Box Model: Padding Generates a space around the content area of an element It introduces or removes an area between a margin and content of an element By default, padding of most of the elements is zero The padding is transparent It does not have color 13 CSS Layout: Box Model: Padding CSS provides a set of properties to set a padding on each side of an element; padding-top padding-right padding-bottom padding-left 14 CSS Layout: Box Model: Padding All the padding properties can have the following values: length; specifies a padding in px, pt, or cm %; specifies a padding in % of the width of the containing element Inherit; specifies that the padding should be inherited from a parent element 15 5

CSS Layout: Box Model: Padding The following example demonstrates how padding property can be used 16 CSS Layout: Box Model: Padding Similar effect on the previous example can be achieved by using the short form of specifying padding in CSS 17 CSS Layout: Box Model: Padding The effect of the short form of the padding property in the previous example is as follows The first value is for top padding The second value is for right padding The third value is for bottom padding The fourth value is for left padding 18 6

CSS Layout: Box Model: Border Creates boundary around padding and content of an element Unlike margin and padding, border property; Is not transparent It allow you to specify the style, width, and color of an element's border using borderstyle, border-width and border-color CSS properties 19 CSS Layout: Box Model: Border None of the other border properties will have effect unless the border-style property is set The border-style property is a short form BUT CSS provides a set of properties to specify styles for each border; border-top-style border-right-style border-bottom-style border-left-style 20 CSS Layout: Box Model: Border A number of values can be specified but solid and dotted are the common values Both width, style and color can be specified in a single declaration by using border property; 21 7

CSS Layout: Box Model: Margin Generates spaces around an element It sets the size of the white space outside the border It is used to separate two elements by introducing a space in between The margin is transparent It does not have color 22 CSS Layout: Box Model: Margin CSS provides a set of properties to set a margin on each side of an element; margin-top margin-right margin-bottom margin-left 23 CSS Layout: Box Model: Margin All the margin properties can have the following values: length; specifies a margin in px, pt, cm or auto %; specifies a margin in % of the width of the containing element inherit; specifies that the margin should be inherited from a parent element 24 8

CSS Layout: Box Model: Margin The following example demonstrates how margin property can be used 25 CSS Layout: Box Model: Margin Similar effect on the previous example can be achieved by using the short form 26 CSS Layout: Box Model: Margin The effect of the short form of the margin property in the previous example is as follows The first value is for top margin The second value is for right and left margins The third value is for bottom margin Note, margins have a specific behavior called margin collapsing When two boxes touch against one another, the distance (margin) between them is the value of the largest margin, and not their sum. 27 9

CSS Layout: Box Model: Margin You can centre your web page by simply using margin property as shown below The above block set the top and bottom margins to 0 and left and right margins to auto (meaning the remaining 20% of width should be equally divided i.e. 10% on left and right margins) 28 10