Saturday, February 11, 2012

HTML Help / Cheat sheet from Quackit.com

Need HTML help? You've come to the right place.

Copy/Paste HTML Codes

Below you will find HTML codes that you can copy and paste right into your website or MySpace page etc.
DescriptionCodeResult
Text
Headings

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6
Paragraphs Normal paragraph text.
Line Break I feel a line break coming...
...up.
Bold Text Bold text.
Italic Text Italic text.
Color Text
Color text.
Text Size
Text size using points.
Text size using pixels.
Text size using relative sizes.
Font Family
Preferred serif font.
Preformatted Text
Preformatted text displays just as you type it...
  ...line breaks, spaces and all! 
Teletype Text Teletype text - sometimes referred to as typewriter text.
Citation Text Citation text.
Emphasized Text Emphasized text.
Code Text Code text.
Big Text Big text.
Small Text Small text.
Blockquote The label says:
Contents should not be swallowed. This is due to the enormous amount of harmful chemicals that has gone into this burger.
Deleted Text
Delete this text.
Inserted Text
Insert this text.
Keyboard Text Keyboard text - text to be entered by the user.
Quotation Text Quotation text.
Sample Text Sample text (output from a computer program).
Variable Text Variable text.
Definition Definition.: To define the meaning of a word, phrase or term.
Images
Image Milford Sound in New Zealand
Image with Border Milford Sound in New Zealand
Linked Image Milford Sound in New Zealand
Linked Image with no Border Milford Sound in New Zealand
Tables
Basic Table
Table cell 1Table cell 2
Table with cellpadding, cellspacing, and width attributes
Table cell 1Table cell 2
Table with a Header Row
Table headerTable header
Table cell 1Table cell 2
Table with colspan Applied
Table header
Table cell 1Table cell 2
Table with rowspan Applied
Table headerTable cell 1
Table cell 2
Table with CSS Applied
Table headerTable header
Table cell 1Table cell 2
Forms
Basic Form Tags (insert all form elements between these tags)
(Insert form elements here)
Text Input
Text Area
Radio Buttons Option 1 Option 2
Checkboxes Option 1 Option 2
Select List
Submit Button
Image Button
Lists
Ordered list (numbered list)
  1. List item 1
  2. List item 2
  3. List item 3
Unordered list (unnumbered list)
  • List item 1
  • List item 2
  • List item 3
Definition list
Term 1
Definition of term 1
Term 2
Definition of term 2
Frames
Inline Frame <!--This bit is only viewed by browsers that don't support inline frames --> Your browser doesn't support inline frames.
Frames The frameset (frame_example_frameset_1.html):
The left frame (frame_example_left.html):
The right frame (frame_example_right.html):
View the result

Need More HTML Help?

In the following table, the left column contains an HTML topic, the right column provides links to where you can find help about that topic.
For this...do this...
HTML help with tables
HTML help with images
Help with hyperlinks
Help with image maps
Help with fonts
Help with embedding music/audio/sound
Help with color
Help with numbered (ordered) lists
Help with unnumbered (unordered) lists
Help with definition lists
Help with forms
Help with frames
Help with inline frames
Help with metadata
Help with HTML redirects
Help with adding JavaScript to a web page
Help with event handlers/intrinsic events

Tuesday, February 7, 2012

Links (Hyperlinks)


Links (Hyperlinks)
A hyperlink (or link) is a word, group of words, or image that you can click on to jump to a new document or a new section within the current document.
When you move the cursor over a link in a Web page, the arrow will turn into a little hand.
Links are specified in HTML using the <a> tag.
The <a> tag can be used in two ways:
1.     To create a link to another document, by using the href attribute
2.     To create a bookmark inside a document, by using the name attribute

HTML Link Syntax
The HTML code for a link is simple. It looks like this:
<a href="url">Link text</a>
The href attribute specifies the destination of a link.
Example
<a href="http://www.w3schools.com/">Visit W3Schools</a>
which will display like this: Visit W3Schools
Clicking on this hyperlink will send the user to W3Schools' homepage.
Tip: The "Link text" doesn't have to be text. It can be an image or any other HTML element.

HTML Links - The target Attribute
The target attribute specifies where to open the linked document.
The example below will open the linked document in a new browser window or a new tab:
Example
<a href="http://www.w3schools.com/" target="_blank">Visit W3Schools!</a>




HTML Links - The name Attribute
The name attribute specifies the name of an anchor.
The name attribute is used to create a bookmark inside an HTML document.
Note: The upcoming HTML5 standard suggests using the id attribute instead of the name attribute for specifying the name of an anchor. Using the id attribute actually works also for HTML4 in all modern browsers.
Bookmarks are not displayed in any special way. They are invisible to the reader.
Example
A named anchor inside an HTML document:  <a name="tips">Useful Tips Section</a>

Create a link to the "Useful Tips Section" inside the same document:                                                              <a href="#tips">Visit the Useful Tips Section</a>

Or, create a link to the "Useful Tips Section" from another page:                                                                      <a href="http://www.w3schools.com/html_links.htm#tips">

Graphics


GRAPHICS                                                 
A note about copyright
You should never use any graphics, images, text or photos without permission. There are several sites available on the Web where you can receive free images. But under no circumstances should you ever copy material unless the site says you can or you personally have received permission. It's just better to create your own stuff or ask (and get an okay) before you use someone else's stuff. Don't be a cheater!

File Formats
Two file formats have been developed to help keep files small, while maintain a high level of quality:
.gif files: graphic interchange format – 256 colors
.jpg files: joint photographic experts group – millions of colors

The Image tag
To place an image onto a Web page you will need to use the image tag. There are two very important things to remember about the image tag:
1.   It’s an empty tag (remember, that means there’s no closing tag, only a beginning).
2.   It requires attributes to be effective.
The image tag The image tag <img> has several attributes:
src--identifies the image and tells the browser where to get the image
alt—gives alternative text for those who are not viewing their pages as images.
height & width—tells the browser the size of the graphic (speeds up the downloading process
Let’s go through each one of the attributes in more detail.
SRC attribute
To help the browser identify and find an image, you use the following command:
<img src="../foldername/filename.gif">
Alt attribute
The alt attribute lets the user know what’s in the picture by providing descriptive text. It also has an added feature with the latest versions of Internet Explorer and Netscape Navigator. When the cursor arrow passes over artwork or a photo, a little rectangular box pops up that contains the alt copy. It’s a great way to add interest to your page or even give instructions to the user.
When things go wrong with your code, 
you need to do some detective work!

The image tag for this graphic looks like this:
<img src="mystery.jpg" alt="Detective at work!">
Height & Width attribute
When placing your images onto the screen, the browser looks for the height and width of your images. This is an excellent feature because it allows the browsers to set the space size aside while laying out the balance of the page. If you do not specify the size, the browser will stretch it or reduce it to fit.
Height and width are listed in pixels--those little dots that make up an image on a computer screen.

The code for this image is like this:
<img src="masks.jpg" width="149" height="140" alt="You can determine how large your images are by opening them in Navigator.">
Align Attribute
When you place a graphic on a page it will always appear to the left (that's the default or the standard for the browser). 



 However, you can place it to the right just by adding the align attribute to the image tag. And the code looks like this:
<img src="masks.jpg" align="right" width="149" height="140" alt="This is an example of a right-aligned image.">

And here's the code:
<p align="center"><img src="masks.jpg" align="center" width="149" height="140" alt="This is an example of a centered image."></p>


Learning Links