About

Pages

This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Minggu, 24 Maret 2013

HTML Marquee Code


Example Marquee Code

Note that if you can't view the examples, it's likely that your browser doesn't support the marquee tag.

Slide-in text:

This text slides in from the right, then stays where it is. You will need to refresh this page to see the effect again.
CodeResult

Your slide-in text goes here

Continuous scrolling text:

CodeResult

Your scrolling text goes here

Text bouncing back and forth:

CodeResult

Your bouncing text goes here

Text Scrolling Upwards:

CodeResult

Your upward scrolling text goes here

Change the Scrolling Speed:

CodeResult

Slow scroll speed Medium scroll speed Fast scroll speed

Scrolling Images:

Simply replace the src="... part with the location of your own image.
CodeResult

smile

Images & Text (Both Scrolling):

Simply add your text under the image tag (but still within the marquee tags).
CodeResult

smile Sample text under a Marquee image.

Cool Effects with Marquees!

You can use HTML marquees for some cool effects. Check out this falling text (generated with the Falling Text Generator)...
Marquee effects... cool!Marquee effects... cool!...cool!Marquee effects... cool!Marquee effects... cool!Marquee effects... cool!Marquee effects... cool!Marquees...Marquee effects... cool!Marquee effects... cool!Marquee effects... cool!Marquee effects... cool!Marquee effects... cool!...effects...Marquee effects... cool!Marquee effects... cool!Marquee effects... cool!Marquee effects... cool!Marquee effects... cool!Marquee effects... cool!Marquee effects... cool!

More Marquee Tricks

HTML Meta Tags


Meta tags allow you to provide metadata about your HTML pages. This can be very useful for search engines and can assist the "findability" of the information on your website.

What is Metadata?

Metadata is information about, or that describes, other data or information.
If we relate this to a web page, if you think about it for a moment, you could probably come up with a lot more information about a web page than what you're actually displaying to the reader. For example, there could be a number of keywords that are related to the page. You could probably give the page a description. The page also has an author - right? All these could be examples of metadata.

Metadata on the Web

Metadata is a very important part of the web. It can assist search engines in finding the best match when a user performs a search. Search engines will often look at any metadata attached to a page - especially keywords - and rank it higher than another page with less relevant metadata, or with no metadata at all.

Adding Meta Tags to Your Documents

You can add metadata to your web pages by placing <meta> tags between the <head></head> tags. The can include the following attributes:
AttributeDescription
NameName for the property. Can be anything. Examples include, keywords, description, author, revised, generator etc.
contentSpecifies the property's value.
schemeSpecifies a scheme to use to interpret the property's value (as declared in the content attribute).
http-equivUsed for http response message headers. For example http-equiv can be used to refresh the page or to set a cookie. Values include content-type, expires, refresh and set-cookie.

Example HTML Code

Keywords:
Code

Description:
Code

Revision date (last time the document was updated):
Code

Refresh the page every 10 seconds:
Code

The above examples are some of the more common uses for the meta tag.

HTML Images

Images make up a large part of the web - most websites contain images. HTML makes it very easy for you to embed images into your web page.
To embed an image into a web page, the image first needs to exist in either .jpg, .gif, or .png format. You can create images in an image editor (such as Adobe Photoshop) and save them in the correct format.
Once you've created an image, you need to embed it into your web page. To embed the image into your web page, use the <img> tag, specifying the actual location of the image.

Example of Image Usage

CodeResult
Smile
The <img> element above contains a number of attributes. These attributes tell the browser all about the image and how to display it. Here's an explanation of these attributes:
srcRequired attribute. This is the path to the image. It can be either an absolute path, or a relative path (remember these terms from our last lesson?)
widthOptional attribute. This specifies the width to display the image. If the actual image is wider, it will shrink to the dimensions you specify here. Likewise, if the actual image is smaller it will expand to your dimensions. I don't recommend specifying a different size for the image, as it will lose quality. It's better to make sure the image is the correct size to start with.
heightOptional attribute. This specifies the height to display the image. This attribute works similar to the width.
altAlternate text. This specifies text to be used in case the browser/user agent can't render the image.

Dimensions Using CSS

Instead of using the width and height dimensions as above, you could choose to set the size using CSS. This can give you extra flexibility. For example, it can sometimes be useful to specify a max-width or max-height instead of an absolute size. This can prevent large images from ruining your layout (eg, if it's too big to fit inside the content area). This can happen especially if someone tries to view your website on a device with a small screen (such as a mobile phone).
In the following example, we use max-width:100% to ensure that the image is never too big for its context. When you only use max-width (without using max-height), the browser will rescale the image proportionally. In other words, the height will be rescaled along with the width, and the image won't become squashed. When you do this, make sure you remove the HTML width and height attributes, otherwise they will conflict with the CSS.
CodeResult
Smile

Image Links

You can make your images "clickable" so that when a user clicks the image, it opens another URL. You do this by simply wrapping the image with hyperlink code.
CodeResult
Boracay, Philippines

Removing the Border

Some browsers create a border around the image when it's clickable. If you don't want the border, specify border="0". You can also use the CSS border property to remove the border (i.e. border:0;).
CodeResult
Boracay, Philippines

Creating Images

The above examples assumed that you already had an image to embed into your web page. To learn about creating images for the web

HTML Links


Links, otherwise known as hyperlinks, are defined using the <a> tag - otherwise known as the anchor element.
To create a hyperlink, you use the <a> tag in conjunction with the href attribute (href stands for Hypertext Reference). The value of the href attribute is the URL, or, location of where the link is pointing to.
Example:
CodeResult

Create a website with this Website Builder
Hypertext references can use absolute URLS, relative URLs, or root relative URLs.
absolute
This refers to a URL where the full path is provided. For example, http://www.quackit.com/html/tutorial/
relative
This refers to a URL where only the path, relative to the current location, is provided. For example, if we want to reference the http://www.quackit.com/html/tutorial/ URL, and our current location is http://www.quackit.com/html/, we would use tutorial/
root relative
This refers to a URL where only the path, relative to the domain's root, is provided. For example, if we want to reference the http://www.quackit.com/html/tutorial/ URL, and the current location is http://www.quackit.com/html/, we would use /html/tutorial/. The forward slash indicates the domain's root. This way, no matter where your file is located, you can always use this method to determine the path, even if you don't know what the domain name will eventually be.

Link Targets

You can nominate whether to open the URL in a new window or the current window. You do this with the target attribute. For example, target="_blank" opens the URL in a new window.
The target attribute can have the following possible values:
_blankOpens the URL in a new browser window.
_selfLoads the URL in the current browser window.
_parentLoads the URL into the parent frame (still within the current browser window). This is only applicable when using frames.
_topLoads the URL in the current browser window, but cancelling out any frames. Therefore, if frames were being used, they aren't any longer.
Example:
CodeResult

Check out this stir-fried chicken and basil recipe.

Named Anchors

You can make your links "jump" to other sections within the same page. You do this with named anchors.
To use named anchors, you need to create two pieces of code - one for the hyperlink (this is what the user will click on), and one for the named anchor (this is where they will end up).
This page uses a named anchor. I did this by performing the steps below:
  1. I created the named anchor first (where the user will end up) Example HTML Code:
    Code

  2. I then created the hyperlink (what the user will click on). This is done by linking to the name of the named anchor. You need to preceed the name with a hash (#) symbol. Example HTML Code:
    Code

This results in:
CodeResult

Link Targets
When you click on the above link, this page should jump up to the "Link Targets" section (above). You can either use your back button, or scroll down the page to get back here. You're back? Good, now lets move on to email links.

Email Links

You can create a hyperlink to an email address. To do this, use the mailto attribute in your anchor tag.
Example:
CodeResult

Email King Kong
Clicking on this link should result in your default email client opening up with the email address already filled out. You can go a step further than this. You can auto-complete the subject line for your users, and even the body of the email. You do this appending subject and body parameters to the email address.
CodeResult

Email King Kong

Base href

You can specify a default URL for all links on the page to start with. You do this by placing the base tag (in conjunction with the href attribute) in the document's <head>.
Example HTML Code:
Code

HTML Colors


Syntax

Foreground Color

To add color to an HTML element, you use style="color:{color}", where {color} is the color value. For example:
CodeResult

HTML Colors

Background Color

To add a background color to an HTML element, you use style="background-color:{color}", where {color} is the color value. For example:
CodeResult

HTML Colors

Border Color

To add a colored border to an HTML element, you use style="border:{width} {color} {style}", where {width} is the width of the border, {color} is the color of the border, and {style} is the style of the border. For example:
CodeResult

HTML Colors

Color Names

Beginners may find it easier to specify colors by their color name, as color names are probably a lot easier to remember than the other options. Although color names are easier to remember, the hexadecimal, RGB, and HSL notations provide you with more color options.
Hexadecimal color codes are a combination of letters and numbers. The numbers go from 0 - 9 and the letters go from A to F. When using hexadecimal color values in your HTML/CSS, you preceed the value with a hash (#). Although hexadecimal values may look a little weird at first, you'll soon get used to them.
If you use graphics software, such as Adobe Photoshop or GIMP, you might be used to the RGB or HSL methods.
The chart below shows the 17 color names as specified in the CSS 2.1 specification, along with their corresponding hexadecimal and RGB values.
This table is a small sample of the enormous range of colors available in HTML. To see more, check out HTML Color Codes.
You can make up your own colors by simply entering any six digit hexadecimal value (preceeded by a hash). In the following example, we're using the same code as above. The only difference is that, instead of using "blue" as the value, we're using its hexadecimal equivalent (which is #0000ff):
CodeResult

HTML Colors

If we wanted to change to a deeper blue, we could change our hexadecimal value slightly, like this:
CodeResult

HTML Colors

Transparency

You can also use alpha to specify the level of opacity the color should have. This is only available on RGB and HSL notations. To do this, add the letter "a" to the functional notation (i.e. RGBA and HSLA). For example, rgba(0,0,255,0.5) results in a semi-transparent blue, as does hsla(240, 100%, 50%, 0.5).
Here's an example of using RGBA to change the opacity.
CodeResult

No transparancy

Half transparancy

Lots of transparancy

Here's an example of using HSLA to change the opacity.
CodeResult

No transparancy

Half transparancy

Lots of transparancy

Choosing Colors - The Easy Way

By using hexadecimal, RGB, or HSL notation, you have a choice of over 16 million different colors. For example, you can start with 000000 and increment by one value all the way up to FFFFFF. Each different value represents a slightly different color.
But don't worry - you won't need to remember every single hexadecimal color value! The HTML color picker and color chart make it easy for you to choose colors for your website.

HTML Attributes

HTML tags can contain one or more attributes. Attributes are added to a tag to provide the browser with more information about how the tag should appear or behave. Attributes consist of a name and a value separated by an equals (=) sign.

Example

Consider this example:
CodeResult

Do you like my background color?
OK, we've already seen the <p> tag in previous lessons, but this time we can see that something extra has been added to the tag - an attribute. This particular attribute statement, style="background-color:orange", tells the browser to style the <p> element with a background color of orange.
The browser knows to make the background color orange because we are using standard HTML tags and attributes (along with standard Cascading Style Sheets code) for setting the color.

Another Example

Here's another example of adding an attribute to an HTML tag. In this example, we use the <a> tag to create a hyperlink to a web page at another website.
CodeResult

HTML links
Many attributes are available to HTML elements, some are common across most tags, others can only be used on certain tags. Some of the more common attributes are:
AttributeDescriptionPossible Values
classUsed with Cascading Style Sheets (CSS)(the name of a predefined class)
styleUsed with Cascading Style Sheets (CSS)(You enter CSS code to specify how the way the HTML element is presented)
titleCan be used to display a "tooltip" for your elements.(You supply the text)
You don't need to fully comprehend these just yet. The good thing about attributes is that, in most cases, they are optional. Many HTML elements assign a default value to its attributes - meaning that, if you don't include that attribute, a value will be assigned anyway. Having said that, some HTML tags do require an attribute (such as the hyperlink example above).
You will see more attributes being used as we cover off some of the more advanced HTML elements.

HTML Formatting

You may be familiar with some of the formatting options that are available in word processing applications such as Microsoft Office, and desktop publishing software such as QuarkXpress. Well, many of these formatting features are available in HTML too! This lesson contains some of the more common formatting options.

Headings

There is a special tag for specifying headings in HTML. There are 6 levels of headings in HTML ranging from <h1> for the most important, to <h6> for the least important.
Here they are:
CodeResult

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

The <strong> Element

To place a strong importance on a piece of text, use the <strong> element.
CodeResult
Attention: Please leave the door open.

The <em> Element

You can place an emphasis on text by using the <em> element.
CodeResult
Strawberries are delicious!

Line Breaks

You can force a line break by using the <br> element.
CodeResult
Here is a
line break.

Horizontal Rule

You can create a horizontal rule by using the <hr> element.
CodeResult
Here's a horizontal rule...

...that was a horizontal rule :)

Unordered (un-numbered) List

To create an unordered list, use the <ul> element to define the list, and the <li> element for each list item.
CodeResult
  • List item 1
  • List item 2
  • List item 3

Ordered (numbered) List

To create an ordered list, use the <ol> element to define the list, and the <li> element for each list item.
Note, that the only difference between an ordered list and an unordered list is the first letter of the list definition ("o" for ordered, "u" for unordered).
CodeResult
  1. List item 1
  2. List item 2
  3. List item 3
We will be covering more HTML elements throughout this tutorial, but before we do that, you should know about attributes.