How-to articles, tricks, and solutions about HTML

How to Remove the CSS :hover Behavior from an Element

On this page, learn how to remove the CSS hover behavior from a specific element. For that, you can use the CSS pointer-events property or :not() pseudo-class.

How to Remove the Space Between Inline-block Elements

Do not know how to remove space between the inline-block elements? Read the tutorial and find the easiest techniques for the solution to your problem.

How to Remove, Replace or Style List Bullets with Pure CSS

Learn the ways of removing, styling and replacing list bullets with images. Also how to make horizontal lists. All with examples.

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 Replace col-xs-* in Bootstrap 4

On this page, find out how you can make a column equal to extra small. To make it work in Bootstrap 4, you need to replace the col-xs-* class with col-*.

How to Reset File Input with jQuery

In this tutorial, you will read and learn useful information about the fastest method of resetting a file input by using some HTML and jQuery methods.

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.

How to Retrieve an HTML Element's Actual Width and Height

Read this tutorial and learn about the two methods that are used to retrieve an HTML element’s actual width and height. Find the best method for your case.

How to Right Align a Button with CSS

In this tutorial, we'll demonstrate how to align a button to the right with CSS. For that purpose, you need to use the CSS float property with its “right” value.

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 Rotate the Content of the ::after or ::before Pseudo-Element

The content property is used with the ::after and ::before pseudo-elements. In this snippet, we’ll demonstrate how to rotate the content of these pseudo-elements.

How to Scale the Content of <iframe> Element

Scaling the content of an <iframe> may be needed if you want to display an object in the area not matching its original size. Read and find possible solutions.

How to Select All Text in HTML Text Input When Clicked Using JavaScript

Read the tutorial and learn the two methods of selecting the entire text in HTML text input when clicked using JavaScript code snippets. Also, see examples.

How to Select the First and Last <td> in a Row with CSS

In this snippet, we’ll demonstrate how you can select and style individual columns of your table using the :first-child and :last-child pseudo-classes.

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 Select the Last Second Element with CSS

In this snippet, you’ll find out how to select the last second element with pure CSS. To achieve the goal, you need to use the CSS :nth-last-child() pseudo-class.

How to Select the Next Element in CSS

In this snippet, you can find out how to select the second element that directly follows the first one. For that, you need to use the adjacent sibling combinator (+).

How to send HTTP request in Java?

In Java, you can send an HTTP request using the java.net.URL and java.net.HttpURLConnection classes.

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 Set Absolute Positioning Relative to the Parent Element

In this tutorial, you can learn how to set absolute positioning of a child element relative to its parent. Use the “relative” value of the position property.

How to Set an Equivalent of the "cover" Value of the background-size Property for an <img> Tag

In this snippet, we’ll show how you can set an equivalent of the “cover” value of the background-size property for the <img> tag. Use the object-fit property.

How to Set Background Color with HTML and CSS

Learn how to set a background color in general, how to have gradient and changing background colors with examples.

How to Set Default HTML Form Focus Without Javascript

In this tutorial, you’ll see how to set the default HTML form focus. This can be done without Javascript. For that, use the HTML “autofocus” attribute.

How to Set the Equivalent of "src" Attribute of an <img> Tag in CSS

In this snippet, you can find the solution of setting the equivalent of “src” attribute of an <img> tag. For that, use the content or background-image properties.

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.