Attributes & Images 1 Create a new webpage

Similar documents
Adding Audio and Video Content to Web pages. Audio Content - Add some Audio content to your page. Audio & Video 1

Introduction, Notepad++, File Structure, 9 Tags, Hyperlinks 1

Unit 2 - HTML Formatting

HTML. Mohammed Alhessi M.Sc. Geomatics Engineering. Internet GIS Technologies كلية اآلداب - قسم الجغرافيا نظم المعلومات الجغرافية

HTML Exercise 20 Linking Pictures To Other Documents Or Web Sites

The Text Editor appears in many locations throughout Blackboard Learn and is used to format text. For example, you can use it to:

Unit 5 Web Publishing Systems Page 1 of 13 Part 4 HTML Part 4

INTRODUCTION TO WEB USING HTML What is HTML?

Using Adobe Contribute 4 A guide for new website authors

Web Design 101. What is HTML? HTML Tags. Web Browsers. <!DOCTYPE html> <html> <body> <h1>my First Heading</h1> <p>my first paragraph.

recall: a Web page is a text document that contains additional formatting information in the HyperText Markup Language (HTML)

NVU Web Authoring System

Creating Web Pages Using Netscape Composer AGENDA FOR THIS WORKSHOP. 1. How does it all work? 2. What do I need to get started at Fairfield?

CSC 121 Computers and Scientific Thinking

Skill Area 323: Design and Develop Website. Multimedia and Web Design (MWD)

How to lay out a web page with CSS

Web Designing HTML5 NOTES

Nauticom NetEditor: A How-to Guide

HTML. Hypertext Markup Language. Code used to create web pages

A Balanced Introduction to Computer Science, 3/E

HTML/CSS Lesson Plans

CSCE 101. Creating Web Pages with HTML5 Applying style with CSS

Your Own Web Page; Quick and Dirty Via Mashup Reminder: Next Quiz on 4/15

AOS Lab 4 HTML, CSS and Your Webpage

Using Dreamweaver CS6

Chapter 3 Web Design & HTML. Web Design Class Mrs. Johnson

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

Lesson 5 Introduction to Cascading Style Sheets

STD 7 th Paper 1 FA 4

The City School. Prep Section. ICTech. 2 nd Term. PAF Chapter. Class 8. Worksheets for Intervention Classes

The City School. Prep Section. ICTech. 2 nd Term. PAF Chapter. Class 7. Worksheets for Intervention Classes

ADOBE Dreamweaver CS3 Basics

DREAMWEAVER QUICK START TABLE OF CONTENT

Creating Web Pages with SeaMonkey Composer

HTML OBJECTIVES WHAT IS HTML? BY FAITH BRENNER AN INTRODUCTION

Revision for Grade 7 ASP in Unit :1&2 Design & Technology Subject

A Dreamweaver Tutorial. Contents Page

CSS means Cascading Style Sheets. It is used to style HTML documents.

This document provides a concise, introductory lesson in HTML formatting.

CSCI 1100L: Topics in Computing Spring 2018 Web Page Project 50 points

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

Exploring Computer Science Web Final - Website

AOS 452 Lab 4: HTML, CSS and Your Webpage

request HTML Document send HTML Document

1. The basic building block of an HTML document is called a(n) a. tag. b. element. c. attribute. d. container. Answer: b Page 5

All Creative Designs. Basic HTML for PC Tutorial Part 1 Using MS Notepad (Version May 2013) My First Web Page

Electronic Portfolios in the Classroom

HTML Text Formatting. HTML Session 2 2

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

CSC Web Programming. Introduction to HTML

8/19/2018. Web Development & Design Foundations with HTML5. Learning Objectives (1 of 2) More on Relative Linking. Learning Objectives (2 of 2)

A Frontpage Tutorial. Contents Page

HTML Exercise 21 Making Simple Rectangular Buttons

A HTML document has two sections 1) HEAD section and 2) BODY section A HTML file is saved with.html or.htm extension

Lesson 1 HTML Basics. The Creative Computer Lab. creativecomputerlab.com

Using Dreamweaver To Edit the Campus Template Version MX

How to use the Molecular Workbench (MW) authoring environment to modify an existing activity.

Microsoft Expression Web Quickstart Guide

Beginners Guide to Snippet Master PRO

Before you begin, make sure you have the images for these exercises saved in the location where you intend to create the Nuklear Family Website.

Do It Yourself Website Editing Training Guide

Lava New Media s CMS. Documentation Page 1

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

CS Multimedia and Communications REMEMBER TO BRING YOUR MEMORY STICK TO EVERY LAB!

ADOBE DREAMWEAVER CS4 BASICS

Website Creating Content

Tutorial 4. Activities. Code o Editor: Expression Web o Focus : Base Layout, navigation with folders, external stylesheets, Open up Expression Web

Blackboard staff how to guide Accessible Course Design

INTRODUCTION TO HTML5! HTML5 Page Structure!

Programmazione Web a.a. 2017/2018 HTML5

CS 1100: Web Development: Client Side Coding / Fall 2016 Lab 2: More HTML and CSS

Lecturer. Haider M. Habeeb. Second Year, First Course

CMT111-01/M1: HTML & Dreamweaver. Creating an HTML Document

Geocaching HTML & BBCode FUNdamentals by Scott Aleckson (SSO JOAT)

Where to get Images.

Table of Contents. MySource Matrix Content Types Manual

Objective % Select and utilize tools to design and develop websites.

CS Multimedia and Communications. Lab 06: Webpage Tables and Image Links (Website Design part 3 of 3)

CiDA Certificate in Digital Applications

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

AGENDA :: MULTIMEDIA TOOLS :: CLASS NOTES

Creating a Website in Schoolwires

Introduction to Computer Science (I1100) Internet. Chapter 7

Dreamweaver CS 5.5. University Information Technology Services. Training, Outreach, Learning Technologies, and Video Production

Insert/Edit Image. Overview

Chapter 1 Getting Started with HTML 5 1. Chapter 2 Introduction to New Elements in HTML 5 21

Making use of other Applications

Fonts, text, and colour on the web. Sourcing, resizing, and inserting web site images MGMT 230 LAB

ORB Education Quality Teaching Resources

Cropping an Image for the Web

Dreamweaver Basics. Planning your website Organize site structure Plan site design & navigation Gather your assets

HTML Exercise 24 Tables

Introduction to using HTML to design webpages

FrontPage 98 Quick Guide. Copyright 2000 Peter Pappas. edteck press All rights reserved.

Using Dreamweaver CC. Logo. 4 Creating a Template. Page Heading. Page content in this area. About Us Gallery Ordering Contact Us Links

Web-Friendly Sites. Planning & Design 1

By Ryan Stevenson. Guidebook #2 HTML

HTML TUTORIAL ONE. Understanding What XHTML is Not

CMPT 165 Unit 2 Markup Part 2

Scientific Communication CITS4008. Designing and Writing Web Pages Rachel Cardell-Oliver 2013 Based on notes by Robyn Owens

Transcription:

Attributes & Images 1 Create a new webpage Open your test page. Use the Save as instructions from the last activity to save your test page as 4Attributes.html and make the following changes: <!DOCTYPE html> <html> <head> <title>attributes & Images</title> </head> <body> <a href="1index.html" >Back to Home Page </a> <h1>attributes & Images</h1> <a href="1index.html" >Back to Home Page </a> <br> </body> </html> All content from this unit should be placed in the new page you just created (4Attributes.html). Unit 4 HTML Attributes: What they are and How to use them HTML attributes can be added to HTML elements to provide further information about that element. We used attributes in the Horizontal rule activity earlier. HTML tags can contain one or more attributes. Attributes are added to a tag to provide the browser with more information about how the tag should appear or behave. Attributes consist of a name and a value separated by an equals (=) sign.

Attributes & Images 2 Consider this example: Abbr is the opening tag for the abbreviation element (remember the element is all of the information from opening to closing tag). title is an attibute of the abbr element Hypertext Markup Language is the Value for the title attribute. HTML is the display text. this is the text that will display on the webpage screen notice it is in between the > < brackets but still enclosed in the whole tag (before the closing tag). </abbr> is the closing tag for this element. <abbr title="hypertext Markup Language">HTML</abbr><br><br> Place the <abbr> code above at line 8 in your new web page (just below your H1 title). Now Launch your webpage in Chrome. You should see an HTML displayed on your webpage, and when you hover over it with your mouse it should provide a tooltip that reads Hypertext Markup Language. (the <br> tags just ensure some space between the abbr and the link home). This example uses the <abbr> tag, which is used to indicate an abbreviation. But something extra has been added to the tag an attribute. This particular attribute (the title attribute) provides a title for the element. The name of the attribute is title. In this example, we've given it a value of Hypertext Markup Language. The title attribute can be used on any HTML element to provide extra information about the element's contents. When used with the <abbr> tag, it allows us to provide an expansion of the abbreviation or acronym (i.e. we can say what the acronymn stands for). When using the title attribute, most browsers will display its value as a "tooltip" when the user hovers over the element. More Attributes - Size Attributes HTML images are defined with the <img> tag. The filename of the source (src), and the size of the image (width and height) are all provided as attributes: img is an element, but it is an empty element as it is only for displaying an image.

Attributes & Images 3 Src means the Source of the image. It is an attribute of img images/practice1.jpg is the value for src (this is the name and location of the file) <img src="images/practice1.jpg" width="100" height="100" /img> Width and height are also attributes of img Closing Tag 100 is the value in pixels for width and height. If you have not already done this, Go to the Student shared drive BBT9 HTML5 folder and copy the entire folder into your Practice folder. This folder also needs to contain all your.html source files (Index, Elements, Lists, Attributes ). A Note about File structure in HTML When coding in HTML it is important that you keep all your files in a neat and organized manner and that all files used in the website are located in the same folder. Html pages cannot look outside their main folder for content to display on the page. For example: The source HTML document (Index.html) needs to be inside the main folder (Practice). Index.html Likewise any images, media and backgrounds need to be either in the main HTML folder (Practice), or a folder inside the main HTML folder. If you want to use an image or other content from some other folder it needs to be copied into one of the folders in the main HTML folder Your source page cannot look outside the main folder (Practice). **Show your teacher your file folder showing your Main folder named Practice and the files and folders inside it that look like the picture above and have them mark your Activity sheet at #8

Attributes & Images 4 Then type the highlighted code below into your 4Attributes.html above the closing body tag (</body>). <h2>working with Images</h2> <img src="images/practice1.jpg" width="100" height="100"></img> Copy and paste the img code again. Save and refresh your page. Do you notice that you have 2 pictures on the same line. How could you put them on separate lines? Try adding a couple of <br> tags at the end of each image line: <img src="images/practice1.jpg" width="100" height="100"></img><br><br> Insert the flamingo1.jpg picture below this image in your HTML editor. <img src="images/flamingo1.jpg"> </img><br><br> You will notice the picture is too large so lets change the code to have width and height to make the picture smaller: <img src="images/flamingo1.jpg"width="100" height="133"></img><br><br> Save your code and launch the website in Chrome. What is the difference between the two pictures? **NB: it should be noted that the size attribute for images does not change the file size of the image, only the size it will appear on the webpage. The image size is specified in pixels: width="100" means 100 screen pixels wide. If the file size is large it may be a good idea to make it smaller so the page loads more quickly. This can be easily accomplished using MS Paint. Resizing Image file size: Open Paint, then open the flamingo1.jpg file in your HTML folder Select the resize button and ensure the Percentage button is selected and the Maintain Aspect Ratio box is selected. Then change the 100 in the Horizontal box to 10. Now select the Pixels button and change the Horizontal number to 100. This will change the Vertical to 133 because we have selected the Maintain aspect ratio box. This is the information we need to set the width and height of the picture in our img tag.

Attributes & Images 5 Now select the OK button, then choose File and Save as, select the JPEG option and save the file as flamingo2.jpg (save this in the images folder inside your Practice folder) and close the Paint program. Next, navigate to your practice/images folder and compare the file sizes of both Flamingo1.jpg and flamingo2.jpg. You will notice that Flamingo2.jpg is much smaller than its original. In this case the original file size is not that large, however, the point is that the more and the larger the files that a browser needs to download the slower the browser will be. You can use this process with any picture or drawing to decrease file size. Now let s change the code to use our smaller sized picture. Change the file name to Flamingo2.jpg, so your code should look like this: <img src="images/flamingo2.jpg" width="100" height="133"></img><br><br> More about images (the alt attribute) The <img> tag is written as <img src="" alt=""></img> with the image file name and location (or URL) inserted between the double quotes of the src attribute. The alt attribute provides alternative text for users who are unable to view the image. Some reasons why users can't view the image might include having a slow Internet connection, they are vision impaired and are using text-to-speech software, the image won't load for some reason, etc. Note that the alt attribute is a required attribute for all image files. Like this: <img src="images/myimage.jpg" alt="my Image"> You can also provide the image dimensions using the width and height attributes. <img src="images/myimage.jpg" alt="my Image" width="100px" height="50px"></img> Go back to all your image codes and place an alt attribute in all the codes like this: <img src="images/practice1.jpg" alt="flower" width="100" height="100"></img><br><br> And <img src="images/flamingo2.jpg" alt="flamingo" width="100" height="133"></img><br><br>

Attributes & Images 6 **NB: not all browsers will show the alt text on screen. IE for example will not show the text if the picture works, so if you want the viewer to see the text while the file is opening it is acceptable to also place a title attribute in the tag, like this: <img src="images/flamingo1.jpg" alt="flamingo" title="flamingo" width="100" height="133"></img><br><br> Save your code and launch the website in Chrome. What is the difference between what you typed and how the browser displays the text? Why is that? What happens when you mouse over the picture? Centering your images The correct method to center an image is to use the CSS display property with a value of block and a margin property with a value of 0 (zero). Type this code below your last flamingo picture: <img src="images/flamingo2.jpg" alt="flamingo" title="flamingo" width="100" height="133" style="display:block; margin:0 auto"></img><br><br> Multiple Attributes You can add more than one attribute to a given element. Here's an example of adding two attributes to the <a> element (which is used for creating a hyperlink to another web page). Type this code below your flamingo img code and before the closing body tag. <a href="https://grade9bbt.weebly.com" title="best grade 9 BBT tutorials on the web!">bbt Weeblysite</a> <br><hr><br> <!--this is just for a thematic break between the images and aligning Images (Unit 6)--> The href attribute specifies the location of the web page that we're linking to. We also use the title attribute to provide some advisory text (a tool tip for mousing over). Save and refresh your page and hover your mouse over the grade9weebly link. You should see a tool tip. (Show your teacher your images: separate lines, one centered, and a link with a tool tip - Do this on your Activity sheet at # 9

Attributes & Images 7 More Attributes There are many different attributes available to HTML elements. Some attributes can be used on every HTML element some are available on many (but not all) elements, while other attributes are only available on one specific element. Many HTML elements assign a default value to its attributes meaning that, if you don't include that attribute, a value will be assigned anyway. Having said that, some HTML tags do require an attribute (such as the hyperlink example above). (full list here: https://www.quackit.com/html_5/tags/html_5_global_attributes.cfm What you have learned so far: Some HTML elements can have attributes The pattern for an attribute is attribute="value" Attributes provide additional information about an element Attributes are always specified in the start tag Attributes require quotation marks, this also makes it easier to check code at a future date. Multiple attributes can be used inside a tag or element. How to center an image on the browser. *Activity 4 Name the parts: (Do this on your Activity sheet at # 10) 1 2 3 4 5 6 7 <a href="https://grade9bbt.wikispaces.com" title="best tutorials on the web!">bbt Wikisite</a> Use the possible answers below and place the correct letter in the activity sheet blank. A. Opening tag B. Closing Tag C. Attribute D. Value E. Display text F. Element See example on Page 2 for assistance in answering this question Next Lesson: Styles: Centering, Backgrounds, Borders, and Fonts