How-to articles, tricks, and solutions about HTML

How to Divide a Horizontal Line into Multiple Parts

In this tutorial, you will learn how it is possible to divide an HTML horizontal line into multiple parts. For that, you can use the CSS border-top property.

Which is the Float Input Type in HTML5

In this tutorial, you’ll learn which is the float input type in HTML5. Read our snippet and try some examples with the step value to see the solution to this problem.

How to Set a Minlength Validation in HTML5

In this snippet, find out what alternative attributes to minlength can be used to set a minlength validation in HTML5. Read our snippet and try examples.

How to Use the HTML accept Attribute

In this tutorial, we’ll explain what is the HTML accept attribute and why it is used. Use this attribute to specify file types the user is allowed to choose from.

What is the Difference Between the hidden and aria-hidden Attributes

On this page, you will learn what is the difference between the hidden and aria-hidden attributes. Read our snippet and see examples with these attributes.

How to Prevent Tab Indexing on Specific Elements

In this snippet, we demonstrate how it is possible to prevent tab indexing on specific elements. Read our tutorial to find out the answer and also try examples.

Which Tag is Better to Use: <embed> or <object>

On this page, you will learn what is the difference between the HTML <embed> and <object> tags and which one is better to use. Read the snippet and find examples.

Is It Possible to Use a <span> Within Another <span>

In this snippet, you will learn whether it is possible to use an HTML <span> element within another element. Read this tutorial and find the answer to this question.

How to Render an HTML String Preserving Spaces and Line Breaks

In this tutorial, you can learn how to render an HTML text preserving spaces and line breaks. You need to use the HTML <pre> tag or the CSS white-space property.

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 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 Change the Size of Glyphicons

In this snippet, you’ll find out how to change the size of glyphicons. You need the CSS font-size property to increase all glyphicons or only one of them.

How to Center an Image with the CSS text-align Property

In this snippet, you can see a trick, which can help to center an <img> element with the CSS text-align property. Use a <div> and apply the style to it.

How Not to Wrap the Contents of <p>, <div>, and <span> Elements

In this snippet, we want to demonstrate how you can make the contents of the <p>, <div>, and <span> elements not to wrap. Use the CSS white-space property.

How to Set the Size of the <textarea> Element

In this tutorial, you will find two ways of setting the size of the HTML <textarea> element. For that purpose, you can use HTML attributes or CSS properties.

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 Add a Border-Bottom to the Table Row

In this tutorial, we want to demonstrate how you can add a border only to the bottom of the table row. Read and find out what CSS property you need for this.

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 Display Ellipsis in the <span> Element Having Hidden Overflow

In this tutorial, see how to display ellipsis in the <span> element having the CSS overflow property with the “hidden” value. Add the text-overflow property.

How to Select the Last Element of a Specific Type

In this snippet, we want to display how you can select the last element of a specific type. For that, you need to use the CSS :last-of-type pseudo-class.

How to Add a Mouseover Text with HTML

In this tutorial, find out how to create a mouseover text description without Javascript. Use the HTML <div> or <span> element with the “title” attribute.

How to Rotate the <div> Element by 90 Degrees

In this tutorial, you can see how to rotate the HTML <div> element by 90 degrees. For that purpose, use the CSS transform property with the “rotate” value.

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.

What is aria-label and How to Use It

In this snippet, you can learn what is aria label, as well as when and how it can be used. Read our tutorial and find examples of using the aria-label attribute.

How to Resize SVG in HTML

In this tutorial, we want to demonstrate how you can resize SVG image in HTML. For that, you can change the values of the “height” and “width” attributes.

1 2 3 4