Category Archives: html

  • -

How to draw a triangle in html

Category : html

How to draw a triangle in html

Triangle

<canvas id=”canvas” width=”500″ height=”400″></canvas>
<script type=”text/javascript” charset=”utf-8″>// <![CDATA[
 var canvas = document.getElementById(‘canvas’);
 var context = canvas.getContext(‘2d’);
 context.fillStyle = “#fa7b08”;
 context.beginPath();
 context.moveTo(250, 100);
 context.lineTo(400, 230);
 context.lineTo(100, 230);
 context.closePath();
 context.fill();
 context.strokeStyle = “rgb(168, 8, 0)”;
 context.lineWidth = 10.0;
 context.stroke();
 context.beginPath();
 context.moveTo(0, 0);
 context.lineTo(400, 400);
 context.closePath();
// ]]></script>

In this example, I again create a context element with the canvas. However, this time, I declare a path fillStyle of #fa7b08 (a hue of orange), start a new subpath and move its starting location to the pixel coordinates of 250, 100 (right 250 pixels, down 100 pixels). From that point, I draw a line to the point 400, 230, and from there to 100, 230, creating the bottom of the triangle. From there, I close the path (back to 250, 100) and call fill to color the pixels within the triangle subpath to be colored #fa7b08. I also wanted to have a reddish outline, so I created a new strokeStyle with RGB colors (canvas also accepts hue, saturation, and lightness [HSL] values) with a line width of 10 pixels. Because the current subpath is still the triangle, I call stroke to trace the path with the color. The result is the triangle shown

 

 



  • 0

how to develop html editor in vb.net

Category : html

how to develop html editor in vb.net

Sample editor of HTML.

For more information:

Click here to download html editor


  • 0

how to use geolocation in html5

Category : html

How to use geolocation in html5

how to use geolocation in html5

 

 

 

 

 

 

 

 

There is given belwo syntax for location calculating in html5

Use the getCurrentPosition() method to get the user’s position.

Example
<script>
var x = document.getElementById(“demo”);
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
x.innerHTML = “Geolocation is not supported by this browser.”;
}
}
function showPosition(position) {
x.innerHTML = “Latitude: ” + position.coords.latitude +
“<br>Longitude: ” + position.coords.longitude;
}
</script>
Explanation:

First it would check the support for geolocation
If it is supported then run the getCurrentPosition() method.
If not, display a message to the user
If the getCurrentPosition() method is processed Then it returns a coordinates object
to the function specified in the parameter ( showPosition )
showPosition() function gets the displays the Latitude and Longitude

The getCurrentPosition() Method – Return Data

The getCurrentPosition() method returns an object if it is successful. The latitude, longitude and accuracy properties are always returned. The other properties below are returned if available.
Property Description
coords.speed The speed in meters per second
timestamp The date/time of the response
coords.longitude The longitude as a decimal number
coords.accuracy The accuracy of position
coords.altitude The altitude in meters above the mean sea level
coords.latitude The latitude as a decimal number
coords.altitudeAccuracy The altitude accuracy of position
coords.heading The heading as degrees clockwise from North

HTML5 TUTORIAL


  • 0

Difference between svg and canvass in html5

Category : html

Difference between svg and canvass in html5

 

 

 

 

 

 

 

 

What is SVG?

SVG graphics do NOT lose any quality if they are zoomed or resized.
Every element and every attribute in SVG files can be animated.
SVG is a W3C recommendation.
SVG stands for Scalable Vector Graphics.
SVG is used to define vector-based graphics for the Web.
SVG defines the graphics in XML format.
SVG Advantages

There are given below advantages of using SVG over other image formats are:

SVG images can be created and edited with any text editor
SVG images are zoomable .
Low text rendering capabilities.
We save resulting image as .jpg and .png
Well suited for graphic-intensive games.
It is Resolution dependent.
No support for event handlers.
SVG images can be searched, indexed, scripted, and compressed.
SVG images are scalable.
SVG images can be printed with high quality at any resolution.
Canvas
It is not appropriate for game applications
It is best for applications with large rendering areas (Google Maps)
If application is complex, it results in slow rendering
It is resolution independent
It Supports for event handlers.
Browser Support

They support all browsers.

New tags introduced in html5 for audio and video support extensibility
Tag Description
<embed> Defines an embedded object
<source> Defines multiple media resources for media elements- we can use it both for audio and video
<track> Defines text tracks for media elements- we can use it both for audio and video
<object> Defines an embedded object
<param> Defines a parameter for an object
<audio> Defines sound content
<video> Defines a video or movie

Difference between svg and canvass in html5

HTML5 TUTORIAL


  • 0

what is meaning of semantic elements in html5

Category : html

Why we use semantic elements in html5
what is meaning of semantic elements in html5

 

 

 

 

 

 

 

Semantic tags mean tags with meaning understood already.
A semantic elements defines meaning to all either they are users or software developer etc.
HTML5 offers new semantic elements to clearly define different parts of a web page:

<header>
<nav>
<section>
<article>
<figcaption>
<footer>
<details>
<summary>
<mark>
<time>
<aside>
<figure>

what is meaning of semantic elements in html5

Now all modern browsers support all html5 tags .

The <section> element defines a section in a document.
Below is an alphabetical list of the new semantic elements in HTML5.
Tag Description
<article> Defines an article
<aside> Defines content aside from the page content
<details> Defines additional details that the user can view or hide
<figcaption> Defines a caption for a <figure> element
<figure> Specifies self-contained content, like illustrations, diagrams, photos, code listings, etc.
<footer> Defines a footer for a document or section
<header> Specifies a header for a document or section
<main> Specifies the main content of a document
<mark> Defines marked/highlighted text
<nav> Defines navigation links
<datalist> Defines pre-defined options for input controls
<keygen> Defines a key-pair generator field (for forms)
<output> Defines the result of a calculation
<section> Defines a section in a document
<summary> Defines a visible heading for a <details> element
<time> Defines a date/time
<canvas> Defines graphic drawing using JavaScript

Audio support tags with their meaning :

 
WebM = WebM files with VP8 video codec and Vorbis audio codec

Ogg = Ogg files with Theora video codec and Vorbis audio codec

MP4 = MPEG 4 files with H264 video codec and AAC audio codec

How to use audio tags in html5

HTML5 defines a new element which specifies a standard way to embed an audio file on a web page: the <audio> element

<audio> src=”my.mp3″ type=”audio/mpeg”</audio>

<audio> src=”my.wav” type=”audio/wav”</audio>

<audio> src=”my.ogg” type=”audio/ogg”</audio>

 

source

HTML5 TUTORIAL


  • 0

new elements introduced in html5

Category : html

new elements introduced in html5

 

 

 

 

 

 

 

Removed Elements

The following HTML 4.01 elements has been removed from HTML5:

<acronym>

<applet>

<dir>

<font>

<tt>

<frame>

<frameset>

<noframes>

<basefont>

<big>

<center>

<strike>

New Semantic/Structural Elements

HTML5 offers new elements for better structure:
Tag Description

<mark> Defines marked or highlighted text

<menuitem> Defines a command/menu item that the user can invoke from a popup menu

<meter> Defines a scalar measurement within a known range (a gauge)

<nav> Defines navigation links in the document

<dialog> Defines a dialog box or window

<figcaption> Defines a caption for a <figure> element

<figure> Defines self-contained content, like illustrations, diagrams, photos, code listings, etc.

<footer> Defines a footer for the document or a section

<header> Defines a header for the document or a section

<main> Defines the main content of a document

<time> Defines a date/time

<wbr> Defines a possible line-break

<progress> Defines the progress of a task

<rp> Defines what to show in browsers that do not support ruby annotations

<rt> Defines an explanation/pronunciation of characters (for East Asian typography)

<ruby> Defines a ruby annotation (for East Asian typography)

<section> Defines a section in the document

<summary> Defines a visible heading for a <details> element

<article> Defines an article in the document

<aside> Defines content aside from the page content

<bdi> Defines a part of text that might be formatted in a different direction from other text outside it

<details> Defines additional details that the user can view or hide

HTML5 Audio Tags
Tag Description

<audio> Defines sound content

<source> Defines multiple media resources for media elements, such as <video> and <audio>

Media Types for Audio Formats

Ogg audio/ogg

Wav audio/wavFile Format Media Type

MP3 audio/mpeg

New Media Elements

Tag Description
<audio> Defines sound or music content

<embed> Defines containers for external applications (like plug-ins)

<source> Defines sources for <video> and <audio>

<track> Defines tracks for <video> and <audio>

<video> Defines video or movie content

New elements introduced in html5

source

HTML5 TUTORIAL


  • 0

why we use html5

Category : html

why we use html5

 

 

 

 

 

 

 

 

It is cross platform for designing and developing to work on pc,smartphone, laptop , tablet etc.

HTML5 is a cooperation the Web Hypertext
Application Technology Working Group (WHATWG)and between the World Wide Web Consortium (W3C).
WHATWG was working with web forms and applications, and W3C was working with XHTML 2.0.

HTML5 is the latest standard for HTML.

There are previous version of HTML, HTML 4.01, came in 1999, and the internet has changed significantly since then.

HTML5 was designed to replace both HTML 4, XHTML, and the HTML DOM Level 2.

It was programmed for the deliverabilty of extra plugins needed for music,movies,graphics,animation and web applications etc.

Why we use html5
Some rules for HTML5 were established:
New markups were introduced
New features based on HTML, CSS, DOM, and JavaScript were introduced.
New content-specific elements, like <article>, <footer>, <header>, <nav>, <section>

<canvas> element for 2D drawing
The <video> and <audio> elements for media playback
Support for local storage

New form controls, like calendar, date, time, email, url, searchHTML4/5 Reference

New Elements
2D/3D Graphics
Local Storage
Local SQL Database
Web Applications
New Attributes
Full CSS3 Support
Video and Audio
Browser Support for HTML5

All major browsers (Internet Explorer, Safari, Opera,Chrome, Firefox) support the new HTML5 elements and APIs, and continue to add new HTML5 features to their latest versions.

 

The HTML5 <!DOCTYPE>

In HTML5 there is only one DOCTYPE declaration, and it is very simple:
<!DOCTYPE html>

A Minimum HTML5 Document

Below is a simple HTML5 document, with the minimum of required tags:
<!DOCTYPE html>
<html>
<head>
<meta charset=”UTF-8″>
<title>Title of the document</title>
</head>

<body>
Content of the document……
</body>

</html>

HTML5 TUTORIAL


  • 0

how to use web storage in html5

Category : html

how to use web storage in html5

 

 

 

 

 

 

 

 

What is HTML5 Web Storage?

How to use web storage in html5

With HTML5, web pages can store data locally within the user’s browser.

HTML5 Web Storage provides two new objects for storing data on the client:

window.localStorage – stores data with no expiration date
code.sessionStorage – stores data for one session (data is lost when the tab is closed)

Before using web storage, check browser support for localStorage and sessionStorage:
if(typeof(Storage) !== “undefined”) {
// Code for localStorage/sessionStorage.
} else {
// commenting ! there is no support for web support. update your browser
}

The localStorage Object

The localStorage object stores the data with no expiration date. The data will not be deleted when the browser is closed, and will be available the next day, week, or year.
Example
// Store
localStorage.setItem(“lastname”, “josph”);
// Retrieve
document.getElementById(“result”).innerHTML = localStorage.getItem(“lastname”);
Exlanation:

It would generate a localStorage name/value pair with name=”lastname” and value=”josph”
Retrieve the value of “lastname” and insert it into the element with id=”result”

The example above could also be written like this:
// Store
localStorage.lastname = “josph”;
// Retrieve
document.getElementById(“result”).innerHTML = localStorage.lastname;

The syntax for removing the “lastname” localStorage item is as follows:
localStorage.removeItem(“lastname”);
The following example counts the number of times a user has clicked a button. In this code the value string is converted to a number to be able to increase the counter:

How to use web storage in html5
Example
if (localStorage.clickcount) {
localStorage.clickcount = Number(localStorage.clickcount) + 1;
} else {
localStorage.clickcount = 1;
}
document.getElementById(“result”).innerHTML = “You have clicked the button ” +
localStorage.clickcount + ” time(s).”;

how ot use SessionStorage Object

The sessionStorage object is equal to the localStorage object, except that it stores the data for only one session. The data is deleted when the user closes the browser window.

The following example counts the number of times a user has clicked a button, in the current session:
Example
if (sessionStorage.clickcount) {
sessionStorage.clickcount = Number(sessionStorage.clickcount) + 1;
} else {
sessionStorage.clickcount = 1;
}
document.getElementById(“result”).innerHTML = “You have clicked the button ” +
sessionStorage.clickcount + ” time(s) in this session.”;

Source

HTML5 TUTORIAL


  • 0

different audio and video formats used in html5

Category : html

different audio and video formats used in html5

 

 

 

 

 

 

 

 

Different audio and video formats used in html5

Format File Description
Flash .swf
.flv Flash was developed by Macromedia. Flash requires an extra component to play in a browser.
Ogg .ogg Theora Ogg was developed by the Xiph.Org Foundation.
WebM .webm WebM is a project by the web giants, Mozilla, Opera, Adobe, and Google.
MPEG .mpg
.mpeg MPEG, developed by the Moving Pictures Expert Group, used to be the most popular video format on the Internet. It used to be supported by all major browsers, but it is not supported by HTML5.
MPEG-4
or MP4 .mp4 MP4 is the upcoming format on the internet. It is supported by all major browsers in HTML5. YouTube recommends using MP4, and it is commonly used in newer video cameras and TV hardware.

Note Only MP4, WebM, and Ogg video is supported by the newest HTML5 standard.
AVI .avi AVI (Audio Video Interleave) was developed by Microsoft, and is therefore playable on all Windows computers. It is commonly used in video cameras and TV hardware, but is difficult to play on non-Windows computers.
WMV .wmv WMV (Windows Media Video) was developed by Microsoft, and is therefore playable on all Windows computers. It is commonly used in video cameras and by TV hardware, but is difficult to play on non-Windows computers.
QuickTime .mov QuickTime was developed by Apple, and
is therefore playable on all Apple computers.
It is commonly used in video cameras and by TV hardware, but is difficult to play on non-Apple computers.
RealVideo .rm
.ram RealVideo was developed by Real Media to allow video streaming with low bandwidths. It is still used for online video and Internet TV, but because of the low bandwidth priority, the quality is also low.

 
Sound Formats

MP3 is the newest format for compressed recorded music.

If your website is about recorded music, MP3 is the choice.
Format File Description
MIDI .mid
When we sould use midi file it is used for minimum play duration like 4 or 5 minutes.
.midi MIDI (Musical Instrument Digital Interface) is a format for electronic music devices like synthesizers and PC sound cards. MIDI files do not contain sound, but digital musical instructions (notes) that can be played by electronics (like your PC’s sound card).
Because it is the main format for binary music, it is supported by most software, including Internet browsers.
RealAudio .rm
WAV .wav WAVE (more known as WAV) was developed by IBM and Microsoft. WAV is compatible with Windows, Macintosh, and Linux operating systems, but is not supported by Internet Explorer in HTML5.
Ogg .ogg Ogg was developed by the Xiph.Org Foundation. Ogg is designed to provide for efficient streaming and manipulation of high quality digital multimedia.
MP3 .mp3 MP3 files are actually the sound part of MPEG files. MP3 is the most popular format for music players. The encoding system combines good compression (small files) with high quality. It is supported by all major browsers.
MP4 .mp4 MP4 is a video format, but it can also be used with audio only. MP4 video is the upcoming video format on the internet. This can lead to an automatic support for MP4 audio by all major browsers.
ram RealAudio was developed Real Media to allow streaming of audio (online music, Internet radio) with low bandwidths.
WMA .wma WMA (Windows Media Audio), compares in quality to MP3, and is compatible with most music players, except the iPod. WMA files can be delivered as a continuous flow of data, which makes it practical for use in Internet radio or on-line music.
AAC .aac AAC (Advanced Audio Coding) was developed by Apple as the default format for iTunes.

source

HTML5 TUTORIAL


  • 0

how to pass odesk 4.01 test

Category : html

how to pass odesk 4.01 test

how to pass odesk 4.01 test how to pass odesk 4.01 test how to pass odesk 4.01 test how to pass odesk 4.01 test how to pass odesk 4.01 test how to pass odesk 4.01 test


for more go to wikipedia


Fatal error: Call to undefined function weblizar_navigation() in /home/websolutionsdone/public_html/wp-content/themes/ielts-career/category.php on line 23