AOS 452 Lab 4: HTML, CSS and Your Webpage

Similar documents
AOS Lab 4 HTML, CSS and Your Webpage

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

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

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

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

What is XHTML? XHTML is the language used to create and organize a web page:

CMPT 165 Unit 2 Markup Part 2

Html basics Course Outline

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

Attributes & Images 1 Create a new webpage

Beginning HTML. The Nuts and Bolts of building Web pages.

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

11. HTML5 and Future Web Application

introduction to XHTML

HTML & XHTML Tag Quick Reference

FIT 100 LAB Activity 3: Constructing HTML Documents

week8 Tommy MacWilliam week8 October 31, 2011

Dreamweaver Basics Outline

AOS 452 Lab 9 Handout Automated Plot Generation

Tutorial 1 Getting Started with HTML5. HTML, CSS, and Dynamic HTML 5 TH EDITION

Web Publishing Basics I

Creating A Web Page. Computer Concepts I and II. Sue Norris

CSC 121 Computers and Scientific Thinking

CHAPTER 2 MARKUP LANGUAGES: XHTML 1.0

CAS 111D: XHTML Tutorial

INTRODUCTION TO WEB USING HTML What is HTML?

Introduction to WEB PROGRAMMING

c122jan2714.notebook January 27, 2014

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

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

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

1. Please, please, please look at the style sheets job aid that I sent to you some time ago in conjunction with this document.

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

LAB 3 CSE 3, Spring 2018 In this lab you will learn and implement some basic html.

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

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?

CS 1124 Media computation. Lab 9.3 October 24, 2008 Steve Harrison

Introduction to Web Technologies

Web Design and Development ACS Chapter 3. Document Setup

Announcements. Paper due this Wednesday

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

1 Creating a simple HTML page

HTML/CSS Lesson Plans

How the Internet Works

Programmazione Web a.a. 2017/2018 HTML5

A Balanced Introduction to Computer Science, 3/E

HYPERTEXT MARKUP LANGUAGE ( HTML )

Introduction to Web Development

Creating Web Pages with SeaMonkey Composer

CSC Web Programming. Introduction to HTML

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

HTML and CSS: An Introduction

Adobe Dreamweaver CS5/6: Learning the Tools

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

UNIT 3 SECTION 1 Answer the following questions Q.1: What is an editor? editor editor Q.2: What do you understand by a web browser?

ADOBE Dreamweaver CS3 Basics

HTML TIPS FOR DESIGNING.

Title: Jan 29 11:03 AM (1 of 23) Note that I have now added color and some alignment to the middle and to the right on this example.

Adobe Dreamweaver CS5 Tutorial

Using Dreamweaver To Edit the Campus Template Version MX

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

HTML. LBSC 690: Jordan Boyd-Graber. October 1, LBSC 690: Jordan Boyd-Graber () HTML October 1, / 29

Shane Gellerman 10/17/11 LIS488 Assignment 3

ADOBE DREAMWEAVER CS4 BASICS

Lab 3. CSE 3, Summer 2010 In this lab you will learn and implement some basic html.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "

Creating Web Pages. Getting Started

Introduction to Computer Science (I1100) Internet. Chapter 7

Working with HTML. must appear at the very beginning of your webpage. starts the first section of your page

Joomla! 2.5.x Training Manual

Using Dreamweaver CS6

HTML MIS Konstantin Bauman. Department of MIS Fox School of Business Temple University

Islamic University of Gaza Faculty of Engineering Department of Computer Engineering ECOM Advanced Internet Technology Lab.

HTMLnotesS15.notebook. January 25, 2015

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

epromo Guidelines DUE DATES NOT ALLOWED PLAIN TEXT VERSION

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

Hyper Text Markup Language HTML: A Tutorial

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

The Structural Layer (Hypertext Markup Language) Webpage Design

CSI 3140 WWW Structures, Techniques and Standards. Markup Languages: XHTML 1.0

Lesson 1: Writing Your First JavaScript

Chapter 4 A Hypertext Markup Language Primer

1.0 Overview For content management, Joomla divides into some basic components: the Article

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

Introduction to HTML5

COPYRIGHTED MATERIAL. The Basics of HTML. What Is the World Wide Web?

Web Development & Design Foundations with XHTML. Chapter 2 Key Concepts

The internet is a worldwide collection of networks that link millions of computers. These links allow the computers to share and send data.

Web Page Creation Part I. CS27101 Introduction to Web Interface Design Prof. Angela Guercio

Page Layout Using Tables

HTML. Based mostly on

PART COPYRIGHTED MATERIAL. Getting Started LEARN TO: Understand HTML, its uses, and related tools. Create HTML documents. Link HTML documents

Adobe Dreamweaver CC 17 Tutorial

Chapter 2:- Introduction to XHTML. Compiled By:- Sanjay Patel Assistant Professor, SVBIT.

FileNET Guide for AHC PageMasters

Developing a Basic Web Page

Programming Lab 1 (JS Hwk 3) Due Thursday, April 28

I-5 Internet Applications

Intro to Microsoft Word

Transcription:

AOS 452 Lab 4: HTML, CSS and Your Webpage (October 2, 2007) 1 Tip of the Day: Although we are taking a break from GEMPAK today, you may find the following information handy. GEMPAK contains two commands, save and restore, that are used to save and recall parameter lists. For example, let s say you are running gdcntr and have it set up just right so that it produces a plot of 500 mb geopotential heights over North America. You could then type (at the GEMPAK prompt) save hght500 (or whatever you want to call it). At any point in the future, you could then type restore hght500 within gdcntr to restore the settings you saved, as long as you are working in the same directory in which you saved the settings. INTRODUCTION The influence of the Internet on today s society would be very difficult to understate. From its more secretive beginnings in the United States Department of Defense in the late 1960s, the Internet has grown into an entity that has revolutionized the way the world operates. The Internet took off in mainstream society in the mid 1990s with the advent of the World Wide Web (invented in 1989) and suitable Internet browsers (such as Netscape, first available in 1994) to view text and images posted online. Internet savvy is much desired in today s job market. One computer related skill that especially attracts employers is web page development. Web pages are generated from plain text files written in HyperText Markup Language, or HTML. There are many ways to create web pages and learn HTML. A multitude of point and click HTML editors are available that will allow even the most novice of computer users to create a web page. However, hackers agree that the worst way to learn HTML is to use one of these user friendly editors, which are prone to producing bloated, buggy, impossible to understand HTML. Instead, you will gain a fuller understanding of how web pages are constructed by getting your hands dirty with the raw HTML code. For your second weather discussion, you will be required to create a web page that contains links to information you wish to present to the class. (Including GEMPAK images you will create as tools for your weather discussion.) I urge you to do the same for your first weather discussion as practice. You will find that your discussion will be much more organized if you make effective use of your web page. The purpose of today s lab is to introduce you to the basics of HTML. At the end of this lab, you will be directed to online resources with which you can further your understanding of HTML. For those of you with experience using HTML, this lab should serve as a good refresher 1. For those of you first being exposed to HTML today, get ready to learn a skill that can be enjoyable to apply. HTML has steadily evolved through the years, and today it is widely recognized that the best way to organize web pages is to use two files per page. The first file is in HTML (or XHTML to be exact), and it contains that page s content. The second file is in CSS (Cascading Style Sheets), and it informs the browser how your content should be displayed. This distinction will become clearer as we go through the lab. Note also that the same CSS file can be applied to many different HTML files. 1 Note that this lab presents cutting edge HTML (i.e., XHTML+CSS), not your grandfather s HTML from 1999.

2 GETTING STARTED Space for your web pages has already been set aside on an AOS server. The first thing I would like you to do is start Firefox and type in the following URL 2 (Universal Resource Locator, i.e., web address ): http://www.aos.wisc.edu/~your_username For instance, my web page is found here: http://www.aos.wisc.edu/~aalopez (for the purposes of this lab you will want to use http://www.aos.wisc.edu/~aalopez/452.html as a guide) If you have not worked on your AOS provided web page, many of you should see some text describing how to send mail to you. Other may see a message about the location not being found. Soon your own web page will be found at this location. Check to see if you have a subdirectory called public_html in your home directory. If no such directory exists, then type the following at the prompt: mkdir public_html Now move to this new directory by entering the following: cd public_html The HTML code that controls the content you see (or will see) on your homepage will be found in a file called index.html. If your public_html directory already existed, you may find the index.html file in that directory. If you just made the public_html directory, then you will be creating the index.html file. You will be building your web page using raw HTML and CSS code written in files created in a text editor. On the Room 1411 workstations, you can use the text editor nedit to create and edit the HTML and CSS files. (The text editors vi and emacs are also available). Open nedit. Once you have a text box type in the following: <!DOCTYPE html PUBLIC " //W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/tr/xhtml1/dtd/xhtml1 strict.dtd"> <html> <head> <title>enter the title of your page here</title> <link rel= stylesheet type= text/css href= practice.css /> </head> <body> </body> </html> 2 Some folks use the acronym URI, for Universal Resource Identifier.

The text above is a template containing the HTML code that is needed for every web page you create 3. Save this file as index.html. If you are asked to overwrite a pre existing file, just click OK. (If you already have a web page created on your AOS provided site, then ignore the above instructions and save the file to some other.html location!) 3 THE BASIC STRUCTURE OF AN HTML FILE In the template you created, you see text like <html> and <head>. These pieces of text are referred to as tags. Two types of tags exist, container tags and empty tags. Container tags have a starting tag and a closing tag, and tell the web browser something about all of the text in between them. To make a closing tag, just add a forward slash (/) to the starting tag. For example <html> is a container tag (closed by </html>) that tells the browser that everything contained within that tag is in fact HTML. Empty tags, the second type, are distinguished by the fact that they do not have closing tags. They tell the browser to do something at one spot only. Empty tags have the format <tag />. Later in the lab, you will learn about attributes. Attributes go inside starting and empty tags and tell the browser additional information about those tags. According to the latest standard, HTML tags must be lowercase. HTML tag The <html> tags tell the browser that the text between the tags is going to be part of an HTML document. HEAD and TITLE tags Everything located between the <head> and </head> tags will not actually show up on your web page. The main purpose of these tags is to provide information about your web page, such as a title. You can define a title for your web page by entering text between the <title> and </title> tags. BODY tag Everything that you want to appear in the browser display window must be contained within the <body> tags. In addition, you can specify a background color or image as a CSS property applied to the <body> tag. You can find information on how to specify a background color or image in the tutorial to which I will refer you at the end of this lab. 3 Strictly speaking, lines 1 and 2 are not necessary; however, they will be needed to validate your HTML, described later. Line 6 is only necessary if you wish to apply CSS (practice.css in this example) to your HTML.

ENTERING AND FORMATTING TEXT 4 It is very easy to include text in your web page. All text that you want to appear in your web page must be located inside the <body> tags. One important point to remember is that by default, browsers do not recognize extra spaces or carriage returns in the HTML document. However, you can use the following HTML code to control space and carriage return formatting in your web page: Means space to the browser <br /> Line break (essentially what RETURN does in a word processor) <p></p> The paragraph tag isolates the block of text. These tags should enclose much of your regular web text. <pre></pre> Text will appear in the browser as shown in the HTML document CSS provides much greater control over text formatting, see the tutorial on the webpage at the end of the lab. Edit index.html to look like the following: <!DOCTYPE html PUBLIC " //W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/tr/xhtml1/dtd/xhtml1 strict.dtd"> <html> <head> <title>my AOS 452 web page</title> <link rel= stylesheet type= text/css href= practice.css /> </head> <body> <p>welcome to my AOS 452 web page! I will be using a web page for my second map discussion.</p> </body> </html> Save the changes to the HTML document. Reload the web page to see the changes. Experiment with the other space and carriage return formatting tags. Text styles It is easy to add text styles. Text styles that you might use are listed below: <strong></strong> <em></em> Bold (usually) Italic (usually) For example, you could have all of your text in your web page in bold letters: <p><strong> Welcome to my AOS 452 web page! I will be using a web page for my second map discussion. </strong></p>

5 Other tags, like <u></u> for underlining, are considered obsolete. CSS should be used instead. CSS also provides the means through which you can apply additional styles, change colors, use different fonts, etc. INSERTING IMAGES Images can be added to your web page by using the empty tag <img />. In the <img /> tag, you must specify the source of the image using the src attribute. For instance: <img src= tornado.gif /> The browser will place the image where it would normally place the next piece of text. Be sure to enclose the image name in double quotes (src is an attribute). Here are some other attributes that can be used with the <img /> tag: height width alt title Contols the height of the image Controls the width of the image Substitute for the image when the user is using a browser that is not displaying images. This attribute is required by the HTML specification! In modern browsers, the value of title often appears next to the mouse arrow when the arrow is over the image. Here is an example that uses these attributes: <img src= tornado.gif height= 300 width= 300 alt= F5 title= Big Tornado /> The image tornado.gif will have a size of 300 x 300. If you move the mouse cursor over the image, Big Tornado may appear in a little box next to the cursor. If you ve disabled images in your browser, F5 will appear where the image would have been. The original image may have different dimensions than the values given above, so changing the height and width attribute could distort your image. The appearance of your image also depends on the monitor resolution. NOTE: The src attribute specifies not only what image, but also the location of the image. The above source, tornado.gif, will tell the browser to look for the image tornado.gif in the same directory as the HTML document itself. If the image is in another location (a different directory on your account, another web page), you will need to adjust the src attribute value accordingly (full pathname or web address). The online tutorial will provide more information on this issue. ANOTHER NOTE: UNIX is case sensitive with regard to filenames. For example, take the following three filenames: lab10.gif, LAB10.GIF, Lab10.gif. UNIX treats these as three distinct filenames, whereas a Windows based server would consider these the same filename. To avoid this case problem, I recommend using lower case letters for filenames. STILL ANOTHER NOTE: The UNIX command file will tell you the size of an image, e.g. file tornado.gif <Enter>

INSERTING LINKS 6 One of the best features of web pages is the ability to link to images and other pages within or outside your web page. Links are contained within the <a> tags. You can choose to add text links or graphical links to your web page. Text link The following is the general format for adding a text link: <a href= URL >Text describing the link</a> Let s say you wanted to insert a text link to the National Weather Service s website. You would enter something like the following: <a href= http://www.nws.noaa.gov/ >National Weather Service homepage</a> Graphical link The following is the general format for adding a graphical link: <a href= URL ><img src= graphic.gif alt= /></a> Let s say you have a GIF image of Bucky Badger in the same directory as the HTML document. You want to use the image as a link to the UW Madison homepage. You would enter something like this: <a href= http://www.wisc.edu/ ><img src= bucky.gif alt= /></a> TABLES Tables can greatly enhance the appearance and organization of your web page. As with other basic features of web pages, tables are relatively easy to create. The creation of tables only involves (at minimum) three tags: <table>, </table> The main <table> tags. <tr>, </tr> The Table Row tag defines a horizontal row of cells <td>, </td> The Table Data tag specifies an individual cell in a table row A template of a table composed of one row with two cells is given below: <table> <tr> </tr> </table> <td>cell 1</td> <td>cell 2</td>

MISCELLANEOUS INFORMATION 7 Comments can be added to the HTML document by placing text between the starting tag <! and the ending tag > Example: <!DOCTYPE html PUBLIC " //W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/tr/xhtml1/dtd/xhtml1 strict.dtd"> <html> <head> <title>aos 452 homepage</title> <link rel= stylesheet type= text/css href= web.css /> </head> <body> <p>making web pages is fun!</p> <! Hi Mom! I made my first web page! > </body> </html> Making web pages is fun! would appear on the screen, but Hi Mom! I made my first web page! would not. After you edit and save your HTML document, or any CSS being applied to your HTML document, you can view the changes by clicking the RELOAD (or REFRESH) button on your browser. If your page does not update, you can force the browser to update by holding down the SHIFT key and clicking on the RELOAD (or REFRESH) button. You can view the HTML code for a web page by using the View Page Source option on the browser. You can find this option under the View menu in most web browsers. You can check that your HTML is free of bugs by using the following validation service: http://validator.w3.org Enter your URL in the address form, and if everything is OK, it will tell you that you have valid HTML code. If not, it will tell you what s wrong. Note that the first error may lead to spurious errors later in your HTML. My advice is to fix the first error first, revalidate, and if necessary, repeat the process. Once you know your HTML is correct, you can use a similar process to validate your CSS at: http://jigsaw.w3.org/css validator/ A complete HTML reference can be found at http://www.w3schools.com/xhtml/xhtml_reference.asp

HTML DOG 8 One of the better HTML tutorials online is available from HTML Dog. Upon successful completion of the tutorial, you will have the basic skills necessary to create a quality web page. The tutorial is done with humor, which only enhances the tutorial s quality. You will find the tutorial at the following URL: http://www.htmldog.com If you click on the HTML Beginner s Guide link, you will be taken to the first page of the basic HTML tutorial. All of the tutorials available to you can be found along the left side of the page. Work through these four tutorials in this order: 1) HTML Beginner, 2) CSS Beginner, 3) HTML Intermediate, 4) CSS Intermediate You need not worry about the Forms or Javascript sections.