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

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

2005 WebGUI Users Conference

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

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

Schrödinger's Website

SUMMARY OF DESIGN CHOICES

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

Appendix D CSS Properties and Values

Chapter 3 CSS for Layout

TITLE EXAMPLE. Sub - title

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

What is the box model?

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

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

Agenda. Combining Rules & Selectors Classes, IDs and DIVs

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

Introduction to Web Design CSS Reference

Introduction to Web Design CSS Reference

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

Web Engineering CSS. By Assistant Prof Malik M Ali

Styles, Style Sheets, the Box Model and Liquid Layout

Web Design and Development Tutorial 03

CSS Cascading Style Sheets

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

COMS 359: Interactive Media

mpdf Example 6. Tables nested <?php

CSS Box Model. Cascading Style Sheets

Cascading Style Sheet Quick Reference

WEBSITE PROJECT 2 PURPOSE: INSTRUCTIONS: REQUIREMENTS:

CSS: The Basics CISC 282 September 20, 2014

Gestures: ingsa GESTURES

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

Controlling Appearance the Old Way

Building Page Layouts

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

CSC309 Programming on the Web week 3: css, rwd

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


Page Layout Using Tables

HTML/XML. HTML Continued Introduction to CSS

Brand identity design. Professional logo design + Branding guidelines + Stationery Designed by JAVIER

Faculty Web Pages: Editing the Template Prepared by Tamara Fudge, June 2008

COSC 2206 Internet Tools. CSS Cascading Style Sheets

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

q u e s t i o n s? contact or

INFS 2150 Introduction to Web Development

INFS 2150 Introduction to Web Development

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

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

Updates to Phone Contact

Adding CSS to your HTML

SCHOOL DISTRICT 308 VISUAL STANDARD GUIDE

Parashar Technologies HTML Lecture Notes-4

Reading 2.2 Cascading Style Sheets

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.

Creating and Implementing Decision Templates

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

CSE 154 LECTURE 5: FLOATING AND POSITIONING

Brand Standards Manual. Copyright March 2007

Personal brand identity desigend by JAVIER

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

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

ALLASSO CORPORATE IDENTITY USER GUIDLINES

ICT IGCSE Practical Revision Presentation Web Authoring

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

7300 Warden Avenue, Suite 503 Markham, Ontario Canada L3R 9Z6. Phone: Toll Free: Fax:

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

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

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

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

G2E Web Banners: 200 x 100 Signature. 160 x 160 Social Media. 125 x 125 web button

The POGIL Project Publication Guidelines

Web Design and Implementation

Row 1 This is data This is data

Row 1 This is data This is data. This is data out of p This is bold data p This is bold data out of p This is normal data after br H3 in a table

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

<head> <meta http-equiv= Content-Type content= text/html; charset=utf-8 /> <title>caprese Salad</title> </head>

Presentation title placeholder, can be two lines Presentation subtitle placeholder. Date placeholder

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

Divs, Classes & IDs. Web Development

WCU ATHLETICS LOGOS & USAGE WESTERN CAROLINA UNIVERSITY ATHLETIC LOGO GUIDELINES PAGE 1

Chapter 7 Tables and Layout

Masthead. Masthead Subhead. Heading 1 spans two columns as a standard. What s Inside. Issue style Year Month Newsletter Website URL

TYPOGRAPHY. Thoughtful use of typography allows a brand to evoke emotion and convey the tone of the brand.

CSS Styles Quick Reference Guide

HTML and CSS a further introduction

3.1 Introduction. 3.2 Levels of Style Sheets. - HTML is primarily concerned with content, rather than style. - There are three levels of style sheets

Cascading Style Sheets (CSS)

BRAND GUIDELINES All rights reserved.

**Method 3** By attaching a style sheet to your web page, and then placing all your styles in that new style sheet.

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

Viewport, custom CSS, fonts

Creating Layouts Using CSS. Lesson 9

A STEP-BY-STEP GUIDE TO EVENT BRANDING

template guidelines. 1. Visual identity 2. How to build an

Week 5 jquery and the DOM

CMPT 165: More CSS Basics

CSS.

Unit 20 - Client Side Customisation of Web Pages. Week 2 Lesson 3 Introduction to CSS

Transcription:

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

So far Looked at what CSS is Looked at why we will use it Used CSS In-line Embedded (internal style-sheet) External <link rel= stylesheet href= mystyle.css > <style title= currrentstyle media= screen > @import mystyle.css </style>

Some definitions Selector Property Value elements

Selectors Selector title Property the item being changed Value - How much it is being changed E.g. H1{color: red} specifies that h1 will always give a red colour Element each area of the page; may be a wide variety from <body> to <p>

Types of Selector

Web-page structure Different elements that can be nested within one another. Style commands: body{ background-color: aqua; font-size: 1 em; } div{ Width: 30%; }.feedback{ color: #00ff00; } #footnote{ font-size: 0.2em; } HTML <body> <div> </body> <div class= feedback ></div> <div class= feedback ></div> </div> <div id= footnote ></div>

Box Model CSS creates layout of web-pages View in any browser, At any resolution design integrity should remain. Layout recalculated on each opening Pages can be designed very accurately pixel perfect

Content area Place the text, images etc here Usually have more than one on each page CSS.item{ width: 20%; background-color: aqua; color: red; } HTML <div class= item >some text <img src= images/#.jpg alt= my image description in words /> </div>

Page of examples Create a web-page BoxEG.html with the following elements: <body> custom background-color <div id= wrapper > custom backgroundcolor, width:80% 2 <div> each containing an image & <p> 2 <p> custom color, 2 paragraphs of lorem ipsum in each

BoxEG Should look something like image1 #wrapper image2 Text in paragraphs Body

Padding Blank space around the content so that it doesn't impinge on the border (or vice versa). Is optional, if not defined is set to zero (invisible).

Padding examples Add padding to the divs with images in them. div { padding: 5px; } Record the code, screen-shot the corresponding webpage element Change the padding e.g. to 50 px, record the code, screen-shot the corresponding web-page element. Write a brief description of how padding has affected the appearance of the element.

Border Designed area at the edge around the content (outside the padding). Is optional, if not defined is set to zero (invisible). Can define: Width Color Style (limited list use W3C to find out what these are

Border examples Add a border to the div id= wrapper. #wrapper{ Border: 5px solid red; } record the code, screen-shot the corresponding webpage element. Add other borders change width, colour and style. Possible styles are: dotted, dashed, solid, double, groove, ridge, inset, outset. Record as above. Write a brief description of how the border has affected the appearance of the element.

Margin Blank space around the edge of everything to protect it from the edge of the screen or other nearby elements. Is optional, if not defined is set to zero (invisible). Can be negative.

Margin example Add a margin to both of the <p> elements. p { Margin: 10px; } record the code, screen-shot the corresponding webpage elements. Change the margin e.g. to 50 px, or -10px (margins can take a negative value), record the code, screen-shot the corresponding web-page elements. Write a brief description of how margin has affected the relative positions of the element.

So far Looked at what CSS is & why we will use it Used CSS In-line Embedded (internal style-sheet) External Link or import Box Model Content Padding Border & margin

CSS Box Model Structures pages like a table Defines: Margins Borders Padding Content

Box model Can define height & width for each area Can be set separately Margins can have negative values Usually set as either pixels or percentages Percent of screen is best for layout consistency Can be in-line or blocked

Advantages of CSS Controlling & editing layout is faster House style more consistent all pages use same style sheet Smaller file sizes formatting in one file not duplicated across all web-pages Accessibility for users with screen readers improved.

Assignment 1 P1 explain how HTML files access CSS P2 explain the features of the box model for CSS M1 assess different implementation styles of CSS

Some more CSS code The following slides have a range of CSS code for reference: Background-color Background-images Formatting text Applying borders Applying padding Heading styles Positioning elements Creating columns

Background colour <html> 2. <head> 3. <style> 4. body {background-color: yellow} 5. </style> 6. </head> 7. <body> 8. </body> 9. </html>

Background images <html> 2. <head> 3. <style> 4. body {background-image: url( picture.jpg )} 5. </style> image must be in the same folder 6. </head> as web-page or whole file-path. 7. <body> 8. </body> 9. </html>

Formatting text <html> 2. <head> 3. <style> 4. h1{font-family: serif; font-style: italic; font-weight: bold; font-size: 200px; color: green;} 5. </style> 6. </head> 7. <body> 8. <h1> Lorem ipsum </h1> 9. </body> 10. </html>

Applying borders <html> 2. <head> 3. <style> 4..border1 {border-style: groove} 5..border2 {border-style: double solid} 6..border3 {border-style: double solid groove} 7. </style> 8. </head> 9. <body> 10. <p class= border1 > Lorem ipsum </p> 11. <p class= border2 >dolor sit amet</p> 12. <p class= border3 >consectetur adipiscing elit</p> 13. </body> 14. </html>

Applying padding. <html> 2. <head> 3. <style> 4..padding1 {padding: 1cm} 5..padding2 {padding: 0.5cm 1.5cm} 6. </style> 7. </head> 8. <body> 9. <table border= 1 > 10. <tr> 11. <td class= padding1 >dolor sit amet</td> 12. </tr> 13. </table> 14. <br> 15. <table border= 1 > 16. <tr> 17. <td class= padding2 > consectetur adipiscing elit </td> 18. </tr> 19. </table> 20. </body> 21. </html>

Heading styles <html> 2. <head> 3. <style> 4. h1{ 5. background: red; 6. color: white; 7. font-family: times new roman; 8. font-style: italic; 9. } 10. h2{ 11. text-align: center; 12. text-decoration: underline; 13. font-size: xx-large; 14. Font-weight: bold; 15. } 16. </style> 17. </head> 18. <body> 19. <h1> Sed ac odio eu massa </h1> 20. <br> 21. <h2> mattis pellentesque a </h2> 22. </body> 23. </html>

Positioning elements <html> 2. <head> 3. <style> 4..position_relative {position:relative;left;20px} 5.. position_absolute {position:absolute;left;200px;top:20px} 6..border3 {border-style: double solid groove} 7. </style> 8. </head> 9. <body> 10. Suspendisse ac orci tortor 11. <p class=position_relative>dolor sit amet</p> 12. <p class=. position_absolute> consectetur adipiscing elit</p> 13. </body> 14. </html>

Positioning elements Static Default, next line (or floating) Relative lays out all elements as though the element were not positioned, and then adjust the element's position, without changing layout leaves a gap for the element Absolute fixed

Positioning elements Static Relative Absolute Instead, position it at a specified position relative to its closest positioned ancestor if any, or otherwise relative to the initial containing block. No gap. Fixed position it at a specified position relative to the screen's viewport and don't move it when scrolled. No gap.

Creating columns <html> 2. <head> 3. <style> 4..nav { 5. width: 220px; 6. padding: 10px; 7. float: left; 8. } 9..content { 10. padding: 10px; 11. margin-left: 230px; 12. border-left: 1px solid #006; 13. } 14..footer { 15. Border-top: 1px solid #006; 16. Text-align: right; 17. } 18. </style> 18. </head> 19. <body> 20. Lorem ipsum 21. <div class= nav >Suspendisse aliquet</div> 22. <div class= content >porta sapien</div> 23. <div class= footer >eget dignissim</div> 24. </body> 25. </html>

Columns (Newspaper) <head> <style type="text/css">.newspaper { -moz-column-count:3; /* Firefox */ -webkit-column-count:3; /* Safari and Chrome */ column-count:3; } </style> </head> <body> <div class="newspaper"> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad... </div> </body> </html>