![]() Advanced HTML & CSS tutorial for tables, email links & listsA brief tutorial on HTML lists, anti-spam email links, and using tables for web page design. Thursday, July 29. Last edited: 2008.01.12 | |
These are essential web page design features, but that you do not need to learn immediately.References to further refinements and anything else that you may need can be found at:
HTML Lists"Lists" are essential web page design features. In particular, it is becoming popular to use "list" code for the navigation links. However, this requires the skillful use of CSS to adjust margins, "list markers," and other behavior which can vary between browsers. Therefore, I suggest that you just have fun using lists anywhere you need to "make a point" in your text. The three most important kinds of lists are:
<ul>The above source code will normally display as:
<ol><li>Code for
an ordered list.</li>The above source code will normally display as:
For the <dl> definition list, I prefer not to use the "normal" display mode. In my opinion, this tends to be ungainly. Therefore, on my beginner.css style sheet, I have specified: dt, dd {display:inline}This means that I can use the <dl> codes to display definitions right alongside (inline with) normal text. Or any way that I want. Therefore--if using my beginner.css style sheet--then for the <dl> to appear to be a typical "list" you will need <br /> line-break tags. A few spacers also may be needed to imitate the normal indentation.
<dl>With beginner.css the above will display as:
Spam resistant email linksYou might also want to write clickable "send email" links. The standard way to do this is:<a
href="mailto:myemail@address.com">Click here to send me an
email.</a>(Not recommended.) The above works, of course. However, spam robots are trained to collect such emails. It is better to use Javascript. This alone is not foolproof--and neither are "spam filters." Never post your "private" email address on a website. I also "date" my public email addresses, and change them occassionally to slow down the spam. Here is how I do it. (Just change the bold letters to the appropriate parts of your email address.) This displays as: There are other Javascript methods that do not display the email address at all.However, the browsers of some people do not respond to Javascript commands. Others do not use an email program such as Outlook, or are not using their own computer, so can not use "clickable email links." Therefore, I prefer the above code. With this code, the site visitor can always "copy and paste" the email address.Using a <table> for the links marginIn ancient days, before CSS, a <table> was used to make a links margin. This is no longer needed. However, the Kwik-n-free website template still uses a table to add stability. Tables also have other uses. Therefore, you might as well take a brief look at how this is done.Caution: one wrong move, or one missing slash (/) and your entire page can be put out of whack. But--after pulling on your hair a number of times--you may realize that you are having fun! Once you get the hang of it, tables are like piecing together a jigsaw puzzle. table=table tr="table row" td="table cell" valign="vertical alignment" (Also can use CSS "vertical-align:") align="horizontal alignment" (Also can use CSS "align:")
All code for the top of the
page, including logo and title, etc., goes here. The colspan="2" means that this single cell will "span" the same width as the 2 cells or "columns" of cells that come below.</td></tr>Any amount of main text can
go here. Any amount of main text can
go here. Any amount of main text can
go here.</td></tr></table>If you need to know more abut tables: click here for the W3 Schools Complete Reference for HTML Tables. After you have mastered these techniques, then I suggest you try using the Kwik-n-free CSS Template for websites.This is the actual template used to build Kwik-n-free.com. Find the link just below. |
|