Image Use. Agenda Ordinary display of image: height, width, alt Rollovers Images as links (remove blue surround) Background images: stretch, tile, xonly/yonly.

Slides:



Advertisements
Similar presentations
Chapter 3 – Designing your web pages Dr. Stephanos Mavromoustakos.
Advertisements

HTML – A Brief introduction Title of page This is my first homepage. This text is bold  The first tag in your HTML document is. This tag tells your browser.
Very quick intro HTML and CSS. Sample html A Web Title.
CSS Menus and Rollovers. Agenda foil Separating style from content 3 pages in one file Rollovers in CSS Horizontal drop-downs Vertical drop-downs.
End User Computing An Introduction to CSS Sujana Jyothi Research Lab1, Callan Building, Department of Computer Science
With CSS, a color is most often specified by: a HEX value - like "#ff0000" an RGB value - like "rgb(255,0,0)" a color name - like "red“ Example h1.
กระบวนวิชา CSS. What is CSS? CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to.
CSS normally control the html elements. Three Ways to Insert CSS There are three ways of inserting a style sheet: External style sheet Internal style.
9-May-15 More CSS. 2 A different emphasis CSS is the same for XML as it is for HTML and XHTML, but-- XML contains no display information If you want your.
CS4370/6370 Web Development Cascading Style Sheets (CSS)
Web Design & Development Cascading Style Sheets (CSS)
TUTORIAL 4: CREATING PAGE LAYOUT WITH CSS Session 4.3.
Chapter 9. Links  When styling a link, you must tell CSS both what you want to style, and when you want the style to happen  Web browsers keep track.
Style sheets can also affect the BODY. style4.css BODY {BACKGROUND-COLOR : white} H1 {COLOR : red; FONT-SIZE : 50; FONT-FAMILY : arial} H2 {COLOR : green}
Style sheets can also affect the body. style4.css body {background-color : white} h1 {color : red; font-size : 50; font-family : arial} h2 {color : green}
4.01 Cascading Style Sheets
Inline, Internal, and External FIle
Lecture 7 Cascading Style Sheets (CSS) Boriana Koleva Room: C54
Chapter 5 Web Graphics Styling Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
Cascading Style Sheets 1 Color and Backgrounds. Cascading Style Sheets 2 Color and Backgrounds Computer color basics Expression of color values using.
HTML - Quiz #2 Attendance CODE:
The Characteristics of CSS
Cascading Style Sheets CSS. CSS - Structure Declaration block Property: identifies what to change Value: how to change it Selector – example h1{ font-size:
WRT235: Writing in Electronic Environments CSS Backgrounds, colors, fonts.
CSS in XHTML continued Please use speaker notes for additional information!
CSS The Definitive Guide Chapter 8.  Allows one to define borders for  paragraphs  headings  divs  anchors  images  and more.
 HTML stands for Hyper Text Mark-up Language. The coding language used to create documents for the World Wide Web  HTML is composed of tags. HTML tags.
IDs versus Classes Naming Your Tags for Maximum Functionality.
(CSS) More Details Instructor: Mr. Ahmed Al Astal ITGD4104 Department Requirement for senior student University of Palestine Faculty of IT.
ITP 104.  Basic HTML using and form  Using Filezilla  public_html ▪ 755 permission  Have a directory name itp104 ▪ 755 permission  classpage.html.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
 A style sheet is a single page of formatting instructions that can control the appearance of many HTML pages at once.  If style sheets accomplished.
Web Development & Design Foundations with XHTML Chapter 4 Key Concepts.
Just A Few More Fun Objectives 1 Having Some Fun With Java Script 2 Using Style Sheets.
CO1552 – Web Application Development Cascading Style Sheets.
Adding Graphics to Web Pages. CSS does not have any properties specifically aimed at formatting images Use properties you have already learned, i.e.,
Cascading Style Sheets in.NET Lilian Kiilu, Client/Server & Web Applications, Coms 463/563, Section 1pm, Fall 2005, November 16 th 2005.
Introduction to CSS. What is CSS?  Cascading Style Sheets  Used for styling HTML  Also important in javascript and jquery for selectors  External.
CHAPTER 3 CSS & CSS3 อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา 1.
Chapter 4 BIE1313/BPROG1203 | Web design Prepared by Mohamed Abdulkarim / Mike Ng Ah Ngan.
 Remember that HTML is just text  Need to point to pictures  Use the img tag  alt: › screen reader › REQUIRED for this class and to validate.
Cascade Style Sheet Introduction. What is CSS?  CSS stands for Cascading Style Sheets  Styles define how to display HTML elements  Styles were added.
CSS Cascading Style Sheets. CSS Advantages Greater typography and page layout control Style is separate from structure Styles can be stored in a separate.
Lesson 03 // Cascading Style Sheets. CSS Stands for Cascading Style Sheets. We’ll be using a combination of Html and CSS to create websites. CSS is a.
Adding Images Learning Web Design: Chapter 7. Using an Image Images have many purposed on a Web site Used as a static image To add illustration: ex. A.
More CSS.
Web Design and Development for Business Lecture 4 Cascading Style Sheet (CSS)
 2008 Pearson Education, Inc. All rights reserved Cascading Style Sheets™ (CSS)
 2008 Pearson Education, Inc. All rights reserved Cascading Style Sheets™ (CSS)
Chcslonline.org Text –wrapping around Images. chcslonline.org To wrap text around an image, lets set up a style in our style sheet. open a new notepad.
INTRODUCTORY Tutorial 4 Exploring Graphic Elements and Images.
Web Foundations TUESDAY, NOVEMBER 19, 2013 LECTURE 31: DREAMWEAVER: MODIFY MENU AND PROPERTY PANEL.
XP Review 2 New Perspectives on JavaScript, Comprehensive1 Introducing Cascading Style Sheets Formatting Web Pages with CSS.
CIS234A Lecture 5 Instructor Greg D’Andrea. Font Styles Review Font-Family: generic family, font family Font-Size: em, pt, px, %, mm, cm, in Font-Style:
3.2 Cascading Style Sheets. 2 Positioning Elements Normally, elements are laid out on the page in the order that they are defined in the XHTML document.
Microsoft Expression Web-Illustrated Unit F: Enhancing a Design with CSS.
CSS – Cascading Style Sheets
Lecture 2: Cascading Style Sheets (CSS) Instructor: Dr. M. Anwar Hossain.
Web Technologies Beginning Cascading Style Sheets (CSS) 1Copyright © Texas Education Agency, All rights reserved.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
Web Design (15) CSS Opacity, Link Colours & Background Images.
Creating Image Based Rollovers with CSS Mike Takahashi Office of Instructional Development.
HTML5 and CSS3 Illustrated Unit F: Inserting and Working with Images.
CS 120: Introduction to Web Programming Lecture 10: Extra Features and Website Design Part 1 Tarik Booker CS 120 California State University, Los Angeles.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
1 CS428 Web Engineering Lecture 07 Font, Text & Background (CSS - II)
HTML & CSS Contents: the different ways we can use to apply CSS to The HTML documents CSS Colors and Background CSS Fonts CSS Text CSS box model: padding,
Creating Web Documents CSS examples (do more later) Lab/Homework: Read chapters 15 & 16. Work on Project 3, do postings.
MORE Cascading Style Sheets (The Positioning Model)
Floating and Positioning
Presentation transcript:

Image Use

Agenda Ordinary display of image: height, width, alt Rollovers Images as links (remove blue surround) Background images: stretch, tile, xonly/yonly curved borders Typeface as gifs what else?

Displaying Images as Content Height and width are in pixels. There are about 70 pixels to the inch. If you don't specify height and width, the size is the true pixel size of the image

Displaying Images as Content The "alt" attribute is for people who can't see the image. These may be: –blind –using a browser which doesn't show images –Web crawlers Normally mousing over an image with alt text causes a tool tip to appear, containing the text.

Displaying Images as Content The xhtml can also contain attributes about the border and the alignment of images. Don't Use CSS instead: img { border-style: none}

Roll-overs A Rollover is an image which changes its appearance when you run a mouse over it. It is often used for image links It is done by having one image showing normally. When the mouse runs over it, the image is changed. Rollovers need JavaScript

Roll-overs Javascript is: A computing language which works in web pages. Not really part of this module Allows calculations, interactivity, drag-and- drop, rollovers, dynamic changes to pages without needing to refresh, stuff like that. JavaScript has NOTHING to do with Java.

Roll-overs (The JavaScript goes here)

Roll-overs function mouseOver() { document.getElementById("b1").src ="blue.gif"; } function mouseOut() { document.getElementById("b1").src ="pink.gif"; }

Roll-overs

Roll-overs One minor hiccup in the simple code I've just shown you is that the second image is only downloaded from the server when the mouseover event occurs. This may take time. The answer is to preload the image(s) when the page itself loads See next slide:

Roll-overs pic1= new Image(); pic1.src="pink.gif"; Put this code first in the section of the The name "pic1" is not significant - it just puts the image into the browser's cache for later reuse.

Roll-overs A far easier way: <img src="green.gif" alt="a rollover image" onmouseover="this.src='red.gif'" onmouseout="this.src='green.gif'" /> Note why there are two kinds of quotes

Roll-overs Preloading needn't use JavaScript at all. Below, an image is preloaded as though it is to be displayed, but CSS is used to stop it being seen:

Images as Links There are only two xhtml objects which may be used as links - text and images. Beware: people who can't see images will not understand the link. You must use a caption or an "alt" description. When you use an image as a link, you will get a blue border. Remove the border using CSS.

Images as Links </body.

Images as Links CSS: a img { border-style: none; }

Backgrounds You can set a colour as the background of a page or a div in a page. div.box3 { background-color: rgb(250,0,255); } This might be a good way of finding out where the damn thing is!

Backgrounds You can set an image as a background using the stylesheet: body { background-image: url(stars.gif); background-color: # }

Backgrounds The simple image background on the last slide will cause the image to "tile", ie repeat all over the designated area It may be better to use a background colour. Sometimes the image doesn't load or there are gaps

Backgrounds You can make the background image repeat, or not repeat, or only repeat in a certain direction: image-repeat: repeat; image-repeat: no-repeat; image-repeat: repeat-x; (-) image-repeat: repeat-y; (|)

Backgrounds Remember the problem with stylesheets, that the box is only as big as its contents? This is the problem that makes it difficult for the margin to reach the bottom of the page. Using repeat-y, you can use an image which looks like a margin and take it to the bottom of the page. (see demo)

Backgrounds div.backgrounds { width: 100%; margin: 0px 0px 0px 0px; padding: 0px; background-image: url(beige- edge.jpg); background-position: left; background-repeat: repeat-y; }

Typeface as GIFs Web pages can normally only display typefaces which exist on the client's computer. E.g.: p, a { font-size: 12pt; font-family: "times new roman", serif; }

Typeface as GIFs For example, your company trademark is in a special typeface which the public has learned to associate with your brand. What if you want a distinctive typeface? The solution is to make it into an image and use the image as your text:

What else?