How-to articles, tricks, and solutions about HTML

How to Add Border Inside a Div

If you need to place a border inside a <div> element, you are in the right place. In this snippet, you can find out how to do it using some CSS properties.

How to Add Border to HTML Table

Learn how to create an HTML table, how to change HTML table border style using CSS. How to add border to<div>,<h2> &<p> elements. Practice with examples

How to Add Both a Background Image and CSS3 Gradient to the Same Element

If you want to make your website more attractive, read this snippet and learn how to add both a background-image and CSS3 gradient to the same element.

How to Add Colors to Bootstrap Icons with CSS

Using icons is great for every website. If you face the difficulty of adding color to Bootstrap icons, add the CSS color property. Change also the font-size.

How to Add HTML Entities with the CSS content Property

HTML provides entity name or entity number to use reserved characters. Learn how you can add HTML entities to your code with the CSS content property.

How to Add Image in the Title Bar

Make your website look more attractive by using favicons in the title bar. See how favicons are created and find more information about them.

How to Add Indentation for the Second Line of an Ordered List

On this page, you can find out how it is possible to add an indentation for the second line of ordered lists. Read our snippet and find a solution to the problem.

How to Add Line Break Before an Element with CSS

In this tutorial, we’re going to show some ways of adding a line break before an element. For that, use the white-space property and ::before pseudo-element.

How to Add Lines Before and After the Heading Text

If you are tired of standard heading styles then read this snippet and learn to add lines before and after heading giving it an attractive and unique style.

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 Add Style to the Parent Element when Hovering a Child Element

It is possible to style the parent element when hovering a child element. In this snippet, we’re going to demonstrate and explain how to do this step by step.

How to Add Telephone Links with HTML

In this snippet, you will find out how it is possible to add telephone links with HTML. See examples and try to add and style telephone links by yourself.

How to add text to an image with PHP GD library

Here is an example of how you can add text to an image using the PHP GD library:

How to Adjust the Position of List Style Image

In our snippet, we’ll show how to properly use the padding to overcome the difficulty of applying the padding not only to the list items but also to images.

How to Align a Checkbox and Its Label Consistently Cross-Browsers

Checkbox is one of HTML forms that is used on every website. This tutorial will show how to align checkboxes and their labels consistently across browsers.

How to Align Labels Next to Inputs

In this snippet, you’ll learn how to align <label> elements next to <input> elements. Align labels to the right and left of inputs by using CSS properties.

How to Align the <span> Element to the Right of the <div>

Find out how to align a <span> element to the right of the <div> element in this tutorial. We’ll explain how you can do this with the CSS float property.

How to Align the Last Bootstrap Menu Item to the Right

In this tutorial, we will demonstrate how you can align the last menu item to the right in Bootstrap. Read the snippet and find some solutions to this problem.

How to Allow Only Positive Numbers in the Input Number Type

In this snippet, we’ll demonstrate how to allow only positive numbers in the input number type. You can use the “min” attribute to specify restrictions.

How to Allow the File Input Type to Accept Only Image Files

In this tutorial, we’ll show how to allow the file input type to accept only image files or certain image file extensions. Use the HTML “accept” attribute.

How to Animate the Background of the Progress Bar

On this page, we’ll demonstrate how to animate the background of a progress bar created with the HTML <progress> element. Read this snippet to find the answer.

How to Apply CSS Style to the Element Name

In this snippet, we’re going to demonstrate how you can apply CSS styles to the name of the element. For that, you can use attribute selectors. See examples.

How to Apply Global Font to the Entire HTML Document

In this snippet, we’re going to apply a global font format to the whole HTML page. Read our snippet and find out how this can be done with and without !important.

How to Assign a Checked Initial Value to the Radio Button

In this tutorial, find out how you can assign a checked initial value to the radio button with HTML. To achieve that goal, you need to use the checked attribute.

How to Auto-Hide a Placeholder Text on Focus with CSS and jQuery

The placeholder attribute describes the expected value of an input field. See how to auto-hide placeholder text on focus using HTML, CSS, and jQuery.