
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 2202 Articles for HTML

2K+ Views
The date picker in HTML5 basically works very similar to how the JavaScript Libraries did, when we focus on the field a calendar will pop out, and then we can navigate through the months and years to select the date.Therefore, if you want the date input to use more spacing and a color scheme you could add the following to your code.::-webkit-datetime-edit { padding: 2 em; } ::-webkit-datetime-edit-fields-wrapper { background:green; } ::-webkit-datetime-edit-text { color: blue; padding: 0 0.3em; } ::-webkit-datetime-edit-month-field { color: red; } ::-webkit-datetime-edit-day-field { color: orange; } ::-webkit-datetime-edit-year-field { color: red; }

2K+ Views
In order to change colour of image drawn on an HTML5 Canvas element, you can try to run the following code. Use the drawImage() method − Example: Code to change color of image function display(img1, red, gr, bl) { //func to change color of image var canvas1 = document.createElement('canvas');//canvas element initialisation canvas1.width = img.width;//canvas width initialisation canvas1.height = img.height; //canvas height initialisation var ctx1 = canvas1.getContext('2d'); ctx1.drawImage(img, 0, 0); var myImg =ctx1.getImageData(0, 0, canvas1.width, canvas1.height); for (var t=0;t< myImg.data.length;t+=4) { myImg.data[t]= red | myImg.data[t]; ... Read More

279 Views
There are similar rules for native mobile apps and application. Only domain needs are to be added to white list in PhoneGap or Cardova.The device acts as a server and can access content from URL .If PhoneGap is used then domains are added to whitelist or a wildcard.While dealing with a native application, you expect to make requests from file://, instead of from https://. However, a request is not made across the HTTP protocol, so the same rules do not apply.Making requests from native mobile app, will allow you to make requests to any domain without any major issues. Read More

809 Views
When we apply z index to a canvas whose position is fixed, it stop causes chrome to render all other elements which have position:fixed properly. This only happens if canvas is greater than 256X256 px in size.Wrap both h1 and canvas with the fixed div and solves the issue − Test Title The following is the CSS −h1{ position: fixed; } body{ height: 1500px; } canvas{ position: fixed; z-index: -10; }

109 Views
One of the divs, when placed in another style sheet, can make menu invisible in Internet Explorer.If opacity property is used which is not a cross-border solution, it should be like the following to display −opaque { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=70)"; // first filter: alpha(opacity=90); // second }

505 Views
In order to get latitude and longitude using an HTML5 Geolocation or any Google API, we need to add JavaScript for this. The script is as follows −if (navigator.geolocation) { /* If current position is obtained then there is success otherwise there is failure. On failure, separate error message is shown */ navigator.geolocation.getCurrentPosition(successFunc, errorFunc); } else { alert(‘Geolocation is not enabled in your browser. Please use a latest browser to supports it.'); }

282 Views
Internet Explorer 8 and older versions does not support semantic elements like nav, header and article. To style semantic elements, Modernizer is used. Some CSS can be added to block CSS by default.article, header, nav, section, footer { display:block; }We can also create our own elements through JavaScript by writing following code − document.createElement('nav'); //nav is semantic element document.createElement('header'); //header is semantic element document.createElement('article'); //article is semantic element

229 Views
To upload from local drive to the local file system, we can use −Webkitdirectory attribute on − This allows the user to select a directory by the appropriate dialog box.Filesystem API is a sandboxed filesystem, which allows us to store files on client’s machine.File API allows us to read files. Files are accessible by elementAll of the above is working fine in Google Chrome.WebKit directory is a much better option among these. Use the following for directory −webkitRequestFileSystem( window.TEMPORARY, 5 * 1024 * 1024, function(_fs) { fs = _fs; }, ErrAbove, err and fs are −var fs, err = function(err) { throw err; };

507 Views
To trigger mouse event we can add −-webkit-transform: translate3d(0, 0, 0)In addition to this canvas can also be styled.Another way is to add a listener in the event mousemove,canvas.addEventListener("mousemove", this.checkMouseLocation.bind(this, this.inputs), false);By adding this listener, we can easily trigger a mouse move event in HTML5.

131 Views
When we have a requirement in which we want to track the latest locations for a user only when they are in a certain area, then we write separate code for it. The code to determine when to prompt the user to share location in HTML is as follows -if (frstTime) { //First time navigator.getCurrentPosition(function (coordinates) { if (coordsAreInTheBox) { storeCoordsForUser(); navigator.watchPosition(); } }); ... Read More