The 24 Top Questions from Readers of Sams Teach Yourself HTML and CSS in 24 Hours


The 24 Top Questions from Readers of Sams Teach Yourself HTML and CSS in 24 Hours

1:

What should I read next?

A1:

Try Sams Teach Yourself JavaScript in 21 Days or Web Site Design Goodies, which are available at most bookstores, including online at http://www.amazon.com.

2:

I'm stuck on my first page. It didn't work. What did I do wrong?

A2:

The first page is always the hardest. If you see all the HTML code when you try to view the file (by selecting File, Open in your web browser) or if you see some weird characters at the top of the page, you haven't saved the file in plain-text or ASCII text format. If you can't figure out how to do that in your word processor, use the Notepad or TextEdit editor that came with your computer instead. (WordPad is especially problematic in this regard.) Also make sure that you've saved the file with a .html or .htm file extension.

For more guidance on making your first page, carefully go over the first "Try It Yourself" section and "Getting Started with a Simple Web Page" in Hour 2, "Create a Web Page Right Now."

Also, remember that you don't have to be connected to the Internet to edit and view web pages on your hard drive. (If your web browser tries to connect to the Internet every time you start it, change the home page in your browser settings to a page on your hard drive.)

3:

Graphics or media files don't work/don't show online.

A3:

There are several common pitfalls you may encounter when putting graphics on a web page:

  • Make sure that the graphics file is in the same folder as the HTML document that refers to it. (If you're trying to refer to it in a different folder, review the "Addressing Web Pages" section of Hour 3, "Linking to Other Web Pages.")

  • Make sure that the graphics file is saved in GIF, JPEG, or PNG format. Open the file with Paint Shop Pro, Picasa, or another graphics program, and use File, Save As to save it again just to be sure.

  • Make sure that the capitalization of the filename and the src= attribute in the <img /> tag match. MyImage.gif and myimage.GIF are not the same to most web servers!

  • To get rid of the blue line around a graphic, put style="border:none" in the <img /> tag.

  • This one's unlikely, but possible: Do you have Load Images turned off under Tools, Options, Web Features in Mozilla Firefox, or Show Pictures turned off under Tools, Internet Options, Advanced in Microsoft Internet Explorer?

  • True story: One reader spent four days trying to figure out why none of his images worked. He was typing <img scr= instead of <img src= every single time. Don't laughjust check your page for typos.

Refer to Hour 8, "Putting Graphics on a Web Page." If you're having trouble arranging graphics on the page, you'll find many helpful hints not only in Hour 8 but in Hour 9, "Custom Backgrounds and Colors," and Hour 10, "Graphical Links and Imagemaps," as well.

Audio and video files are trickier and more prone to problems. There's no practical way to make them work in every version of every popular browser, but refer to Hour 19, "Embedding Multimedia in Web Pages," for as much help as I can give.

4:

How do I get forms to work on my server?

A4:

Ask your ISP to help you set up a forms-processing script. If your ISP can't do it, you either need to find one that is willing to actually provide some service or use a third-party form-processing service, such as http://www.freedback.com. You can also simply have form information sent to your email address, but this approach is a little unreliable because it is dependent on all users having their email properly configured through their web browser.

5:

How do I put a counter on my page?

A5:

You probably don't truly need one because most ISPs offer a detailed statistical report each week, summarizing exactly how many times each of your pages was accessed. You should expect (read: demand) this service, but some web hosting services (especially free ones, or those outside North America) just won't provide it. In that case, you need to set up a CGI script on your server. That isn't terribly difficult, and you'll find the code and some advice on how to do it at http://www.developer.com and other web development sites.

6:

I'm confused about frames. Mine don't work, and I don't understand why. Do you?

A6:

Frames are tricky. It may take a couple readings of Hour 16, "Multi-Page Layout with Frames," and some experimentation before everything clicks and you see how the whole thing works. Here are some tips that may help:

  • Remember that you can right-click in any frame and pick This Frame, View Frame Source in Mozilla Firefox or View Source in Microsoft Internet Explorer to see the HTML for that frame. Selecting View, Source from the main menu shows you the HTML for the frameset document.

  • The only way to make a link change the contents of two or more frames at once is to link to a new frameset and include target="_top" in the <a> link tag.

  • You also use target="_top" when you want to break out of all the frames and go back to a regular single-page document.

7:

How do I pursue a career in web page design, and how much should I charge to make someone a web page?

A7:

As in any competitive business (and web page design is a very competitive business), you need a solid marketing plan to be successful. If you've already found some clients, the amount you charge them is obviously up for negotiation. As a general rule, the going rate for experienced web developers is between $25 and $50 per hour. If you are still learning, expect to charge less than that, unless you are already a professional graphics or publications designer with a loyal client base.

8:

How do I make password-protected pages?

A8:

Consult your ISP to see what kinds of security options they have available. For true password protection, you will need to utilize secure pages, or at least a script of some sort that limits access to users who can enter a verified password.

9:

Where can I find Java applets/prewritten JavaScript?

A9:

Try http://www.developer.com, http://www.javascript.com, and http://javascript.internet.com, or look in any of the major Internet search sites under "Java" or "JavaScript."

10:

I can't get a link to work. What could be wrong?

A10:

Check the spelling and capitalization of the href link and the file to which you're trying to link. Some links will work on your hard drive, but fail on the web server if the capitalization doesn't match. (This is because Windows doesn't care about capitalization of filenames, but UNIX does.) Also, review Hour 3, "Linking to Other Web Pages," and Hour 6, "Creating Text Links," to make sure that you understand the finer points of relative and absolute addressing and link anchors.

11:

I am having trouble getting JavaScript code to work, even though I'm pretty sure I got the syntax right.

A11:

Please don't imagine for a moment that Microsoft and Netscape could possibly have bugs in their web browsers, especially in the sacred JavaScript module. You are the problem. To redeem yourself, you must build a shrine next to your computer, paste gilt-edged pictures of Bill Gates and Marc Andreessen to it, and humbly offer it cold pizza thrice daily. If you do this with a clean heart and a pure mind, all problems with code implementation will still be your own darn fault, but at least Microsoft may decide not to take legal action against you for it.

Seriously, you may want to consider using a JavaScript debugger to try to solve JavaScript problems that have you at your wit's end. Mozilla offers a free debugger called Venkman (someone at Mozilla is a Ghostbuster's fan!) that integrates into Firefox; to learn more, visit http://www.mozilla.org/projects/venkman/. A script debugger is built in to Internet Explorer, and you can activate it by disabling the browser setting Disable Script Debugging (Internet Explorer) from the Advanced tab in the Internet Options dialog box.

12:

Where can I get more help creating graphics and multimedia?

A12:

If you use Paint Shop Pro for graphics, try the online tutorials at the Web Graphics on a Budget web site (http://mardiweb.com/web/). If you're using Picasa, Google offers a decent "Getting Started Guide" in the Support area of the Picasa web site (http://picasa.google.com/support/). For stylistic design help with your web graphics, take a look at the book Web Graphics for Non-Designers at a major bookstore. Another option is to use an online media gallery, or clip art site, such as Microsoft's Design Gallery Live (http://dgl.microsoft.com).

13:

How do I put more "bells and whistles" (a chat room, a hit counter, password protection, interactive sound, a pull-down list of links, and things of that nature) on my site?

A13:

Most of those involve JavaScript or CGI scripting (advanced stuff) to make them work. To help you go beyond what this book teaches, I've assembled a list of advanced developer resources at http://www.samspublishing.com/.

14:

How do I get a message to scroll along the bottom?

A14:

You'll find JavaScript for that at both http://www.developer.com and http://www.javascript.com.

15:

How do I put files on a web site for download?

A15:

Just upload the file in the same place you put your web pages and use a regular HTML link, like the following:

 <a href="bigfile.zip">Click here to download bigfile.zip.</a> 


Keep in mind that an image linked in this manner will likely open up within the browser window, which may not be the desired effect if you're placing the image online for download. The solution is for the users to save the image to their local computer after it is opened in the browser.

16:

How do I put a browser on a memory card or CD-ROM? Do I need to if I publish web pages to portable media?

A16:

Most people have a web browser on their computer these days, but if you want to provide one just in case, you need permission from the browser company. I recommend Opera (http://www.opera.com), which takes up very little space and allows distribution of free time-limited evaluation copies.

17:

When I try to download Paint Shop Pro or the FTP software you recommended, the download is deathly slow or stops altogether. Can you help?

A17:

I'm afraid there's not much I (or you) can do, except recommend that you try again later. And you thought you needed a car to get in a traffic jam?

18:

Should I use Java applets and other advanced stuff?

A18:

Not unless you need to do something you can't do any other way. Basic HTML is faster, more widely compatible, and easier to maintain.

19:

How do I make a form for people to fill out and print?

A19:

They can fill out and print any HTML form. Just tell them to do it. See the "Q&A" section at the end of Hour 18, "Gathering Information with HTML Forms." Make sure that the form elements are still placed within a <form> tag, even if you don't plan on having the form submitted electronically.

20:

How do I justify text so that it lines up with both margins?

A20:

If you have a flat-panel screen, you could try scissors and glue. Or just use the text-align CSS style like this: style="text-align:justify".

21:

How do I publicize my site, and how do I find advertisers for my site?

A21:

The first section of Hour 23, "Helping People Find Your Web Pages," will help some, but mostly you'll need to come up with your own marketing/PR plan tailored to your specific situation.

There are many web advertising services and companies that will pay independent web publishers like you to run ads or affiliate with them in other potentially profitable ways. Most pay you a small amount each time a visitor clicks one of their ads; see http://www.sitecash.com/guide.htm for some possibilities. An even better option involves Google Ad Sense, which is a program Google offers in which context-sensitive ads are displayed on your site, and you make money anytime someone clicks one of the ads. To learn more, visit the Google AdSense web site at https://www.google.com/adsense/.

22:

How do I create HTML pages or links within email messages?

A22:

Just type regular HTML as you would to make a web page. Most advanced email programs nowadays allow you to create and view mail in HTML. You format it just as you would a documentno HTML experience required. Generally speaking, if a web address is preceded by http:// in an email, most email programs will automatically convert it into a link.

23:

How do I open a link in a new window?

A23:

Use target="_blank" in your a href link tag. Keep in mind that this approach is technically not XHTML 1.1 compatible. For a workaround that is XHTML 1.1 compliant, read the section in Hour 3 titled "Opening a Link in a New Browser Window."

24:

How do I link to a database and let people search my site?

A24:

You'll probably need to give a software company some money for a good answer to that one. More than likely your web hosting service already supports a particular kind of database, and might be able to provide you with guidance for building pages that are capable of accessing a database. You may also want to look into learning PHP and mySQL, which are two popular technologies that allow you to add database features to web sites.




SAMS Teach Yourself HTML and CSS in 24 Hours
Sams Teach Yourself HTML and CSS in 24 Hours (7th Edition)
ISBN: 0672328410
EAN: 2147483647
Year: 2005
Pages: 345

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