Section B.1. Getting Started

B.1. Getting Started

To play around with HTML, you need a text editor to write the HTML code and a Web browser (such as Internet Explorer or Navigator) to read it. A text editor is a program that lets you create and edit text files. Three popular text editors are TextEdit (on Macs) and Notepad and WordPad (on Windows). Fire up one of those programs to get started.

Note: Don't try to use a full-blown word processing program like Word or WordPerfect to write HTML. They use all kinds of behind-the-scenes formatting that will mess up your code.

HTML works using tags , which tell a Web browser how to format text. Tags appear inside angle brackets: < >. Most tags have a starting tag < tag > and a closing tag </ tag > to show the Web browser where a particular kind of formatting begins and ends. You put your text in between the tags, like this:

 <tag>text_text_text</tag> 

HTML has lots of tags, but Table B-1 shows some simple tags you can use to juice up your eBay pages. (Note that some tags don't require a closing tag.)

Table B-1. Basic HTML Tags

HTML Tag

What It Does

How the Code Looks

How Browsers Displays It

<h1></h1> to <h6></h6>

Creates different heading sizes.

<h2>Big heading<h2>

<h4>Small heading<h4>

Big heading

Small heading

<b></b>

Boldfaces text.

<b>Bold text</b>

Bold text

<i></i>

Italicizes text.

<i>Italicized text</>

Italicized text

<big></big>

Enlarges text.

<big>Big text</big>

Big text

<br>

Inserts a line break.

Use<br> to force a line break.

Use to force a line break.

<center></center>

Centers text.

<center>Center<br>

your text like this.</center>

Center

your text like this

<p>

Starts a new paragraph.

<p>Para 1 <p>Para 2

Para 1

Para 2

<hr>

Inserts a horizontal rule (line).

horizontal rule tag,<hr> You don't need

(See Figure B-1.)

<sup></sup>

Creates a superscript character.

E=mc<sup>2</sup>

E=mc 2

<sup></sup>

Creates a superscript character.

H<sup>2</sup>O

H 2 O

<strike></strike>

Strikes through text.

Oops. <strike>Never mind.</strike>

Oops. Never mind.

Inserts an invisible commentyou can read the comment in your HTML file, but it doesn't display in a browser.

Only $49.99

Only $49.99


Note: HTML tags are nested , which means if you use several on one piece of text, you have to close them in backward order from how you started them, like this: <center><b><i>Hi There!</i></b></center> .

Practice by typing some text into your text editor, marking it up with HTML tags. Here's a simple example (you see the results in Figure B-1):

 <h1>My HTML Practice Page</h1> <p><b>Bold</b> sentences and <i>italicized</i> words stand out. If<br> you're running a sale, you can cross out the old price like this: <p><center>Was <strike>.99</strike>, Now <b>.99!</b></center><!-- Compare sales at this new price with last month's figures.--> <hr>Divide your description into sections with the horizontal rule tag. <hr>You don't need to use the paragraph tag after a horizontal rule. 

After you've typed your text, you need to name the document and save it as an HTML file before a Web browser can make any sense of it. Here's how:

  • In TextEdit , before you save the file, select Format Make Plain Text. When you save your file, type filename.html (with the name you want replacing filename ) and when TextEdit asks you if you want it to add .txt for you, turn on Don't Append. After you've named and saved a new file, you don't have to do these steps again the next time you save that file.

  • In WordPad or Notepad , select File Save. Type filename.html (with the name you want replacing filename ) into the "File name" box. From the "Save as type" drop-down list, select Text Document, then click Save. If you're using WordPad, you get a warning that you're about the save your document as text only, which strips out all formatting. Since this is exactly what you want to do, click Yes.

Tip: If you're using a text editor to create several different auction pages that you plan to list later, give each page a different name. You don't want to accidentally write over a page you want to save; if you do, you'll have to start from scratch.

When you've saved your HTML file, open your Web browser and use it to view the file. For example, in Internet Explorer, select File Open and use the Browse button to locate your file. The results will look something like Figure B-1.

Figure B-1. HTML lets you format the text that appears on a Web page. This example shows how a Web browser displays text using the simple HTML code shown on Section B.1.


As you experiment, make changes to your HTML in TextEdit or WordPad. Whenever you want to see how your work looks in a browser window, save the HTML file first, then go to the browser window and hit the Reload button. If you don't save the changes, the browser doesn't know they're there, and the browser window stays the same.

Note: You can make text slightly bigger and bolder with the <big> tag, but for more control, use the <font size> tag, like this: <font size =7> I want this text to be really big!</font>


eBay[c] The Missing Manual
eBay[c] The Missing Manual
ISBN: 596006446
EAN: N/A
Year: 2006
Pages: 100

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net