Breaking

Showing posts with label w3schools content. Show all posts
Showing posts with label w3schools content. Show all posts

Sunday, May 12, 2019

May 12, 2019

HTML wbr Tag


Example

A text with word break opportunities:
<p>
To learn AJAX, you must be familiar with the XML<wbr>Http<wbr>Request Object.
</p>
Try it Yourself »

Definition and Usage

The <wbr> (Word Break Opportunity) tag specifies where in a text it would be ok to add a line-break.
Tip: When a word is too long, or you are afraid that the browser will break your lines at the wrong place, you can use the <wbr> element to add word break opportunities.

Browser Support

The numbers in the table specify the first browser version that fully supports the element.
Element
<wbr>1.012.03.04.011.7

Differences Between HTML 4.01 and HTML5

The <wbr> tag is new in HTML5.

Global Attributes

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

Event Attributes

The <wbr> tag also supports the Event Attributes in HTML.
May 12, 2019

HTML video Tag

Example

Play a video:
<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 »

Definition and Usage

The <video> tag specifies video, such as a movie clip or other video streams.
Currently, there are 3 supported video formats for the <video> element: MP4, WebM, and Ogg:
BrowserMP4WebMOgg
Internet ExplorerYESNONO
ChromeYESYESYES
FirefoxYES
from Firefox 21
from Firefox 30 for Linux
YESYES
SafariYESNONO
OperaYES
From Opera 25
YESYES
  • MP4 = MPEG 4 files with H264 video codec and AAC audio codec
  • WebM = WebM files with VP8 video codec and Vorbis audio codec
  • Ogg = Ogg files with Theora video codec and Vorbis audio codec

MIME Types for Video Formats

FormatMIME-type
MP4video/mp4
WebMvideo/webm
Oggvideo/ogg


Browser Support

The numbers in the table specify the first browser version that fully supports the element.
Element
<video>4.09.03.54.010.5

Differences Between HTML 4.01 and HTML5

The <video> tag is new in HTML5.

Tips and Notes

Tip: Any text between the <video> and </video> tags will be displayed in browsers that do not support the <video> element.

Optional Attributes

AttributeValueDescription
autoplayautoplaySpecifies that the video will start playing as soon as it is ready
controlscontrolsSpecifies that video controls should be displayed (such as a play/pause button etc).
heightpixelsSets the height of the video player
looploopSpecifies that the video will start over again, every time it is finished
mutedmutedSpecifies that the audio output of the video should be muted
posterURLSpecifies an image to be shown while the video is downloading, or until the user hits the play button
preloadauto
metadata
none
Specifies if and how the author thinks the video should be loaded when the page loads
srcURLSpecifies the URL of the video file
widthpixelsSets the width of the video player

Global Attributes

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

Event Attributes

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

Related Pages

HTML DOM reference: HTML Audio/Video DOM Reference

Default CSS Settings

None.
May 12, 2019

HTML var Tag



Example

Format text in a document:
<var>Variable</var>
Try it Yourself »

Definition and Usage

The <var> tag is a phrase tag. It defines a variable.
Tip: This tag is not deprecated, but it is possible to achieve richer effect with CSS.
All phrase tags:
TagDescription
<em>Renders as emphasized text
<strong>Defines important text
<code>Defines a piece of computer code
<samp>Defines sample output from a computer program
<kbd>Defines keyboard input
<var>Defines a variable

Browser Support

Element
<var>YesYesYesYesYes

Differences Between HTML 4.01 and HTML5

NONE.


Global Attributes

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

Event Attributes

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

Related Pages

HTML tutorial: HTML Text Formatting
HTML DOM reference: Variable Object

Default CSS Settings

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

Example

var { 
  font-style: italic;
}
Try it Yourself »

May 12, 2019

HTML ul Tag


Example

An unordered HTML list:
<ul>
  <li>Coffee</li>
  <li>Tea</li>
  <li>Milk</li>
</ul>
Try it Yourself »
More "Try it Yourself" examples below.

Definition and Usage

The <ul> tag defines an unordered (bulleted) list.
Use the <ul> tag together with the <li> tag to create unordered lists.

Browser Support

Element
<ul>YesYesYesYesYes

Tips and Notes

Tip: Use CSS to style lists.
Tip: To create ordered lists, use the <ol> tag.

Differences Between HTML 4.01 and HTML5

The "compact" and "type" attributes are not supported in HTML5.


Attributes

AttributeValueDescription
compactcompactNot supported in HTML5.
Specifies that the list should render smaller than normal
typedisc
square
circle
Not supported in HTML5.
Specifies the kind of marker to use in the list

Global Attributes

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

Event Attributes

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

Try it Yourself - Examples

A nested list
A list inside a list.
Another nested list
A more complicated nested list.

Related Pages

HTML tutorial: HTML Lists
HTML DOM reference: Ul Object
CSS Tutorial: Styling Lists

Default CSS Settings

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

Example

ul { 
  display: block;
  list-style-type: disc;
  margin-top: 1em;
  margin-bottom: 1 em;
  margin-left: 0;
  margin-right: 0;
  padding-left: 40px;
}
Try it Yourself »

May 12, 2019

HTML u Tag

Example

Underline a misspelled word with the <u> tag:
<p>This is a <u>parragraph</u>.</p>
Try it Yourself »

Definition and Usage

The <u> tag represents some text that should be stylistically different from normal text, such as misspelled words or proper nouns in Chinese.

Browser Support

Element
<u>YesYesYesYesYes

Tips and Notes

Tip: Avoid using the <u> element where it could be confused for a hyperlink.
Note: The HTML 5 specification reminds developers that other elements are almost always more appropriate than <u>.

Differences Between HTML 4.01 and HTML5

The <u> element was deprecated in HTML 4.01. (the <u> element was used to define underlined text).
The <u> element is redefined in HTML5, to represent text that should be stylistically different from normal text, such as misspelled words or proper nouns in Chinese.


Global Attributes

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

Event Attributes

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

Related Pages

HTML tutorial: HTML Text Formatting
HTML DOM reference: Underline Object

Default CSS Settings

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

Example

{
  text-decoration: underline;
}
Try it Yourself »


May 12, 2019

HTML tt Tag


Example

Define teletype text:
<p><tt>Teletype text</tt></p>
Try it Yourself »

Definition and Usage

The <tt> tag is not supported in HTML5.
If <tt> was used for marking up keyboard input, consider the <kbd> element; for variables, consider the <var> element; for computer code, consider the <code> element; and for computer output, consider the <samp> element, or use CSS instead.
The <tt> tag defines teletype text.

Browser Support

Element
<tt>YesYesYesYesYes

Compatibility Notes

CSS syntax: <p style="font-family:'Lucida Console', monospace">
In our CSS tutorial you can find more details about specifying the type of font in a document.

Differences Between HTML 4.01 and HTML5

The <tt> tag is not supported in HTML5.