Top 10 HTML questions and answers

Updated: 07/13/2023 by Computer Hope

How do I add midi music to my web page?

Use the tag below.

<bgsound src="music.mid" loop="1">

The tag above plays the music.mid once. If you want this song to continue without stopping, use loop="infinite" instead of loop="1", which only plays it once. To get this to work with Netscape and Internet Explorer, use the embed tag similar to the example below.

<embed src="canyon.mid" Autostart=TRUE Width=145 Height=60 Loop=true>

Which would give you the example below.

How do I make a picture as a background on my web pages?

Point the body background to the name of your image you want to use as the background, as shown below. This body line should be the first line after your </head> tag.

<body background="picture.gif">

The background image can also be fixed, so it does not move when using the scroll bar in the browser. To do this, add the BGPROPERTIES tag as shown below.

<body background="picture.gif" bgproperties="fixed">

How do I make it so that someone can mail me by clicking text?

Use the mailto command in your a href link tag as shown below.

<a href="mailto:[email protected]">Mail Computer Hope</a>

The example above would create a link similar to the one shown below.

Mail Computer Hope

How do I add scrolling text to my page?

Realize not all browsers support scrolling text. However, to do this add a tag similar to the example below.

<marquee>THIS WOULD SCROLL</marquee>

The example above would create the below scrolling text. If your browser supports scrolling text, the example below should be scrolling.

THIS WOULD SCROLL

See our <marquee> tag for further information on this HTML (hypertext markup language) tag.

How do I do multiple colors of text?

To do the multicolor text, adjust the color of your font tag as shown below.

<span style="color:blue">blue</span>

The example above would make the text blue. In fact, all the major colors are usable. See our list of all valid colors for other color options.

Note

In the past, it was common to use the <font> tag to change text properties, including text color. The <font> tag is deprecated in modern HTML, however. Always use CSS (cascading style sheets) to change your font colors, as in the example above. For help with changing the font properties, see: How to change the font type, size, and color on a web page.

How do I make a picture a link?

Use the a href link tag around the img tag as shown below.

<a href="https://www.computerhope.com"><img src="https://www.computerhope.com/cdn/computer-hope.jpg"></a>

The example above would give you the below clickable image link.

Computer Hope free help

How can I make my link not have this ugly border?

Add the border:"none" style to your img tag as shown below.

<a href="https://www.computerhope.com"><img src="https://www.computerhope.com/cdn/computer-hope.jpg" style="border:none"></a>

The code above would give you the example below.

Computer Hope

How do I make it so that my web page is one solid color in the background without using an image file?

Change the "bgcolor" (short for background color) in your body tag as shown below.

<body bgcolor="white">

The example above makes the background of the page white. However, you could do blue, red, or any HTML color codes.

How do I align pictures so that one may be higher or lower than the other?

Use the align statement in your img src tag as shown below.

<img src="https://www.computerhope.com/chguy.gif" style="vertical-align:top">

Anything after the image is aligned to the top of the image, as shown below.

CH GuyComputer Hope top logo

Also, instead of top, the middle or bottom value can be set, and other values.

How do I make a link to another web page?

Specify the complete URL (uniform resource locator) in the a href tag as shown below.

<a href="https://www.computerhope.com">Visit ComputerHope</a>

Replace our address with the address you want to link. Where it says "Visit ComputerHope," replace this with what you want to name the link.