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

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

Creating Layouts Using CSS. Lesson 9

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

What do we mean by layouts?

Styles, Style Sheets, the Box Model and Liquid Layout

COMS 359: Interactive Media

ITNP43: HTML Lecture 5

FLOATING AND POSITIONING

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

THE HITCHHIKERS GUIDE TO HTML

What is the Box Model?

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

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

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

The Importance of the CSS Box Model

HIERARCHICAL ORGANIZATION

Module 2 (VII): CSS [Part 4]

GIMP WEB 2.0 MENUS WEB 2.0 MENUS: HORIZONTAL NAVIGATION BAR CREATING AN HTML LIST

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

Assignments (4) Assessment as per Schedule (2)

Introduction to WEB PROGRAMMING

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

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

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

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

Chapter 3 CSS for Layout

Block & Inline Elements

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

Introduction to Computer Science Web Development

12/9/2012. CSS Layout

First Diploma Unit 10 Client Side Web. Week 4 CSS and Images

THE HITCHHIKERS GUIDE TO HTML

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

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

INFS 2150 Introduction to Web Development

INFS 2150 Introduction to Web Development

c122sep2214.notebook September 22, 2014

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

Page Layout Using Tables

CSS Box Model. Cascading Style Sheets

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

Cascading Style Sheets (CSS)

Internet Programming 1 ITG 212 / A

Using CSS for page layout

Cascading Style Sheets CSCI 311

Creating a Job Aid using HTML and CSS

CSCU9B2: Web Tech Lecture 3

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

CSS worksheet. JMC 105 Drake University

Getting Started with Eric Meyer's CSS Sculptor 1.0

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

Web Design and Development Tutorial 03

Client-Side Web Technologies. CSS Part II

Introduction to Web Design CSS Reference

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

Introduction to Web Design CSS Reference

Designing and Developing a Website. 6 August Marking Scheme

Part 3: Images & form styling NOMZAMO S WEBSITE

The default style for an unordered (bulleted) list is the bullet, or dot. You can change the style to either a square or a circle as follows:

Lab Introduction to Cascading Style Sheets

CSS: formatting webpages

Cascading Style Sheets (Part II)

How to lay out a web page with CSS

CSS: Cascading Style Sheets

ICT IGCSE Practical Revision Presentation Web Authoring

ADDING CSS TO YOUR HTML DOCUMENT. A FEW CSS VALUES (colour, size and the box model)

5. When the Plugin Installed Successfully message appears, click Activate Plugin. You re all set, so let s get started with your first recipe post.

CSS: Lists, Tables and the Box Model

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

Create a three column layout using CSS, divs and floating

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

Agenda. Combining Rules & Selectors Classes, IDs and DIVs

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

CSS Cascading Style Sheets

Web Authoring and Design. Benjamin Kenwright

Chapter 7 BMIS335 Web Design & Development

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

Chapter 6: CSS Layouts

HTMLnotesS15.notebook. January 25, 2015

<body bgcolor=" " fgcolor=" " link=" " vlink=" " alink=" "> These body attributes have now been deprecated, and should not be used in XHTML.

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

E-Business Systems 1 INTE2047 Lab Exercises. Lab 5 Valid HTML, Home Page & Editor Tables

CSS. Shan-Hung Wu CS, NTHU

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

CSS THE M\SS1NG MANUAL. David Sawyer McFarland. POGUE PRESS" O'REILLr Beijing Cambridge Farnham Köln Paris Sebastopol Taipei Tokyo

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

Appendix D CSS Properties and Values

COMP 101 Spring 2017 EXAM 2 2 March 2017

WEBSITE PROJECT 2 PURPOSE: INSTRUCTIONS: REQUIREMENTS:

Class 9 / Instructor: Ira Epstein

Introduction to Computer Science Web Development

AGENDA :: MULTIMEDIA TOOLS :: CLASS NOTES

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

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

CSS BASICS. selector { property: value; }

Zen Garden. CSS Zen Garden

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

door to my garden Simple CSS resulting in impressive, sophisticated visual effects

HTML and CSS COURSE SYLLABUS

Exam II CIS 228: The Internet Prof. St. John Lehman College City University of New York 5 November 2009

Transcription:

Web Development Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology http://www.wit.ie http://elearning.wit.ie

CSS: The Box Model Web Development

Box Model in Action 3

The Guarantee box 4

Use class to identify the guarantee paragraph No styling initially <p class="guarantee"> Our guarantee: at the lounge, we're committed to providing you, our guest, with an exceptional experience every time you visit. Whether you're just stopping by to check in on email over an elixir, or are here for an out-of-the-ordinary dinner, you'll find our knowledgeable service staff pay attention to every detail. If you're not fully satisfied, have a Blueberry Bliss Elixir on us. </p> 5

No padding around the content - i.e no space between text and border No margin left/right But there seems to be a margin top/ bottom? -> Check Default Style Sheet.guarantee border-color: border-width: border-style: background-color: black; 1px; solid; #a7cece; 6

Box Model Here s what the paragraph would look like if we drew it as a box model diagram 7

What we want: 8

Add Padding Can be either to a number of pixels or a percentage of area inside the border.guarantee border-color: border-width: border-style: background-color: padding: black; 1px; solid; #a7cece; 25px; 9

Had we chosen %.guarantee border-color: black; border-width: 1px; border-style: solid; background-color: #a7cece; padding: 25%; 10

Add Margin Now we have 25 pixels of margin on all sides..guarantee border-color: border-width: border-style: background-color: padding: margin: black; 1px; solid; #a7cece; 25px; 30px; 11

Agenda Box Model Content, Padding, Border & Margin Background images Border Styles, Width, Colour 12

Add a Background Image Background.gif <img> and background images: An <img> element, on the other hand, is used to include an image that has a more substantial role in the page, like a photo or a logo A background image is pure presentation, and the only reason you would use a background-image is to improve the attractiveness of an element. We could have just placed the image inside the paragraph, and we could probably get the same look and feel, but the guarantee star is pure decoration It has no real meaning on the page and it s only meant to make the element look better. So, background-image makes more sense. 13

Background Image Image sits on top of the background color. Because it has a transparent background, it lets the color show through.guarantee border-color: border-width: border-style: background-color: padding: margin: background-image: black; 1px; solid; #a7cece; 25px; 30px; url(images/background.gif); The background images, like the background color, only show under the content area and padding, and not outside the border in the margin 14

By default, background images are repeated. The no-repeat value for the backgroundrepeat property turns this off, so we get just one image. By default, browsers position a background image in the top, left of the element.guarantee border-color: black; border-width: 1px; border-style: solid; background-color: #a7cece; padding: 25px; margin: 30px; background-image: url(images/background.gif); background-repeat: no-repeat; background-position: top left 15

More Padding For padding, margins, and even borders, CSS has a property for every direction: top, right, bottom, and left. To add padding on the left side, use the padding-left property.guarantee border-color: black; border-width: 1px; border-style: solid; background-color: #a7cece; padding: 25px; padding-left: 80px; margin: 30px; background-image: url(images/background.gif); background-repeat: no-repeat; background-position: top left 16

More Margins.guarantee border-color: black; border-width: 1px; border-style: solid; background-color: #a7cece; padding: 25px; padding-left: 80px; margin: 30px; margin-right: 250px; background-image: url(images/background.gif); background-repeat: no-repeat; background-position: top left 17

Using DIVs to define sections While we have used the box model to specify space within (i.e., padding) and outside (i.e., margin) the border of an element, it can also be employed to specify the position of portions of text on the page We could, for example, add content related to new releases on the right hand-side and the main content on the left-hand side as illustrated in the next diagram, using a two-column layout Main content Releases 36

Using Divs to define Regions of a Page To achieve this we could do the following: Use DIV elements as containers, one for the main content and one for the left content Allocate an ID to each of these divs Create CSS rules for each DIVs so that they are floating to the left and right of the page, respectively <div id = maincontent> <div id = releases> #releases float:right; </div> </div> #maincontent float:left; 37

#releases border-width: thin; border-style: solid; border-color: #007e7e; width: 150px; padding: 0px 20px 30px 10px margin-left: 20px; text-align: center; float:right; 20

#releases border-width: thin; border-style: solid; border-color: #007e7e; #maincontent width: 150px; padding: 0px 20px 30px 10px margin-left: 20px; text-align: center; float:right; float:left; width:800px; #maincontent float:left; width:800px; 21

22

23

24