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

Similar documents
CSC 121 Computers and Scientific Thinking

c122jan2714.notebook January 27, 2014

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

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

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

A Balanced Introduction to Computer Science, 3/E

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

CHAPTER 1: GETTING STARTED WITH HTML CREATED BY L. ASMA RIKLI (ADAPTED FROM HTML, CSS, AND DYNAMIC HTML BY CAREY)

Introduction to Web Development

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

Html basics Course Outline

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

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

HTML Hyper Text Markup Language

INTRODUCTION TO HTML5! HTML5 Page Structure!

Programmazione Web a.a. 2017/2018 HTML5

Web Design and Application Development

Dreamweaver CS6. Level 1. Topics Workspaces Basic HTML Basic CSS

Management Information Systems

Web Publishing Basics I

Very Basics of HTML. G day mates during this tutorial I will teach you the basics of HTML.

BASICS OF WEB DESIGN CHAPTER 2 HTML BASICS KEY CONCEPTS

The Structure of the Web. Jim and Matthew

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

More about HTML. Digging in a little deeper

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

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

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

Desire2Learn: HTML Basics

INTRODUCTION TO WEB USING HTML What is 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

Tutorial 2 - HTML basics

Basics of Web Design, 3 rd Edition Instructor Materials Chapter 2 Test Bank

A Brief Introduction to HTML

It is possible to create webpages without knowing anything about the HTML source behind the page.

Tutorial. Activities. Code o o. Editor: Notepad Focus : Text manipulation & webpage skeleton. Open Notepad

CSC 101: Lab #1 HTML and the WWW Lab Date: Tuesday, 1/26/2010 Report Due Date: Friday, 1/29/2010 3:00pm

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

On a blog, code can mean many things. It can refer to the complicated

Announcements. Paper due this Wednesday

Developing a Basic Web Page

Guidelines for doing the short exercises

Title: Sep 12 10:58 AM (1 of 38)

FIT 100 LAB Activity 3: Constructing HTML Documents

HTML and CSS: An Introduction

Downloads: Google Chrome Browser (Free) - Adobe Brackets (Free) -

Bok, Jong Soon

Web Designing HTML5 NOTES

Creating and Building Websites

AOS Lab 4 HTML, CSS and Your Webpage

Dreamweaver Primer. Using Dreamweaver to Create and Publish Simple Web Pages. Mark Branom, Stanford University, Continuing Studies June 2011

Training Sister Hicks

CREATING A WEBSITE USING CSS. Mrs. Procopio CTEC6 MYP1

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

MMGD0204 Web Application Technologies. Chapter 3 HTML - TEXT FORMATTING

DREAMWEAVER QUICK START TABLE OF CONTENT

What is a web site? Web editors Introduction to HTML (Hyper Text Markup Language)

Animation and style sheets

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

Beginning Web Site Design

Figure 1 Properties panel, HTML mode

Beginning HTML. A tag is a command written between angle brackets (the less than and greater than symbols). Ex. <html>

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?

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

Web Design and Development ACS Chapter 3. Document Setup

Creating And Publishing A Webpage

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

How the Internet Works

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

Creating And Publishing A Webpage. You will learn the basic html tags for formatting a webpage as well including internal and external content

CSE 3. Marking Up with HTML. Comics Updates Shortcut(s)/Tip(s) of the Day Google Earth/Google Maps ssh Anti-Spyware

Using Dreamweaver CC. 6 Styles in Websites. Exercise 1 Linked Styles vs Embedded Styles

In this project, you ll learn how to create a webpage for your favourite recipe.

Adobe Dreamweaver CS5/6: Learning the Tools

RICH ENTERPRISES. Small Business Series. Getting Started with HTML

Chapter 4 A Hypertext Markup Language Primer

--- stands for the horizontal line.

By Ryan Stevenson. Guidebook #2 HTML

11. HTML5 and Future Web Application

HTML4 TUTORIAL PART 2

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

UNIT -II. Language-History and Versions Introduction JavaScript in Perspective-

introduction to XHTML

AOS 452 Lab 4: HTML, CSS and Your Webpage

5/17/2009. Marking Up with HTML. An HTML Web Page File. Tags for Bold, Italic, and underline. Structuring Documents

Introduction to using HTML to design webpages

c122sep814.notebook September 08, 2014 All assignments should be sent to Backup please send a cc to this address

Web Development & Design Foundations with HTML5 & CSS3 Instructor Materials Chapter 2 Test Bank

STD 7 th Paper 1 FA 4

Seema Sirpal Delhi University Computer Centre

HTML TAG SUMMARY HTML REFERENCE 18 TAG/ATTRIBUTE DESCRIPTION PAGE REFERENCES TAG/ATTRIBUTE DESCRIPTION PAGE REFERENCES MOST TAGS

Basic HTML Handout & Exercise Web Technology

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

HTML = hyper text markup language

Introduction to Computers and Their Applications

Review Ch. 17 Creating Online Pages and Sites. 2010, 2006 South-Western, Cengage Learning

Diploma in Mobile App Development Part I

Introduction to HTML

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

CSS BASICS. selector { property: value; }

Transcription:

Tip Sheet This document provides a concise, introductory lesson in HTML formatting. Introduction to HTML In their simplest form, web pages contain plain text and formatting tags. The formatting tags are a programming or scripting language called hyper-text markup language or HTML. The files for HTML pages are given the.htm or.html extensions and are simply known as HTML files. Browsers know how to read and interpret HTML files (as well as other formats not covered in this document). If an HTML page does not contain certain formatting tags, browsers can still interpret the pages using default settings and substitutions. For example, the file shown in Figure 1 is a simple text (.txt) file that has its extension changed to.htm so a browser can read it. There is no markup whatsoever: Figure 1: Absolutely no mark a simple sentence in a text editor If you open it in Internet Explorer 7, the file in Figure 1 produces the page in Figure 2: Figure 2: The simple sentence as seen in Internet Explorer 7 The same file as it appears in Firefox (Figure 3) and Opera (Figure 4): WB_HTMLPrimer_TS_AL, 001.1 1

Figure 3: The simple sentence as seen in Firefox 3 Figure 4: The simple sentence as seen in Opera 10 From now on, we ll just use Internet Explorer 7 for the examples. HTML Tags Tags are HTML code that dictates how a browser should interpret the associated text. The text is surrounded by a tag. Here is how it works: Tags are enclosed in angle brackets: < >. All tags are matching sets: they include a beginning marker and an end marker. The starting marker turns the feature on and the ending marker turns the feature off. Beginning markers contain an element. Elements may be followed by an attribute, then an equal sign, then a value. End markers contain a slash followed by the beginning marker s element. Let s suppose, for example, that you want to make some text in a line larger than the surrounding text. Assume the text is set at size 2 (don t worry about what that means). The original text is shown below: The big, red dog was a very big dog. Now you insert a tag to increase the font size of a couple of words: The big, red dog was a <font size=3>very big</font> dog. As you can see, the tag is made up of a beginning (font) and an end (/font). A browser knows that it should do something to the text that is in between those markers; in this example, make the words very big size 3. The element is font, the attribute is size, and the value is 3. 2 HTML Tip Sheet

HTML5, CSS3 Now let s add some important tags for defining an HTML page to the.htm file in Figure 1. The next screen shot, Figure 5, shows how it looks in a text editor: Figure 5: File-defining tags, but still no markup for the sentence (Again, don t worry about what they mean.) The HTML document codes contained in the head tag do affect the way the page is displayed, but nothing changes for our sentence because the sentence itself is not tagged. Figure 6 shows you how the page is displayed: Figure 6: The result as seen in Internet Explorer 7 As you can see, the title tag in Figure 5 created a title for the page (compare the tab in Figure 6 with the tab in Figure 2 on page 1). Danger, Will Robinson! Danger! In general, you will only work with tags & text that fall between <body> and </body>. Do not change any other lines of code for example, between <head> and </head> in the KB articles generated by Technical Publications. Now let s add a basic tag, the p tag (for paragraph ), to the sentence. Figure 7 shows you the HTML code: WB_HTMLPrimer_TS_AL, 001.1 3

Figure 7: The sentence with a simple p tag Figure 8 shows you how the page is displayed: Figure 8: The result as seen in Internet Explorer 7 Doesn t look much different, right? That s because nothing has been defined to make the page s basic paragraph different from a default browser paragraph. Now let s add a bold tag to text within a paragraph in an additional sentence. Figure 9 shows you the HTML code: Figure 9: Using a bold tag within a paragraph Figure 10 shows you how the page is displayed: 4 HTML Tip Sheet

HTML5, CSS3 Figure 10: The result as seen in Internet Explorer 7 Now we ll add a heading to the page and see what the browser does. A first-level heading uses the h1 tag (for heading 1 ). Figure 11 shows you the added code: Figure 11: The sentence with an added h1 tag Figure 12 shows you how the page is displayed: Figure 12: The result as seen in Internet Explorer 7 As you can see in Figure 12, a browser has default formatting for an h1 tag that is different from the p tag s default formatting. Also, the font and i tags affect the entire look of the second sentence. WB_HTMLPrimer_TS_AL, 001.1 5

Let There Be Space Empty lines in an HTML file are not interpreted by browsers as extra space between paragraphs. Use extra lines between your lines of code to make them more readable; they won t add empty space on the web page. The list below contains some of the basic and most useful HTML tags. Remember that each one is a beginning marker; always close them with the matching ending marker: <h1>, <h2>, <h3>... <h6>: Use for up to six levels of headings. <p>: Use for paragraphs, otherwise known as body text. The p tag is a similar concept to the Normal style in Microsoft Word. <b>: Use for bold text. <i>: Use for italicized text. <br>: Use to force a line break within a paragraph. <ul>: Use to enclose an unordered list. List items within this tag have bullets. <ol>: Use to enclose an ordered list. List items within this tag have numbers or letters. <li>: Use for a list item within a list, whether it s a ul or ol list. <hr>: Use to draw a horizontal line across the page. Cascading Style Sheets As you can see in Figure 12, you can change the way entire paragraphs look in a browser by using formatting tags. But what if you had several pages? What if you wanted to change the way an h2 heading looked on each of those pages? You would have to edit every single page. You d also have to ensure every h2 heading on every page has the same formatting tags in order to be consistent. The problem of changing so many tags is solved by a cascading style sheet (CSS). The style sheet contains the attributes that affect formatting; the pages contain the data (your text with paragraph and list tags only). For example, if you want to change the way an h2 tag looks in all of your pages, you modify the CSS file only not every single page. The tags you use when you associate your page to a cascading style sheet (CSS) are not different from regular HTML tags; they just use attributes you cannot use with simple HTML. 6 HTML Tip Sheet

HTML5, CSS3 Note This document does not cover how to create a style sheet. One has already been created for the Technical Publications KB articles. But, you need to recognize and use some of the tags & attributes associated with the style sheet. Now back to our program... Continuing with our example, let s add some new tags to the top of our page. In particular, the link tag on line 6 of Figure 13 ties this page to a CSS file that affects the formatting of this page: Figure 13: Attaching the page to a cascading style sheet Figure 14 shows you how the page is displayed: Figure 14: The result as seen in Internet Explorer 7 WB_HTMLPrimer_TS_AL, 001.1 7

As you can see in Figure 14, the style sheet has changed the look of the page in Figure 12 on page 5: The h1 heading is centered, is a different color, and uses a different font. The p paragraph uses a different font. The background color of the page is different. All these changes were a result of associating the page to the style sheet. Modifications to the CSS automatically and immediately affects all its associated pages. CSS Classes Because of the formatting definitions in the style sheet, you use a different attribute in the tags on your HTML page. It is the class attribute. The class attribute allows you to define different types of paragraphs. You can have two types of h1 headings, or 10 different types of p paragraphs. Each type of paragraph is named in the style sheet; each class attribute indicates the name in the HTML page. Continuing with our example, let s add the class attribute to a couple of paragraphs. We reference two different types of paragraphs, as shown in Figure 15: Figure 15: :Adding the class attribute to paragraph tags Figure 16 shows you how the page is displayed: 8 HTML Tip Sheet

HTML5, CSS3 Figure 16: The result as seen in Internet Explorer 7 Formatting (text color, italics, and so on) is also different when using CSS. The details of using a cascading style sheet are explained in an upcoming tip sheet. WB_HTMLPrimer_TS_AL, 001.1 9

10 HTML Tip Sheet