HTML5 – Color Code Builder

HTML – Color Code Builder ”; Previous Next Sometimes we need to decorate our HTML pages using different colors. HTML provides a wide range of attributes that can be used to set background color, font color and so on. To use colors in your HTML pages, we are required to choose valid color codes. It is always difficult to find colors code. If you have any color in you have any color in your mind the below tool helps to convert that to rgb and hexadecimal code. HTML Color Picker We can make any colors using combination RED, GREEN, and BLUE. If we set maximum intensity of all three colors, then the resulting color will be white. Similarly, if we give zero intensity for all RGB values, we will get black color. Current Color Values: Hex: #fff RGB: 255, 255, 255 RGBA: 255, 255, 255, 1 HSL: 0, 0%, 100% Hex: RGB: RGBA: HSL: The rgb() function takes three parameters namely the red value, the green value, and the blue value. Each value is specified using an integer which can range from 0 to 255, where 0 means no color and 255 means full color intensity. Mixing these values will create other different colors. HSL Color Code Generator The HSL color model stands for Hue, Saturation, and Lightness. Hue is the type of color, measured in degrees from 0 to 360. Saturation is the intensity of the color, from 0% (gray) to 100% (full color). Lightness is the brightness of the color, from 0% (black) to 100% (white). By adjusting these three values, we can create a wide range of colors. This model is often considered more intuitive for selecting colors compared to the RGB model. HSL (Hue, Saturation, Lightness) Hue Saturation Lightness Copy Related Topics To know mor about the color you can go through the below listed articles. HTML – Color Names HTML – Background Colors HTML – RGB and RGBA Colors HTML – HEX Colors Print Page Previous Next Advertisements ”;

HTML5 – Quick Guide

HTML5 – Quick Guide ”; Previous Next HTML5 – Overview HTML5 is the next major revision of the HTML standard superseding HTML 4.01, XHTML 1.0, and XHTML 1.1. HTML5 is a standard for structuring and presenting content on the World Wide Web. HTML5 is a cooperation between the World Wide Web Consortium (W3C) and the Web Hypertext Application Technology Working Group (WHATWG). The new standard incorporates features like video playback and drag-and-drop that have been previously dependent on third-party browser plug-ins such as Adobe Flash, Microsoft Silverlight, and Google Gears. Browser Support The latest versions of Apple Safari, Google Chrome, Mozilla Firefox, and Opera all support many HTML5 features and Internet Explorer 9.0 will also have support for some HTML5 functionality. The mobile web browsers that come pre-installed on iPhones, iPads, and Android phones all have excellent support for HTML5. New Features HTML5 introduces a number of new elements and attributes that can help you in building modern websites. Here is a set of some of the most prominent features introduced in HTML5. New Semantic Elements − These are like <header>, <footer>, and <section>. Forms 2.0 − Improvements to HTML web forms where new attributes have been introduced for <input> tag. Persistent Local Storage − To achieve without resorting to third-party plugins. WebSocket − A next-generation bidirectional communication technology for web applications. Server-Sent Events − HTML5 introduces events which flow from web server to the web browsers and they are called Server-Sent Events (SSE). Canvas − This supports a two-dimensional drawing surface that you can program with JavaScript. Audio & Video − You can embed audio or video on your webpages without resorting to third-party plugins. Geolocation − Now visitors can choose to share their physical location with your web application. Microdata − This lets you create your own vocabularies beyond HTML5 and extend your web pages with custom semantics. Drag and drop − Drag and drop the items from one location to another location on the same webpage. Backward Compatibility HTML5 is designed, as much as possible, to be backward compatible with existing web browsers. Its new features have been built on existing features and allow you to provide fallback content for older browsers. It is suggested to detect support for individual HTML5 features using a few lines of JavaScript. If you are not familiar with any previous version of HTML, I would recommend that you go through our HTML Tutorial before exploring the features of HTML5. HTML5 – Syntax The HTML 5 language has a “custom” HTML syntax that is compatible with HTML 4 and XHTML1 documents published on the Web, but is not compatible with the more esoteric SGML features of HTML 4. HTML 5 does not have the same syntax rules as XHTML where we needed lower case tag names, quoting our attributes, an attribute had to have a value and to close all empty elements. HTML5 comes with a lot of flexibility and it supports the following features − Uppercase tag names. Quotes are optional for attributes. Attribute values are optional. Closing empty elements are optional. The DOCTYPE DOCTYPEs in older versions of HTML were longer because the HTML language was SGML based and therefore required a reference to a DTD. HTML 5 authors would use simple syntax to specify DOCTYPE as follows − <!DOCTYPE html> The above syntax is case-insensitive. Character Encoding HTML 5 authors can use simple syntax to specify Character Encoding as follows − <meta charset = “UTF-8″> The above syntax is case-insensitive. The <script> tag It”s common practice to add a type attribute with a value of “text/javascript” to script elements as follows − <script type = “text/javascript” src = “scriptfile.js”></script> HTML 5 removes extra information required and you can use simply following syntax − <script src = “scriptfile.js”></script> The <link> tag So far you were writing <link> as follows − <link rel = “stylesheet” type = “text/css” href = “stylefile.css”> HTML 5 removes extra information required and you can simply use the following syntax − <link rel = “stylesheet” href = “stylefile.css”> HTML5 Elements HTML5 elements are marked up using start tags and end tags. Tags are delimited using angle brackets with the tag name in between. The difference between start tags and end tags is that the latter includes a slash before the tag name. Following is the example of an HTML5 element − <p>…</p> HTML5 tag names are case insensitive and may be written in all uppercase or mixed case, although the most common convention is to stick with lowercase. Most of the elements contain some content like <p>…</p> contains a paragraph. Some elements, however, are forbidden from containing any content at all and these are known as void elements. For example, br, hr, link, meta, etc. Here is a complete list of HTML5 Elements. HTML5 Attributes Elements may contain attributes that are used to set various properties of an element. Some attributes are defined globally and can be used on any element, while others are defined for specific elements only. All attributes have a name and a value and look like as shown below in the example. Following is the example of an HTML5 attribute which illustrates how to mark up a div element with an attribute named class using a value of “example” − <div class = “example”>…</div> Attributes may only be specified within start tags and must never be used in end tags. HTML5 attributes are case insensitive and may be written in all uppercase or mixed case, although the most common convention is to stick with lowercase. Here is a complete list of HTML5 Attributes. HTML5 Document The following tags have been introduced for better structure − section − This tag represents a generic document or application section. It can be used together with h1-h6 to indicate the document structure. article − This tag represents an independent piece of content of a document, such as a blog entry or newspaper article. aside − This tag represents a piece of content

HTML5 – Useful Resources

Html5 – Useful Resources ”; Previous Next The following resources contain additional information on Html5. Please use them to get more in-depth knowledge on this topic. Useful Video Courses Learn HTML Introduction to creating your first website 16 Lectures 1 hours Laurence Svekis More Detail Complete HTML and CSS Masterclass For Beginners (Complete Bootcamp Course) 51 Lectures 7 hours Emenwa Global, Ejike IfeanyiChukwu More Detail Master HTML5 and CSS3 Fundamentals Best Seller 35 Lectures 4.5 hours Stone River ELearning More Detail HTML JavaScript & AspNet C# Programming : Beginner to Expert 142 Lectures 16.5 hours Metla Sudha Sekhar More Detail Learn HTML JavaScript Restful API from scratch: Web Services Most Popular 108 Lectures 11 hours Metla Sudha Sekhar More Detail Responsive Web Development With HTML5 And CSS3 For Beginners 57 Lectures 7.5 hours Robert Nana Sarpong More Detail Print Page Previous Next Advertisements ”;

HTML5 – Web slide Desk

HTML – Web Slide Desk ”; Previous Next A slide is a single page of a presentation. Collectively, a group of slides may be known as a slide deck. Example Let”s look at the following example, where we are going to create a HTML web slide desk <!DOCTYPE html> <html> <style> body { font-family: verdana; background-color: #F4ECF7; color: #DE3163; } .x { display: none; text-align: center; padding: 123px; } .x.active { display: block; } .prev, .next { position: absolute; top: 40%; background-color: #EAFAF1; color: #DE3163; padding: 10px 20px; cursor: pointer; border: none; transition: background-color 0.2s; } .prev:hover, .next:hover { background-color: #DFFF00; } .prev { left: 10px; } .next { right: 10px; } </style> <body> <div class=”x active”> <h1>SLIDE 1</h1> <p>HELLO</p> </div> <div class=”x”> <h1>SLIDE 2</h1> <p>WELCOME</p> </div> <div class=”x”> <h1>SLIDE 3</h1> <p>THANK YOU.!</p> </div> <button class=”prev” onclick=”prevSlide()”>Previous</button> <button class=”next” onclick=”nextSlide()”>Next</button> <script> let a = 0; const slides = document.querySelectorAll(”.x”); function showSlide(n) { slides[a].classList.remove(”active”); a = (n + slides.length) % slides.length; slides[a].classList.add(”active”); } function prevSlide() { showSlide(a – 1); } function nextSlide() { showSlide(a + 1); } showSlide(a); </script> </body> </html> When we run the above code, it will generate an output consisting of the button along with a slides containing the text in it displayed on the webpage Print Page Previous Next Advertisements ”;

HTML5 – Canvas

HTML – Canvas ”; Previous Next HTML element <canvas> gives you an easy and powerful way to draw graphics using JavaScript. It can be used to draw graphs, make photo compositions or do simple (and not so simple) animations. Here is a simple <canvas> element which has only two specific attributes width and height plus all the core HTML attributes like id, name and class, etc. <canvas id=”mycanvas” width=”100″ height=”100″></canvas> You can easily find that <canvas> element in the DOM using getElementById() method as follows − var canvas = document.getElementById(“mycanvas”); Example Let us see a sample example that shows how to use <canvas> element in HTML document. <!DOCTYPE html> <html> <head> <style> #mycanvas{border:1px solid red;} </style> </head> <body> <canvas id=”mycanvas” width=”100″ height=”100″></canvas> </body> </html> The Rendering Context The <canvas> is initially blank, and to display something, a script first needs to access the rendering context. The canvas element has a DOM method called getContext, which is used to obtain the rendering context and its drawing functions. This function takes one parameter, the type of context 2d. Instance Following is the code to get required context along with a check if the browser supports <canvas> element − var canvas = document.getElementById(“mycanvas”); if (canvas.getContext){ var ctx = canvas.getContext(”2d”); // drawing code here } else { // canvas-unsupported code here } Browser Support The latest versions of Firefox, Safari, Chrome and Opera all support for HTML Canvas but IE8 does not support canvas natively. You can use ExplorerCanvas to have canvas support through Internet Explorer. You just need to include this JavaScript as follows − <!–[if IE]><script src=”excanvas.js”></script><![endif]–> HTML Canvas – Drawing Rectangles There are three methods that draw rectangles on the canvas − S.No. Method & Description 1 fillRect(x,y,width,height) This method draws a filled rectangle. 2 strokeRect(x,y,width,height) This method draws a rectangular outline. 3 clearRect(x,y,width,height) This method clears the specified area and makes it fully transparent Here x and y specify the position on the canvas (relative to the origin) of the top-left corner of the rectangle and width and height are width and height of the rectangle. Example Following is a simple example which makes use of above mentioned methods to draw a nice rectangle. <!DOCTYPE html> <html> <head> <style> #test { width: 100px; height:100px; margin: 0px auto; } </style> <script type=”text/javascript”> function drawShape(){ // Get the canvas element using the DOM var canvas = document.getElementById(”mycanvas”); // Make sure we don”t execute when canvas isn”t supported if (canvas.getContext){ // use getContext to use the canvas for drawing var ctx = canvas.getContext(”2d”); // Draw shapes ctx.fillRect(25,25,100,100); ctx.clearRect(45,45,60,60); ctx.strokeRect(50,50,50,50); } else { alert(”You need Safari or Firefox 1.5+ to see this demo.”); } } </script> </head> <body id=”test” onload=”drawShape();”> <canvas id=”mycanvas”></canvas> </body> </html> HTML Canvas – Drawing Paths We require the following methods to draw paths on the canvas − S.No. Method & Description 1 beginPath() This method resets the current path. 2 moveTo(x, y) This method creates a new subpath with the given point. 3 closePath() This method marks the current subpath as closed, and starts a new subpath with a point the same as the start and end of the newly closed subpath. 4 fill() This method fills the subpaths with the current fill style. 5 stroke() This method strokes the subpaths with the current stroke style. 6 arc(x, y, radius, startAngle, endAngle, anticlockwise) Adds points to the subpath such that the arc described by the circumference of the circle described by the arguments, starting at the given start angle and ending at the given end angle, going in the given direction, is added to the path, connected to the previous point by a straight line. Example Following is a simple example which makes use of above mentioned methods to draw a shape. <!DOCTYPE html> <html> <head> <style> #test { width: 100px; height:100px; margin: 0px auto; } </style> <script type=”text/javascript”> function drawShape(){ // get the canvas element using the DOM var canvas = document.getElementById(”mycanvas”); // Make sure we don”t execute when canvas isn”t supported if (canvas.getContext){ // use getContext to use the canvas for drawing var ctx = canvas.getContext(”2d”); // Draw shapes ctx.beginPath(); ctx.arc(75,75,50,0,Math.PI*2,true); // Outer circle ctx.moveTo(110,75); ctx.arc(75,75,35,0,Math.PI,false); // Mouth ctx.moveTo(65,65); ctx.arc(60,65,5,0,Math.PI*2,true); // Left eye ctx.moveTo(95,65); ctx.arc(90,65,5,0,Math.PI*2,true); // Right eye ctx.stroke(); } else { alert(”You need Safari or Firefox 1.5+ to see this demo.”); } } </script> </head> <body id=”test” onload=”drawShape();”> <canvas id=”mycanvas”></canvas> </body> </html> HTML Canvas – Drawing Lines Line Methods We require the following methods to draw lines on the canvas − S.No. Method & Description 1 beginPath() This method resets the current path. 2 moveTo(x, y) This method creates a new subpath with the given point. 3 closePath() This method marks the current subpath as closed, and starts a new subpath with a point the same as the start and end of the newly closed subpath. 4 fill() This method fills the subpaths with the current fill style. 5 stroke() This method strokes the subpaths with the current stroke style. 6 lineTo(x, y) This method adds the given point to the current subpath, connected to the previous one by a straight line. Example Following is a simple example which makes use

HTML5 – Drag and Drop

HTML – Drag and Drop API ”; Previous Next Drag and Drop (DnD) is powerful User Interface concept which makes it easy to copy, reorder and deletion of items with the help of mouse clicks and movements. This allows the user to click and hold the mouse button down over an element, drag it to another location, and release the mouse button to drop the element there. To achieve drag and drop functionality with traditional HTML4, developers either have to use complex JavaScript programming or other JavaScript frameworks like jQuery etc. Now, HTML5 came up with a Drag and Drop (DnD) API that brings native DnD support to the browser making it much easier to code up. It is supported by all the major browsers like Chrome, Firefox 3.5 and Safari 4 etc. Making an Element Draggable To make a element draggable, we have to set draggable attribute to true. For example, <div draggable=”true”> Drag and Drop Events There are number of events which are fired during various stages of the drag and drop operation. These events are listed below Events Description dragstart Fires when the user starts dragging of the object. dragenter Fired when the mouse is first moved over the target element while a drag is occurring. A listener for this event should indicate whether a drop is allowed over this location. If there are no listeners, or the listeners perform no operations, then a drop is not allowed by default. dragover This event is fired as the mouse is moved over an element when a drag is occurring. Much of the time, the operation that occurs during a listener will be the same as the dragenter event. dragleave This event is fired when the mouse leaves an element while a drag is occurring. Listeners should remove any highlighting or insertion markers used for drop feedback. drag Fires every time the mouse is moved while the object is being dragged. drag The drop event is fired on the element where the drop was occurred at the end of the drag operation. A listener would be responsible for retrieving the data being dragged and inserting it at the drop location. dragend Fires when the user releases the mouse button while dragging an object. Note that only drag events are fired; mouse events such as mousemove are not fired during a drag operation. The DataTransfer Object The event listener methods for all the drag and drop events accept Event object which has a readonly attribute called dataTransfer. The event.dataTransfer returns DataTransfer object associated with the event as follows function EnterHandler(event) { DataTransfer dt = event.dataTransfer; …………. } The DataTransfer object holds data about the drag and drop operation. This data can be retrieved and set in terms of various attributes associated with DataTransfer object as explained below Attribute Description dataTransfer.dropEffect [ = value ] Returns the kind of operation that is currently selected. This attribute can be set, to change the selected operation. The possible values are none, copy, link, and move. dataTransfer.effectAllowed [ = value ] Returns the kinds of operations that are to be allowed. This attribute can be set, to change the allowed operations. The possible values are none, copy, copyLink, copyMove, link, linkMove, move, all and uninitialized. dataTransfer.types Returns a DOMStringList listing the formats that were set in the dragstart event. In addition, if any files are being dragged, then one of the types will be the string “Files”. dataTransfer.clearData ( [ format ] ) Removes the data of the specified formats. Removes all data if the argument is omitted. dataTransfer.setData(format, data) Adds the specified data. data = dataTransfer.getData(format) Returns the specified data. If there is no such data, returns the empty string. dataTransfer.files Returns a FileList of the files being dragged, if any. dataTransfer.setDragImage(element, x, y) Uses the given element to update the drag feedback, replacing any previously specified feedback. dataTransfer.addElement(element) Adds the given element to the list of elements used to render the drag feedback. Drag and Drop Process Following are the steps to be carried out to implement Drag and Drop operation Step 1 – Making an Object Draggable Here are steps to be taken If you want to drag an element, you need to set the draggable attribute to true for that element. Set an event listener for dragstart that stores the data being dragged. The event listener dragstart will set the allowed effects (copy, move, link, or some combination). Following is the example to make an object draggable <!DOCTYPE html> <html> <head> <style type=”text/css”> #boxA, #boxB { float: left; padding: 10px; margin: 10px; -moz-user-select: none; } #boxA { background-color: #6633FF; width: 75px; height: 75px; } #boxB { background-color: #FF6699; width: 150px; height: 150px; } </style> <script type=”text/javascript”> function dragStart(ev) { ev.dataTransfer.effectAllowed = ”move”; ev.dataTransfer.setData(“Text”, ev.target.getAttribute(”id”)); ev.dataTransfer.setDragImage(ev.target, 0, 0); return true; } </script> </head> <body> <center> <h2>Drag and drop HTML5 demo</h2> <div> Try to drag the purple box around. </div> <div id=”boxA” draggable=”true” ondragstart=”return dragStart(event)”> <p>Drag Me</p> </div> <div id=”boxB”>Dustbin</div> </center> </body> </html> Step 2 – Handle dropping of the Object To accept a drop, the drop target has to listen to at least three events. The dragenter event, which is used to determine

HTML5 – Fonts Reference

HTML – Fonts Reference ”; Previous Next Fonts are specific to platform. You will have different look and feel of a web page on different machines running different operating systems like Windows, Linux or Mac iOS. Here we are giving a list of fonts which are available in various operating systems. HTML <font> tag is deprecated in version 4.0 onwards and now all fonts are set by using CSS. Here is the simple syntax of setting font of a body of web page. Syntax In CSS: body { font-family: “new century schoolbook”; } In HTML: <body style = “font-family:new century schoolbook;”> HTML font Tag HTML <font> tag is deprecated in latest versions of HTML. In older versions font tag can be used to add style, size, and color to the text on your website. You can use a <basefont> tag to set all of your text to the same size, face, and color. HTML font tag have three attributes called size, color, and face to customize your fonts. Web safe fonts CSS3 has adapted font combinations technology. If the browser doesn”t support the first font then it tries the next font. Here is the list of CSS Web Safe Fonts. Example of HTML Fonts Let”s look at the basic example of the usage of the fonts in the HTML document <!DOCTYPE html> <html> <head> <title>Font Setting Using CSS</title> </head> <body> <p> Change any of the style and try it. </p> <div style=”font-family:verdana;”> This is demo for font family </div> <br /> <div style=”font-size:120%;”> This is demo for font size </div> <br /> <div style=”font-size:14pt;”> This is demo for font size </div> </body> </html> When we run the above code, the output window will pop up displaying the text with different fonts displayed on the webpage. Fonts for Microsoft Systems Following are the fonts for Microsoft Systems listed below − Font Font Font Andale Mono Arial Arial Bold Arial Italic Arial Bold Italic Arial Black Comic Sans MS Comic Sans MS Bold Courier New Courier New Bold Courier New Italic Courier New Bold Italic Georgia Georgia Bold Georgia Italic Georgia Bold Italic Impact Lucida Console Lucida Sans Unicode Marlett Minion Web Symbol Times New Roman Times New Roman Bold Times New Roman Italic Times New Roman Bold Italic Tahoma Trebuchet MS Trebuchet MS Bold Trebuchet MS Italic Trebuchet MS Bold Italic Verdana Verdana Bold Verdana Italic Verdana Bold Italic Webdings You can check example fonts here Microsoft Fonts Examples. Fonts for Macintosh Systems Following is the list of fonts supported by Macintosh System 7 and higher versions. Font Font Font American Typewriter Andale Mono Apple Chancery Arial Arial Black Brush Script Baskerville Big Caslon Comic Sans MS Copperplate Courier New Gill Sans Futura Herculanum Impact Lucida Grande Marker Felt Optima Trebuchet MS Verdana Webdings Palatino Symbol Times Osaka Papyrus Times New Roman Textile Zapf Dingbats Zapfino Techno Hoefler Text Skia Hoefler Text Ornaments Capitals Charcoal Gadget Sand You can check example fonts here Mac Fonts Examples. Fonts for Unix Systems Following is the list of fonts supported by most Unix System variants Font Font Font Charter Clean Courier Fixed Helvetica Lucida Lucida bright Lucida Typewriter New Century Schoolbook Symbol Terminal Times Utopia You can check example fonts here Unix Fonts Examples. Print Page Previous Next Advertisements ”;

HTML5 – Modernizr

HTML – Modernizr ”; Previous Next Modernizr is a small JavaScript Library that detects whether a particular feature of web technologies is available or not in the user’s browser. It provides an easy way to detect any new feature so that we can take corresponding action based on the browser’s capabilities. For example, if a browser does not support a video feature then we can display a simple message regarding the same. We can also create CSS rules based on the feature availability and these rules would be applied automatically on the webpage if the browser does not support a new feature. Before we start using Modernizr, we are required to include its javascript library in our HTML page header as follows − <script src=”modernizr.min.js” type=”text/javascript”></script> Instance Following is the simple syntax to handle supported and non supported features − <!– In your CSS: –> .no-audio #music { display: none; <!– to not show Audio options –> } .audio #music button { <!– Style the Play and Pause buttons nicely –> } <!– In your HTML: –> <div id=”music”> <audio> <source src=”audio.ogg” /> <source src=”audio.mp3″ /> </audio> <button id=”play”>Play</button> <button id=”pause”>Pause</button> </div> Here it is notable that you need to prefix “no-” to every feature/property you want to handle for the browser which does not support them. Following code snippet can be added to detect a particular feature through Javascript − if (Modernizr.audio) { <!– properties for browsers that support audio –> } else{ <!– properties for browsers that does not support audio –> } Features detected by Modernizr Following is the list of features which can be detected by Modernizr − Feature CSS Property JavaScript Check @font-face .fontface Modernizr.fontface Canvas .canvas Modernizr.canvas Canvas Text .canvastext Modernizr.canvastext HTML Audio .audio Modernizr.audio HTML Audio formats NA Modernizr.audio[format] HTML Video .video Modernizr.video HTML Video Formats NA Modernizr.video[format] rgba() .rgba Modernizr.rgba hsla() .hsla Modernizr.hsla border-image .borderimage Modernizr.borderimage border-radius .borderradius Modernizr.borderradius box-shadow .boxshadow Modernizr.boxshadow Multiple backgrounds .multiplebgs Modernizr.multiplebgs opacity .opacity Modernizr.opacity CSS Animations .cssanimations Modernizr.cssanimations CSS Columns .csscolumns Modernizr.csscolumns CSS Gradients .cssgradients Modernizr.cssgradients CSS Reflections .cssreflections Modernizr.cssreflections CSS 2D Transforms .csstransforms Modernizr.csstransforms CSS 3D Transforms .csstransforms3d Modernizr.csstransforms3d CSS Transitions .csstransitions Modernizr.csstransitions Geolocation API .geolocation Modernizr.geolocation Input Types NA Modernizr.inputtypes[type] Input Attributes NA Modernizr.input[attribute] localStorage .localstorage Modernizr.localstorage sessionStorage .sessionstorage Modernizr.sessionstorage Web Workers .webworkers Modernizr.webworkers applicationCache .applicationcache Modernizr.applicationcache SVG .svg Modernizr.svg SVG Clip Paths .svgclippaths Modernizr.svgclippaths SMIL .smil Modernizr.smil Web SQL Database .websqldatabase Modernizr.websqldatabase IndexedDB .indexeddb Modernizr.indexeddb Web Sockets .websockets Modernizr.websockets Hashchange Event .hashchange Modernizr.hashchange History Management .historymanagement Modernizr.historymanagement Drag and Drop .draganddrop Modernizr.draganddrop Cross-window Messaging .crosswindowmessaging Modernizr.crosswindowmessaging addTest() Plugin API NA Modernizr.addTest(str,fn) Print Page Previous Next Advertisements ”;

HTML5 – Color Names

HTML – Color Names ”; Previous Next The following table shows the 16 color names that were introduced in HTML 3.2 − Color Name Hex Value Color aqua #00ffff black #000000 blue #0000ff fuchsia #ff00ff green #008000 gray #808080 lime #00ff00 maroon #800000 navy #000080 olive #808000 purple #800080 red #ff0000 silver #c0c0c0 teal #008080 white #ffffff yellow #ffff00 There are other colors which are not part of HTML or XHTML but they are supported by most of the versions of major browsers. Color Name Hex Value Color aliceblue #f0f8ff antiquewhite #faebd7 aquamarine #7fffd4 azure #f0ffff beige #f5f5dc bisque #ffe4c4 blanchedalmond #ffebcd blueviolet #8a2be2 brown #a52a2a burlywood #deb887 cadetblue #5f9ea0 chartreuse #7fff00 chocolate #d2691e coral #ff7f50 cornflowerblue #6495ed cornsilk #fff8dc crimson #dc143c cyan #00ffff darkblue #00008b darkcyan #008b8b darkgoldenrod #b8860b darkgray #a9a9a9 darkgreen #006400 darkkhaki #bdb76b darkmagenta #8b008b darkolivegreen #556b2f darkorange #ff8c00 darkorchid #9932cc darkred #8b0000 darksalmon #e9967a darkseagreen #8fbc8f darkslateblue #483d8b darkslategray #2f4f4f darkturquoise #00ced1 darkviolet #9400d3 deeppink #ff1493 deepskyblue #00bfff dimgray #696969 dodgerblue #1e90ff firebrick #b22222 floralwhite #fffaf0 forestgreen #228b22 gainsboro #dcdcdc ghostwhite #f8f8ff gold #ffd700 goldenrod #daa520 gray #808080 greenyellow #adff2f honeydew #f0fff0 hotpink #ff69b4 indianred #cd5c5c indigo #4b0082 ivory #fffff0 khaki #f0e68c lavender #e6e6fa lavenderblush #fff0f5 lawngreen #7cfc00 lemonchiffon #fffacd lightblue #add8e6 lightcoral #f08080 lightcyan #e0ffff lightgoldenrodyellow #fafad2 lightgreen #90ee90 lightgrey #d3d3d3 lightpink #ffb6c1 lightsalmon #ffa07a lightseagreen #20b2aa lightskyblue #87cefa lightslategray #778899 lightsteelblue #b0c4de lightyellow #ffffe0 limegreen #32cd32 linen #faf0e6 magenta #ff00ff mediumblue #0000cd mediumorchid #ba55d3 mediumpurple #9370db midnightblue #191970 mistyrose #ffe4e1 moccasin #ffe4b5 oldlace #fdf5e6 orange #ffa500 orchid #da70d6 peachpuff #ffdab9 peru #cd853f pink #ffc0cb plum #dda0dd purple #800080 rosybrown #bc8f8f royalblue #4169e1 salmon #fa8072 sandybrown #f4a460 seagreen #2e8b57 sienna #a0522d skyblue #87ceeb slateblue #6a5acd steelblue #4682b4 tan #d2b48c thistle #d8bfd8 tomato #ff6347 violet #ee82ee wheat #f5deb3 whitesmoke #f5f5f5 yellow #ffff00 yellowgreen #9acd32 HTML Entities Some characters are reserved in HTML and they have special meaning when used in HTML document. For example, you cannot use the greater than and less than signs or angle brackets within your HTML text because the browser will treat them differently and will try to draw a meaning related to HTML tag. HTML processors must support following five special characters listed in the table that follows. Symbol Description Entity Name Number Code “ quotation mark &quot; &#34; ” apostrophe  &apos; &#39; & ampersand &amp; &#38; < less-than &lt; &#60; > greater-than &gt; &#62; Example If you want to write <div id = “character”> as a code, then you will have to write as follows − <!DOCTYPE html> <html> <head> <title>HTML Entities</title> </head> <body> &lt;div id = &quot;character&quot;&gt; </body> </html> This code will produce a div tag with id = character. There is also a long list of special characters in HTML 4.0. In order for these to appear in your document, you can use either the numerical codes or the entity names. For example, to insert a copyright symbol you can use either of the following − &copy; 2007 or &#169; 2007 ISO 8859-1 Symbol Entities Result Description Entity Name Number Code   non-breaking space &nbsp; &#160; ¡ inverted exclamation mark &iexcl; &#161; ¤ currency &curren; &#164; ¢ cent &cent; &#162; £ pound &pound; &#163; ¥ yen &yen; &#165; ¦ broken vertical bar &brvbar; &#166; § section &sect; &#167; ¨ spacing diaeresis &uml; &#168; © copyright &copy; &#169; ª feminine ordinal indicator &ordf; &#170; « angle quotation mark (left) &laquo; &#171; ¬ negation &not; &#172; ­ soft hyphen &shy; &#173; ® registered trademark &reg; &#174; ™ trademark &trade; &#8482; ¯ spacing macron &macr; &#175; ° degree &deg; &#176; ± plus-or-minus  &plusmn; &#177; ² superscript 2 &sup2; &#178; ³ superscript 3 &sup3; &#179; ´ spacing acute &acute; &#180; µ micro &micro; &#181; ¶ paragraph &para; &#182; · middle dot &middot; &#183; ¸ spacing cedilla &cedil; &#184; ¹ superscript 1 &sup1; &#185; º masculine ordinal indicator &ordm; &#186; » angle quotation mark (right) &raquo; &#187; ¼ fraction 1/4 &frac14; &#188; ½ fraction 1/2 &frac12; &#189; ¾ fraction 3/4 &frac34; &#190; ¿ inverted question mark &iquest; &#191; × multiplication &times; &#215; ÷ division &divide; &#247; ISO 8859-1 Character Entities Result Description Entity Name Number Code À capital a, grave accent &Agrave; &#192; Á capital a, acute accent &Aacute; &#193; Â capital a, circumflex accent &Acirc; &#194; Ã capital a, tilde &Atilde; &#195; Ä capital a, umlaut mark &Auml; &#196; Å capital a, ring &Aring; &#197; Æ capital ae &AElig; &#198; Ç capital c, cedilla &Ccedil; &#199; È capital e, grave accent &Egrave; &#200; É capital e, acute accent &Eacute; &#201; Ê capital e, circumflex accent &Ecirc; &#202; Ë capital e, umlaut mark &Euml; &#203; Ì capital i, grave accent &Igrave; &#204; Í capital i, acute accent &Iacute; &#205; Î capital i, circumflex accent &Icirc; &#206; Ï capital i, umlaut mark &Iuml; &#207; Ð capital eth, Icelandic &ETH; &#208; Ñ capital n, tilde &Ntilde; &#209; Ò capital o, grave accent &Ograve; &#210; Ó capital o, acute accent &Oacute; &#211; Ô capital o, circumflex accent &Ocirc; &#212; Õ capital o, tilde &Otilde; &#213; Ö capital o, umlaut mark &Ouml; &#214; Ø capital o, slash &Oslash; &#216; Ù capital u, grave accent &Ugrave; &#217; Ú capital u, acute accent &Uacute; &#218; Û capital u, circumflex accent &Ucirc; &#219; Ü capital u, umlaut mark &Uuml; &#220; Ý capital y, acute accent &Yacute; &#221; Þ capital THORN, Icelandic &THORN; &#222; ß small sharp s, German &szlig; &#223; à small a, grave accent &agrave; &#224; á small a, acute accent &aacute; &#225; â small a, circumflex accent &acirc; &#226; ã small a, tilde &atilde; &#227; ä small a, umlaut mark &auml; &#228; å small a, ring &aring; &#229; æ small ae &aelig; &#230; ç small c, cedilla &ccedil; &#231; è small e, grave accent &egrave; &#232; é small e, acute accent &eacute; &#233; ê small e, circumflex accent &ecirc; &#234; ë small e, umlaut mark &euml; &#235; ì small i, grave accent &igrave; &#236; í small i, acute accent &iacute; &#237; î small i, circumflex accent &icirc; &#238; ï small i, umlaut mark &iuml;

HTML5 – Events

HTML5 – Events ”; Previous Next When users visit your website, they perform various activities such as clicking on text and images and links, hover over defined elements, etc. These are examples of what JavaScript calls events. We can write our event handlers in Javascript or VBscript and you can specify these event handlers as a value of event tag attribute. The HTML5 specification defines various event attributes as listed below − We can use the following set of attributes to trigger any javascript or vbscript code given as value, when there is any event that takes place for any HTML5 element. We would cover element-specific events while discussing those elements in detail in subsequent chapters. Attribute Value Description offline script Triggers when the document goes offline onabort script Triggers on an abort event onafterprint script Triggers after the document is printed onbeforeonload script Triggers before the document loads onbeforeprint script Triggers before the document is printed onblur script Triggers when the window loses focus oncanplay script Triggers when media can start play, but might has to stop for buffering oncanplaythrough script Triggers when media can be played to the end, without stopping for buffering onchange script Triggers when an element changes onclick script Triggers on a mouse click oncontextmenu script Triggers when a context menu is triggered ondblclick script Triggers on a mouse double-click ondrag script Triggers when an element is dragged ondragend script Triggers at the end of a drag operation ondragenter script Triggers when an element has been dragged to a valid drop target ondragleave script Triggers when an element leaves a valid drop target ondragover script Triggers when an element is being dragged over a valid drop target ondragstart script Triggers at the start of a drag operation ondrop script Triggers when dragged element is being dropped ondurationchange script Triggers when the length of the media is changed onemptied script Triggers when a media resource element suddenly becomes empty. onended script Triggers when media has reach the end onerror script Triggers when an error occur onfocus script Triggers when the window gets focus onformchange script Triggers when a form changes onforminput script Triggers when a form gets user input onhaschange script Triggers when the document has change oninput script Triggers when an element gets user input oninvalid script Triggers when an element is invalid onkeydown script Triggers when a key is pressed onkeypress script Triggers when a key is pressed and released onkeyup script Triggers when a key is released onload script Triggers when the document loads onloadeddata script Triggers when media data is loaded onloadedmetadata script Triggers when the duration and other media data of a media element is loaded onloadstart script Triggers when the browser starts to load the media data onmessage script Triggers when the message is triggered onmousedown script Triggers when a mouse button is pressed onmousemove script Triggers when the mouse pointer moves onmouseout script Triggers when the mouse pointer moves out of an element onmouseover script Triggers when the mouse pointer moves over an element onmouseup script Triggers when a mouse button is released onmousewheel script Triggers when the mouse wheel is being rotated onoffline script Triggers when the document goes offline online script Triggers when the document comes online ononline script Triggers when the document comes online onpagehide script Triggers when the window is hidden onpageshow script Triggers when the window becomes visible onpause script Triggers when media data is paused onplay script Triggers when media data is going to start playing onplaying script Triggers when media data has start playing onpopstate script Triggers when the window”s history changes onprogress script Triggers when the browser is fetching the media data onratechange script Triggers when the media data”s playing rate has changed onreadystatechange script Triggers when the ready-state changes onredo script Triggers when the document performs a redo onresize script Triggers when the window is resized onscroll script Triggers when an element”s scrollbar is being scrolled onseeked script Triggers when a media element”s seeking attribute is no longer true, and the seeking has ended onseeking script Triggers when a media element”s seeking attribute is true, and the seeking has begun onselect script Triggers when an element is selected onstalled script Triggers when there is an error in fetching media data onstorage script Triggers when a document loads onsubmit script Triggers when a form is submitted onsuspend script Triggers when the browser has been fetching media data, but stopped before the entire media file was fetched ontimeupdate script Triggers when media changes its playing position onundo script Triggers when a document performs an undo onunload script Triggers when the user leaves the document onvolumechange script Triggers when media changes the volume, also when volume is set to “mute” onwaiting script Triggers when media has stopped playing, but is expected to resume Print Page Previous Next Advertisements ”;