Sunday, July 10, 2022

HTML applet Tag

HTML applet Tag

HTML <applet> Tag

 

Not Supported in HTML5.

The <applet> tag was used in HTML 4 to define an embedded applet (Plug-in).


Plug-ins

Plug-ins are a computer programs that extend the standard functionality of the browser.

Plug-ins have been used for many different purposes:

  • Run Java applets
  • Run ActiveX controls
  • Display Flash movies
  • Display maps
  • Scan for viruses
  • Verify a bank id

Most browsers no longer support Java Applets and Plug-ins.

ActiveX controls are no longer supported in any browsers.

The support for Shockwave Flash has also been turned off in modern browsers.

What to Use Instead?

If you want to embed a video, use the <video> tag:

Example

<video width="320" height="240" controls>
  <source src="movie.mp4" type="video/mp4">
  <source src="movie.ogg" type="video/ogg">
  Your browser does not support the video tag.
</video>
Try it Yourself »

If you want to embed audio, use the <audio> tag:

Example

<audio controls>
  <source src="horse.ogg" type="audio/ogg">
  <source src="horse.mp3" type="audio/mpeg">
  Your browser does not support the audio tag.
</audio>
Try it Yourself »

To embed objects, you can use both the <embed> tag and the <object> tags:

Example

Embed a document with the <embed> element:

<embed src="snippet.html">
Try it Yourself »

Example

Embed a picture with the <embed> element:

<embed src="pic_trulli.jpg">
Try it Yourself »

Example

Embed a document with the <object> element:

<object data="snippet.html"></object>
Try it Yourself »

Example

Embed a picture with the <object> element:

<object data="pic_trulli.jpg"></object>
Try it Yourself »
Tip: To embed a picture, it is better to use the <img> tag. To embed a document, it is better to use the <iframe> tag.

HTML <address> Tag

HTML
Tag


 

Example

Contact information for Example.com:

<address>
Written by <a href="mailto:webmaster@example.com">Jon Doe</a>.<br>
Visit us at:<br>
Example.com<br>
Box 564, Disneyland<br>
USA
</address>
Try it Yourself »

Definition and Usage

The <address> tag defines the contact information for the author/owner of a document or an article.

The contact information can be an email address, URL, physical address, phone number, social media handle, etc.

The text in the <address> element usually renders in italic, and browsers will always add a line break before and after the <address> element.

Global Attributes

The <address> tag also supports the Global Attributes in HTML.

Event Attributes

The <address> tag also supports the Event Attributes in HTML.

Related Pages

HTML DOM reference: Address Object

Default CSS Settings

Most browsers will display the <address> element with the following default values:

Example

address {
  display: block;
  font-style: italic;
}
Try it Yourself »
HTML <acronym> Tag

HTML Tag


 

Not Supported in HTML5.

The <acronym> tag was used in HTML 4 to define an acronym.


What to Use Instead?

Example

An acronym or abbreviation should be marked up with the <abbr> tag:

The <abbr title="World Health Organization">WHO</abbr> was founded in 1948.
Try it Yourself »

Saturday, July 9, 2022

HTML   Tag a

HTML Tag a


HTML  <a>  Tag

Example

Create a link to W3Schools.com:

<a href="https://www.w3schools.com">Visit W3Schools.com!</a>
Try it Yourself »

More "Try it Yourself" examples below.


Definition and Usage

The <a> tag defines a hyperlink, which is used to link from one page to another.

The most important attribute of the <a> element is the href attribute, which indicates the link's destination.

By default, links will appear as follows in all browsers:

  • An unvisited link is underlined and blue
  • A visited link is underlined and purple
  • An active link is underlined and red

Tips and Notes

Tip: If the <a> tag has no href attribute, it is only a placeholder for a hyperlink.

Tip: A linked page is normally displayed in the current browser window, unless you specify another target.

Tip: Use CSS to style links: CSS Links and CSS Buttons.

Global Attributes

The <a> tag also supports the Global Attributes in HTML.


Event Attributes

The <a> tag also supports the Event Attributes in HTML.

More Examples

Example

How to use an image as a link:

<a href="https://www.w3schools.com">
<img border="0" alt="W3Schools" src="logo_w3s.gif" width="100" height="100">
</a>
Try it Yourself »

Example

How to open a link in a new browser window:

<a href="https://www.w3schools.com" target="_blank">Visit W3Schools.com!</a>
Try it Yourself »

Example

How to link to an email address:

<a href="mailto:someone@example.com">Send email</a>
Try it Yourself »

Example

How to link to a phone number:

<a href="tel:+4733378901">+47 333 78 901</a>
Try it Yourself »

Example

How to link to another section on the same page:

<a href="#section2">Go to Section 2</a>
Try it Yourself »

Example

How to link to a JavaScript:

<a href="javascript:alert('Hello World!');">Execute JavaScript</a>
Try it Yourself »

Related Pages

HTML tutorial: HTML Links

HTML DOM reference: Anchor Object

CSS Tutorial: Styling Links


Default CSS Settings

Most browsers will display the <a> element with the following default values:

a:link, a:visited {
  color: (internal value);
  text-decoration: underline;
  cursor: auto;
}

a:link:active, a:visited:active {
  color: (internal value);
} 

Friday, July 8, 2022

HTML <abbr> Tag

HTML Tag


Example

An abbreviation is marked up as follows:

The <abbr title="World Health Organization">WHO</abbr> was founded in 1948.
Try it Yourself »

More "Try it Yourself" examples below.


Definition and Usage

The <abbr> tag defines an abbreviation or an acronym, like "HTML", "CSS", "Mr.", "Dr.", "ASAP", "ATM".

Tip: Use the global title attribute to show the description for the abbreviation/acronym when you mouse over the element.

Global Attributes

The <abbr> tag supports the Global Attributes in HTML.


Event Attributes

The <abbr> tag supports the Event Attributes in HTML.


More Examples

Example

 <abbr> can also be used with <dfn> to define an abbreviation:

<p><dfn><abbr title="Cascading Style Sheets">CSS</abbr>
</dfn> is a language that describes the style of an HTML document.</p>
Try it Yourself »

Related Pages

HTML DOM reference: Abbreviation Object


Default CSS Settings

Most browsers will display the <abbr> element with the following default values:

Example

abbr {
  display: inline;
}
Try it Yourself » 
HTML <!DOCTYPE> Declaration

HTML Declaration


 

Example

<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>

<body>
The content of the document......
</body>

</html>
Try it Yourself »

Definition and Usage

All HTML documents must start with a <!DOCTYPE> declaration.

The declaration is not an HTML tag. It is an "information" to the browser about what document type to expect.

In HTML 5, the declaration is simple:

<!DOCTYPE html>

Browser Support

Element
<!DOCTYPE>YesYesYesYesYes

Older HTML Documents

In older documents (HTML 4 or XHTML), the declaration is more complicated because the declaration must refer to a DTD (Document Type Definition).

HTML 4.01:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

XHTML 1.1:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

HTML Elements and Doctypes

Look at our table of all HTML elements, and what Doctype each element appears in.


Tips and Notes

Tip: The <!DOCTYPE> declaration is NOT case sensitive.

Examples

<!DOCTYPE html>
<!DocType html>
<!Doctype html>
<!doctype html>
HTML <!--...--> Tag

HTML Tag


Example

An HTML comment:

<!--This is a comment. Comments are not displayed in the browser-->

<p>This is a paragraph.</p>
Try it Yourself »

Definition and Usage

The comment tag is used to insert comments in the source code. Comments are not displayed in the browsers.

You can use comments to explain your code, which can help you when you edit the source code at a later date. This is especially useful if you have a lot of code.

Browser Support

Element
<!--...-->YesYesYesYesYes

Tips and Notes

You can use the comment tag to "hide" scripts from browsers without support for scripts (so they don't show them as plain text):

<script type="text/javascript">
<!--
function displayMsg() {
  alert("Hello World!")
}
//-->

</script> 

Note: The two forward slashes at the end of comment line (//) is the JavaScript comment symbol. This prevents JavaScript from executing the --> tag.

Standard Attributes

The comment tag does not support any standard attributes.

More information about Standard Attributes.

Event Attributes

The comment tag does not support any event attributes.

More information about Event Attributes.