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

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

Media Information: Online Advertising HANNOVER MESSE

Functional Design for Developer Documentation. Ulrike Parson

L A TEX - First Class

Magic File Manipulator 2

[av_hr class='custom' height='50' shadow='no-shadow' position='center' custom_border='avborder-fat'

Interaction with Interconnected Data in Participatory Processes

UMST Brand Guidelines

Design elements. Brand Identity Guidelines v 1.0 June 2018

Style guide for all online applications of Hannover Re. 0.0 Introduction

Dynamic Web Development

Key/Value Pair versus hstore

Developing a Cloud Computing Based Approach for Forensic Analysis using OCR

Graphic Standards Guide

HG DIP-40MM-WVN1-18 (BROADLOOM LABEL) HG DIP-30MM-CTNPLY1-18 (BROADLOOM LABEL) dip HOME LABELS PAGE 1 ART: 06/21/2018.

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

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

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

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

Advanced CSS. Steven Pemberton. CWI and W3C Kruislaan SJ Amsterdam The Netherlands.

view cart Expanded view 2 items in your cart 18 LCD TV MODEL NUMBER $1, LCD TV MODEL NUMBER $1, Subtotal: $3,199.

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

Lab Introduction to Cascading Style Sheets

An introduction to L A TEX, as well as Bibtex, Beamer, Tikz, and all that (Part I)

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

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

HTML Summary. All of the following are containers. Structure. Italics Bold. Line Break. Horizontal Rule. Non-break (hard) space.

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

VISUAL IDENTITY STANDARDS

Doing more with Views. Creating an inline menu

Internet of People. Bluepaper: v Independence published by IoP Community. Authors. Contributors. Layout

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

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

Introduction to Web Design CSS Reference

Assignments (4) Assessment as per Schedule (2)

Introduction to Web Design CSS Reference

VISUAL IDENTITY STANDARDS

HTML and CSS a further introduction

Page Layout with Crop Marks

To illustrate how to set TAG styles the <body> and <h1> tags (for the BODY and the HEADING 1 styles) will be adjusted.

CSS.

Styles, Style Sheets, the Box Model and Liquid Layout

Creating Layouts Using CSS. Lesson 9

CSS: The Basics CISC 282 September 20, 2014

COMS 359: Interactive Media

StepStone Styleguide. Guidelines for a powerful StepStone Brand. Version:

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

Reading 2.2 Cascading Style Sheets

COSC 2206 Internet Tools. CSS Cascading Style Sheets

HTMLnotesS15.notebook. January 25, 2015

Creating a Job Aid using HTML and CSS

Agenda. Combining Rules & Selectors Classes, IDs and DIVs

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

Chapter 3 CSS for Layout

Thinking inside the box

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

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.

CSS Tutorial Part 1: Introduction: A. Adding Style to a Web Page (3 options):

CSS Cascading Style Sheets

Introduction to WEB PROGRAMMING

Cascading Style Sheets Level 2

Admin & Today s Agenda

Kerberos Definitive Guide READ ONLINE

Web Recruitment Module Customisation

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

Graphic Standards Guide

I lllll llllllll Ill lllll lllll lllll lllll lllll

Once-Only Principle Reducing Administrative Burden for Citizens and Businesses

CSS worksheet. JMC 105 Drake University

2005 WebGUI Users Conference

INTRODUCTION. About This Manual Letter from Larry Heard Who We Are IDENTITY COMPONENTS

Groupings and Selectors

What is the box model?

Introduction to Computer Science Web Development

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

HTML & CSS November 19, 2014

Text and Layout. Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 11. This presentation 2004, MacAvon Media Productions

Dreamweaver CS3 Lab 2

CS134 Web Site Design & Development. Quiz1

Unveiling the Basics of CSS and how it relates to the DataFlex Web Framework

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

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

FLOATING AND POSITIONING

5 Snowdonia. 94 Web Applications with C#.ASP

HTML & CSS Cheat Sheet

Microsoft Expression Web Quickstart Guide

CSS. Lecture 16 COMPSCI 111/111G SS 2018

CSS Box Model. Cascading Style Sheets

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

Web Designer s Reference

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

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

In the early days of the Web, designers just had the original 91 HTML tags to work with.

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

H A-Z of DTP Features

This is an H1 Header. This is an H2 Header. This is an H3 Header

Web Authoring and Design. Benjamin Kenwright

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

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

INTRODUCTION TO CSS. Mohammad Jawad Kadhim

Transcription:

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

Last Session CSS box model Concept of identity - id

This Session External style sheets Using CSS in conjunction with images

Introduction External style sheets allow for easier maintenance of web pages Well-placed images can bring an otherwise commonplace design to life It beats the sliced image look Working with images in CSS requires a few simple skills

The External Style Sheet You are familiar with this: <!doctype html public "-//W3C//DTD HTML 4.0//EN"> <html> <head> <style type="text/css"> #box { width: 350px; border-color: red; border-style: dashed; </style> </head> <body> This is text outside the box. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. <div id="box"> This is text inside the box. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. </div> </body> </html>

Convert to External Style Sheet <!doctype html public "-//W3C//DTD HTML 4.0//EN"> <html> <head> <link rel="stylesheet" type="text/css" href= yourstyle.css" /> </style> </head> <body> This is text outside the box. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. @charset "utf-8"; /* CSS Document */ /*yourstyle.css*/ #box { width: 350px; border-color: red; border-style: dashed; <div id="box"> This is text inside the box. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. </div> </body> HTML Link Style sheet </html>

Adding Borders to Images Photographic images, perhaps used to illustrate an article, or as a display in a photo album, look neat when bordered with a thin line Opening each picture in a graphics program to add the border is a time consuming process and, if you ever need to change that border s colour or thickness, you ll need to go through the same arduous process all over again to create the desired images

Image Borders Adding a border to an image is a simple procedure using CSS. Example: http://www.comfydigs.co.uk/cssjava/4_6.html

Illustrative example By changing the style sheet ONLY: body { font: 0.9em Verdana, Geneva, Arial, Helvetica, sans-serif; #album { margin: 30px; list-style:none; #album li { float:left; #album img { border: 1px solid #000000; margin-right: 30px; * I cheated and added a new style sheet and changed the reference to the new style in the web page

We will get this: Borders! http://www.comfydigs.co.uk/cssjava/4_7.html

Analysis body { font: 0.9em Verdana, Geneva, Arial, Helvetica, sans-serif; #album { margin: 30px; list-style:none; Create a new ID called album and set it 30px from the left edge #album li { float:left; #album img { border: 1px solid #000000; margin-right: 30px; Create a new ID called album li Make the list float to the left Create a new ID called album img Give it a border and a right margin of 30px

Another Example Here we have our initial page with no CSS whatsoever Ugly blue borders don t look good http://www.comfydigs.co.uk/cssjava/4_8.html

How to Fix Adding border="0" to images that are links to other documents is probably something you would do almost automatically However, border has been deprecated in the current versions of HTML and XHTML Deprecated means superseded or replaced It should therefore be avoided

Solution Just as you can create a border, so you can remove one Setting an image s border property to none will remove those ugly borders img { border: none; Add this to a style sheet (border property in a style sheet is legal)

Backgrounds Before CSS, backgrounds were added using the background attribute of the <body> tag This attribute is now deprecated and replaced by CSS properties body { background-color: #ffffff; background-image: url(peppers_bg.jpg); background-repeat: no-repeat; The above rules add the image peppers_bg.jpg as a background to any page to which this style sheet is attached

The CSS body { h1{ #content { background-color: #ffffff; background-image: url(images/peppers_bg.jpg); background-repeat: no-repeat; background-image: url(dotty.gif); background-repeat: repeat-x; background-position: bottom left; padding: 0 0 6px 0; color: #41667f; font-size: 160%; font-weight: normal; background-color: transparent; margin: 2em 4em 2em 4em; background-color: transparent; padding: 1em 1em 40px 1em; Call a background picture Repeat across the x-axis i.e. Left to right Set a margin around the content

The Result

Discussion The CSS property background-image enables you to specify as a URL the location of a background image. By default, the background will tile as shown http://www.comfydigs.co.uk/cssjava/4_10.html As we don t want multiple peppers in this example, we need to prevent this image from tiling. To do so, we set the property backgroundrepeat to no-repeat.

Repeating Images Other values for background-repeat are: repeat - This default value causes the image to tile across and down the page www.comfydigs.co.uk/cssjava/4_10.html repeat-x - The image tiles across the page in a single row of images www.comfydigs.co.uk/cssjava/4_11.html repeat-y - The image tiles down the page in a single row www.comfydigs.co.uk/cssjava/4_12.html

Positioning a Background Image By default, if you add a single, non-repeating background image to the page, it will appear in the top left corner of the viewport. If you have set the background to tile in any direction, the first image will appear at that location, and will tile from that point. However, it is also possible for the image to be displayed anywhere else on the page.

Positioning a Background Image To position the image, we need to use the CSS property background-position body { background-color: #FFFFFF; background-image: url(peppers_bg.jpg); background-repeat: no-repeat; background-position: center center; This will position the image in the centre of the page http://www.comfydigs.co.uk/cssjava/4_13.html

Keywords for Background Positioning Keyword combinations that you can use are: top left top center top right center left center center center right bottom left bottom center bottom right If you only specify one of the values, the other will default to center. E.g. background-position: top; Is the same as background-position: top center;

Summary External style sheets Using CSS in conjunction with images

Next Session Practical CSS for you to try

To Do Try the examples done today, and see what happens when you change the values Complete assignment