How-to articles, tricks, and solutions about HTML5

How to Add a Text on the HTML5 <canvas> Element

In this tutorial, you’ll find out how to add text on the HTML5 <canvas> element. For that, you need Javascript. Use the fillText() and strokeText() methods.

How to Add an HTML Button that Acts Like a Link

There are several ways to place a clickable button on a webpage that will be linked to another page of your website. You can add inline onclick event to HTML button tag, or input tag.

How to Add Border to Image in CSS

Learn about how to add border to an image, how to add styling to it and how to specify each corner and have circle borders. Practice all with examples.

How to Add Multiple <tbody> Elements in the Same Table

A <table> can have multiple <tbody> elements each of them specifying a row group. Read this snippet to see how to add several <tbody> elements in the same table.

How to Calculate Text Width with JavaScript

Read this JavaScript tutorial and learn about the best method of calculating the text width. Read about the advantages of the method over other methods.

How To Change the Color of an HTML5 Input Placeholder Using CSS

Learn How To Change the Color of an HTML5 Input Placeholder with CSS with W3docs tutorial. Try the code examples yourself. Fast solution.

How to Convert the Image into a Base64 String Using JavaScript

Read this tutorial and learn several methods of converting an image to a Base64 string using JavaScript. Choose the right approach for you and try examples.

How to Create a New DOM Element from HTML String

Read this JavaScript tutorial and find the method that is used for creating a new DOM element from an HTML string. Get the explanation and see examples.

How to Create a Placeholder for an HTML5 <select> Box by Using Only HTML and CSS?

Learn how to make a placeholder for a select box. Use only 3 HTML attributes or CSS :invalid pseudo-class and the display property set to none.

How to Create a Teardrop in HTML

The best way of creating a teardrop is to use SVG, which is used to specify vector-based graphics. In our snippet, we show how to create a teardrop using SVG.

How to Create an SVG Drop Shadow

On this page, you’ll find information on creating an SVG drop shadow. For that purpose, you can use the SVG <feDropShadow> element or the CSS filter property.

How to Create Range Slider With HTML5 and jQuery

HTML5 range input type allows creating range sliders. Read the tutorial and learn a simple solution including a jQuery code to achieve the desired result!

How to Display the Hidden Element on Hovering Over Hyperlink or <a> Tag

Learn How to Display the Hidden Element on Hovering Over Hyperlink or <a> tag. With this article, you can learn how to show the hidden elements.

How to Execute a JavaScript Function when You have Its Name as a String

Read this tutorial and learn about the safe method of calling a function when you have its name as a string. Also, read about why you should not use eval().

How to Hide the HTML5 Number Input’s Arrow Buttons

In this tutorial, you will read and learn several methods that are used to hide HTML5 arrow buttons from the number input with the help of CSS properties.

How to Insert Video in HTML

See how to use <video> and <iframe> tags instead of the <embed>, <frame> and <object> tags. Learn how to set video autoplay. Practice with examples.

How to Make Button onclick in HTML

If you want to make a button onclick, you need to add the onclick event attribute to the <button> element. Learn How to Make Button Onclick with Examples.

How to Set Cellpadding and Cellspacing in CSS

Use CSS padding and border-spacing properties for setting cellpadding and cellspacing for tables. Step by step guide with examples.

How to Style a Horizontal Line

Learn the ways of styling and have attractive horizontal lines: how to change color and size, set images as horizontal lines and a pack full of various kinds of <hr> examples.

How to Use jQuery Selectors on Custom Data Attributes

In this tutorial, you will find useful information about the usage of jQuery selectors on custom data attributes. See examples and solve your problem.

HTML5 Page Structure

Learn how to create an HTML5 page step by step. From doctype to different sections. See syntax and examples and practice yourself.