Archive for June, 2012

[ Tag ] data, datalist – CEH – Saher Team

Posted in HTML/HTML5 with tags , , , , , , , on June 27, 2012 by saherteam

[ Tag ] data, datalist – CEH – Saher Team.

 

The HTML <datalist> tag is used for providing an “autocomplete” feature on form elements. It enables you to provide
a list of predefined options to the user as they input data.For example, if a user began entering some text into a text field,
a list would drop down with prefilled values that they could choose from.

Usage

The <datalist> tag can be used in conjunction with an <input> element that contains a list attribute.
The list attribute is linked to the <datalist> tag by the <datalist> tag’s ID. For example, if the <datalist> tag
contains id=”myData”, then the list attribute will look like this: list=”myData”.You can fill the <datalist> element by nesting
<option> tags inside the <datalist> tag. The <datalist> tag was introduced in HTML 5.

Example

In the pane below, you will find two examples.

Example 1 (for HTML 5 browsers): Demonstrates usage for browsers that support the datalist element.
If when viewing/using this example, you don’t see the “autocomplete” feature (containing the contents of the <option> tags),
your browser doesn’t support the datalist element.

Example 2 (for both legacy and HTML 5 browsers): Demonstrates how to provide the autocomplete values to users whose browsers
don’t support this element, as well as to those that do. You can place fallback content between the datalist tags. This content
will be only be displayed to browsers that don’t support the datalist element. On browsers that do support this tag, the autocomplete
feature will work as it is supposed to.

The datalist element represents a set of option elements that represent predefined options for other controls.
The contents of the element represents fallback content for legacy user agents, intermixed with option elements
that represent the predefined options. In the rendering, the datalist element represents nothing and it, along with
its children, should be hidden.The datalist element is hooked up to an input element using the list attribute on
the input element.

[ Tag ] dl, dt, dfn, dd – CEH – Saher Team

Posted in Others with tags , , , on June 26, 2012 by saherteam

[ Tag ] dl, dt, dfn, dd – CEH – Saher Team.

 

The HTML <dd> tag is used for specifying a definition description in a definition list.
A definition list is similar to other lists but in a definition list, each list item contains
two or more entries; a term and at least one description.

The <dd> tag is used to describe an item in a definition list.
The <dd> tag is used in conjunction with <dl> (defines the definition list)
and <dt> (defines the item in the list).
Inside a <dd> tag you can put paragraphs, line breaks, images, links, lists, etc.

Note
that the definition term can be linked to more than one description.

Also see HTML dl tag and HTML dt tag

Example
Here are two examples of <dl> usage.

Example 1: Contains a list of terms and their definitions.
Example 2: Here, a term is linked to three values.

[ Tag ] command – CEH – Saher Team

Posted in HTML/HTML5 on June 26, 2012 by saherteam

[ Tag ] command – CEH – Saher Team.

 

The command element represents a command that the user can invoke. A command can be part of a
context menu or toolbar, using the menu element, or can be put anywhere else in the page, to
define a keyboard shortcut.

The HTML <command> tag is used for specifying a command that the user can invoke.

According to the HTML 5 specification:

A command is the abstraction behind menu items, buttons, and links. Once a command is defined,
other parts of the interface can refer to the same command, allowing many access points to a single
feature to share aspects such as the disabled state.
The <command> tag was introduced in HTML 5.

Attribute:

type
Specifies the type of command.

Possible values:

command (default value)
checkbox
radio

label
Specifies the name of the command, as shown to the user.

icon
Specifies the URI (or IRI) of graphical image that represents the action.

disabled
Specifies if the command is disabled or not.This is a boolean attribute. If the attribute is present,
its value must either be the empty string or a value that is an ASCII case-insensitive match for the
attribute’s canonical name, with no leading or trailing whitespace (i.e. either disabled or disabled=”disabled”).

Possible values:

[Empty string]
disabled

checked
Indicates whether the command is selected or not.This is a boolean attribute. If the attribute is present,
its value must either be the empty string or a value that is an ASCII case-insensitive match for the attribute’s
canonical name, with no leading or trailing whitespace (i.e. either checked or checked=”checked”).

Possible values:

[Empty string]
checked

radiogroup
Specifies the name of the group of commands that will be toggled when the command itself is toggled,
for commands whose type attribute has the value “radio”.command Here’s what the HTML5 specification says
about the command attribute:

If a <command> element slave has a command attribute, and slave is in a Document, and there is an element
in that Document whose ID has a value equal to the value of slave’s command attribute, and the first such
element in tree order, hereafter master, itself defines a command and either is not a <command> element or
does not itself have a command attribute, then the master command of slave is master.

An element with a command attribute must have a master command and must not have any type,
label, icon, disabled, checked, or radiogroup attributes.

title
Specifies a hint describing the command, which can be shown to the user.

[ شرح ] PHP – Intro to OOP – P:7 – Creating Function with Return Value – CEH – Saher Team

Posted in PHP Programming on June 24, 2012 by saherteam

[ شرح ] PHP – Intro to OOP – P:7 – Creating Function with Return Value – CEH – Saher Team.

[ Tag ] caption – CEH – Saher Team

Posted in HTML/HTML5 on June 23, 2012 by saherteam

[ Tag ] caption – CEH – Saher Team.

 
The HTML <caption> tag is used for creating table captions. It is used in conjunction with the <table> tag and
represents the title of the table. The <caption> tag must be inserted immediately after the <table> tag.
A table should have no more than one caption.

The caption element represents the title of the table that is its parent, if it has a parent and that is a table element.
When a table element is the only content in a figure element other than the figcaption, the caption element should be
omitted in favor of the figcaption.

Definition and Usage

The <caption> tag defines a table caption.
The <caption> tag must be inserted immediately after the <table> tag. You can specify only one caption per table.

Tip:

By default, the table caption will be center-aligned above a table. However, the CSS properties
“text-align” and “caption-side” can be used to align and place the caption.

Differences Between HTML 4.01 and HTML5
The “align” attribute which was deprecated in HTML 4.01, is not supported in HTML5. Use CSS instead.

[ Tag ] canvas – CEH – Saher Team

Posted in HTML/HTML5 with tags , , , , , , on June 23, 2012 by saherteam

[ Tag ] canvas – CEH – Saher Team.

 

Represents a resolution-dependent bitmap canvas, which can be used for rendering graphs,
game graphics, or other visual images on the fly. Authors should not use the canvas element
in a document when a more suitable element is available. For example, it is inappropriate to
use a canvas element to render a page heading. If the desired presentation of the heading is
graphically intense, it should be marked up using appropriate elements (typically h1) and then
styled using CSS and supporting technologies such as XBL.

When authors use the canvas element, they must also provide content that, when presented to the user,
conveys essentially the same function or purpose as the bitmap canvas. This content should be nested
within the canvas element as a fallback.

The HTML <canvas> tag is used for creating graphics on the fly. It can be used for rendering graphs,
game graphics, or other visual images.To draw on the canvas, the <canvas> tag is used in conjunction
with the getContext(contextId) method.Any content between the <canvas></canvas> tags is “fallback content”-
meaning, it will be displayed only if the canvas cannot be displayed.

The <canvas> tag was introduced in HTML 5.

The <canvas> tag is supported in Internet Explorer 9, Firefox, Opera, Chrome, and Safari.
The <canvas> tag is used to draw graphics, on the fly, via scripting (usually JavaScript).
The <canvas> tag is only a container for graphics, you must use a script to actually draw the graphics.

Note: Internet Explorer 8 and earlier versions, do not support the <canvas> tag.

Definition and Usage

canvas> has a wealth of features, like:

drawing shapes,
filling colours,
creating gradients and patterns,
rendering text,
copying images, video frames, and other canvases,
manipulating pixels, and
exporting the contents of a <canvas> to a static file.

In fact, the canvas API is so interesting, I wouldn’t be surprised to see entire books dedicated to it (and no, I don’t plan to write that book!).
It’s important when working with <canvas> to treat it like a real painting canvas. Say you lay down a strip of red paint on a real canvas.
If you paint over it in blue, you can’t get back to your original red paint. It’s the same with the canvas element. There’s no concept of
layers. The <canvas> element is a bitmap drawing API, and once you’ve committed to a set of pixels, you’re stuck with them.

Before we dive in to the canvas API, I want to remind you to make sure you’re using
the right technology for the job.

SVG is the alternative drawing API. It’s vector-based and does support layers.
SVG also exists in the DOM, making it easy to attach event handlers for interactivity,
and it’s easier to deal with collision detection (in games, for example). It also supports
animation either through SMIL or JavaScript. There’s an excellent JavaScript library called
Raphaël that uses SVG to render images and animations.

The <canvas> element is good for pixel manipulation and highly active animations.
Brad Neuberg does a really good job of explaining the differences in his Google IO
talk from back in 2009.

With all that in mind, let’s crack on with the canvas API.

Four of the Big Five browsers support canvas. We’re naturally missing IE8, but there’s hope: IE9 does support canvas. In fact, it supports hardware accelerated drawing to the canvas — other browsers currently don’t, making IE9 preview 3 the fastest (canvas) kid on the block!

Tips and Notes

Note:

Any text inside the <canvas> element will be displayed in browsers that does not support <canvas>.

Tip:

For a complete reference of all the attributes and methods that can be used with the canvas object,
go to our complete canvas 2d reference.

Attribute:

height
pixels Specifies the height of the canvas
width
pixels Specifies the width of the canvas

<!DOCTYPE html>
<html lang="en">
<head>
<script type="application/x-javascript">
function displayCanvas()
	{
      var canvas = document.getElementById("myCanvas");
      if (canvas.getContext) {
        var ctx = canvas.getContext("2d");

        ctx.fillStyle = "rgb(200,0,0)";
        ctx.fillRect (0, 0, 150, 75);

        ctx.fillStyle = "rgba(0, 0, 200, 0.5)";
        ctx.fillRect (40, 30, 125, 75);

        ctx.fillStyle = "rgb(0,0,154)";
        ctx.strokeRect (20, 20, 50, 100); 
      }
    }
</script>
</head>

<body onload="displayCanvas();">
<canvas id="myCanvas" width="300" height="200">
Your browser does not support the canvas tag. At the time of writing, 
Firefox, Opera, and Chrome support this tag.</p> 
<p>Here's an <a href="/pix/html_5/tags/html_canvas_tag.gif">
image of what it's supposed to look like</a>.
</canvas>
</body>
</html>

[ Tag ] button – CEH – Saher Team

Posted in HTML/HTML5 on June 23, 2012 by saherteam

[ Tag ] button – CEH – Saher Team.

[ HTML5 ] HTML5 A vocabulary and associated APIs for HTML and XHTML – CEH – Saher Team

Posted in HTML/HTML5 on June 23, 2012 by saherteam

[ HTML5 ] HTML5 A vocabulary and associated APIs for HTML and XHTML – CEH – Saher Team.

[ Tag ] blockquote – CEH – Saher Team

Posted in HTML/HTML5 on June 22, 2012 by saherteam

[ Tag ] blockquote – CEH – Saher Team.

[ Tag ] bdi, bdo – CEH – Saher Team

Posted in HTML/HTML5 with tags , , , on June 22, 2012 by saherteam

[ Tag ] bdi, bdo – CEH – Saher Team.