Monday, 16 December 2013

Tags of HTML 5-Part 2nd

(6)time:It defines either a time (24 hour clock), or a date in the Gregorian calendar, optionally with a time and a time-zone offset.

Example:-

<!DOCTYPE html>
<html>
<body>

<p>We open at <time>10:00</time> every morning.</p>

<p>I have a date on <time datetime="2008-02-14">Valentines day</time>.</p>

<p><b>Note:</b> The time element does not render as anything special in any of the major browsers.</p>

</body>
</html>

This element can be used as a way to encode dates and times in a machine-readable way so that, for example, user agents can offer to add birthday reminders or scheduled events to the user's calendar, and search engines can produce smarter search results.

(7)datetime:The datetime attribute gives the date or time being specified. This attribute is used if no date or time is specified in the element's content.

Example:-

<!DOCTYPE html>
<html>
<body>

<p>I have a date on <time datetime="2008-02-14">Valentines day</time>.</p>

<p><b>Note:</b> The time element does not render as anything special in any of the major browsers.</p>

</body>
</html>

Note:-
(1)Date-Time format should be like YYYY-MM-DDThh:mm:ssTZD

(1)The date or time being specified. Explanation of components:
  • YYYY - year (e.g. 2011)
  • MM - month (e.g. 01 for January)
  • DD - day of the month (e.g. 08)
  • T - a required separator if time is also specified
  • hh - hour (e.g. 22 for 10.00pm)
  • mm - minutes (e.g. 55)
  • ss - seconds (e.g. 03)
  • TZD - Time Zone Designator (Z denotes Zulu, also known as Greenwich Mean Time)


 (8)wbr:The <wbr> (Word Break Opportunity) tag specifies where in a text it would be ok to add a line-break.

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.

Example:-

<!DOCTYPE html>
<html>
<body>

<p>Try to shrink the browser window, to view how the word "XMLHttpRequest" in
the paragraph below will break:</p>

<p>To learn AJAX, you must be familiar with the XML<wbr>Http<wbr>Request Object.</p>

<p><b>Note:</b> The wbr element is not supported in IE.</p>

</body>
</html>

(9)datalist:The <datalist> tag specifies a list of pre-defined options for an <input> element.

The <datalist> tag is used to provide an "autocomplete" feature on <input> elements. Users will see a drop-down list of pre-defined options as they input data.

Use the <input> element's list attribute to bind it together with a <datalist> element.

 Example:-

<!DOCTYPE html>
<html>
<body>

<form action="" method="get">
<input list="browsers" name="browser">
<datalist id="browsers">
  <option value="Internet Explorer">
  <option value="Firefox">
  <option value="Chrome">
  <option value="Opera">
  <option value="Safari">
</datalist>
<input type="submit">
</form>

<p><strong>Note:</strong> The datalist tag is not supported in Internet Explorer 9 and earlier versions, or in Safari.</p>

</body>
</html>

(10)keygen:This tag specifies a key-pair generator field used for forms.

When the form is submitted, the private key is stored locally, and the public key is sent to the server.

 Example:-

<!doctype html>

<html>
<body>

<form action="#" method="get">
 Username:<input type="text" name="usr_name">
 Encryption:<keygen name="security">
 <input type="submit">
</form>
</body>
</html>

No comments:

Post a Comment