Painting Contractors Online Help

September 5th, 2009 at 10:32 am

HTML Tips – Part Five

In the last installment of HTML Tips, I went over email address cloaking and how to keep the spambots from putting you on a zillion lists, thus inundating you with more junk email than you’d know what to do with. In this installment, I’m going to start combining some tips since some of these won’t take a lot of explanation.

The first one is filling up empty table cells. If you’ve ever made a table on a web page and found that you didn’t need or want to fill every cell with data, you may have discovered that leaving the cell empty made the table look very ugly. The empty cell ends up having no border around it.

Well, there is a very simple fix for this. There is one thing that you can place into a cell that, while it won’t be visible to the naked eye, will be visible to the code itself and fool it into thinking that something is actually there. This thing is a simple HTML string called &nbsp. Simply putting this in the cell, with a ; at the end of the string, will have the blank cells in the table appear like so…

Your Text Your Text
Your Text

See how nice that looks? You can do this with any cell in any table and get rid of that “blank” cell look.

The next tip is for web pages where you want to have a table of contents so that people can get from the table of contents to another spot on the same web page, and not to another web page. This is a little tricky and not something that beginning designers learn how to do, for whatever reason. Well, this process is a simple two-stepper that is a real piece of cake. You can do these steps in any order. It doesn’t matter. Just make sure everything matches.

One step is to create the table of contents entry. Let’s say you want to have a line that people can click on that will bring the visitor to a section of the page called “Introduction.” What you would do is create a line that looks like a regular link going to another page, except it will be a little different. It will look something like this.

Introduction

The difference between this link and a link going to another web page is the #Intro part. The # indicates that this link will be going to the same web page but to a different section of the page. How do we show where this section is?

Simple…

You will use another line, at the point on the page where you want the intro to actually appear, that looks something like this.

Introduction

The name tag tells the browser that when the visitor clicks on the link in the previous step, they should be directed to this part of the page. The key is making sure that the #Intro in the HREF tag matches with the Intro in the NAME tag. You can have as many of these as you like on a page. I’ve seen tables of contents at Wikipedia that are hundreds of lines long.

And that’s all there is to it.

In our next installment, more tips.

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • FriendFeed
  • LinkedIn
  • MySpace
  • RSS
  • StumbleUpon
  • Technorati

 

RSS feed for comments on this post | TrackBack URI

Powered by Yahoo! Answers