How-to articles, tricks, and solutions about HTML
Sometimes, when the text in one of the cells of the column is too long, the column’s width change. Read this snippet to find out how to overcome this problem.
In this tutorial, we’ll show how you can set the width of the HTML table column. For that purpose, you need to use some CSS, particularly the width property.
In this snippet, we’ll show how to stretch a text horizontally or vertically using CSS. For that, you can use the CSS transform property set to the “scale”.
In this tutorial, you will find several approaches to strippingan HTML from a sting in JavaScript easily. Get the codes and explanations right away.
In this snippet, we’re going to demonstrate how to style the even, odd, or both the even and odd items of an unordered list. See examples with each of them.
In this snippet, you will find out how to style input and submit buttons easily. Use various CSS properties to achieve this goal. Read the snippet and try examples.
In this snippet, learn how you can style the selected label of a radio button. For that, you need to use the CSS :checked pseudo-class and some properties.
In this tutorial, you will find several jQuery methods that are used for testing whether the checkbox is checked based on the different versions you use.
It's a common problem to truncate a multi-line string. In this snippet, we'll show how to do it with CSS properties. You can also use CSS pseudo-elements.
In this snippet, we’ll show how you can turn a rectangular image into a cropped square. We’ll use CSS and turn an image into a square without distorting it.
The “required” attribute works only on empty values. In this snippet, we’ll show how to apply it to the HTML <select> element. Read and find some examples.
Read this snippet to find out how you can use the “required” attribute with the radio Input field. Here, you can also find an example and try it yourself.
In this tutorial, you will find some examples of using the HTML <fieldset> element. Besides, you can find out why in general we need the <fieldset> element.
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.
Read this tutorial and learn a fast and easy solution to the issue of validating an email using JavaScript. Also, you will read about what the email is.
A common question is how to align text next to an image vertically? Read this snippet and learn to do it step by step, as well as try different examples.
On this page, we’ll demonstrate how to vertically align a text within an HTML <span> element. Use the CSS align-items, text-align, or vertical-align properties.
In this snippet, we will demonstrate some techniques of vertically aligning an image within an HTML <div> element with responsive height. Read and try examples.
In this tutorial, learn how you can vertically align two <div> elements with Bootstrap. On this page, we’ll demonstrate some examples for Bootstrap 3.4.1 and 4.5.0.
This snippet will help you to align a <div> element for all browsers vertically. You will learn to do it step by step with our examples and explanations.
On this page, you’ll learn how to vertically align inline (inline-block) elements. Try examples with many different methods (CSS padding, vertical-align, etc.).
In this snippet, we’ll demonstrate how to wrap a long string without any whitespace character. Use the CSS word-wrap property with the “break-word” value.
The <pre> tag inserts a preformatted text into an HTML document. Since the <pre> tag doesn’t support wrapping, we’ll show how to do it with the help of CSS.
In this tutorial, we’ll demonstrate how to wrap the content of a table cell. For that, you need to use either the CSS word-wrap or word-break property.
If you’ve faced the situation when you need to wrap long words in a <div>, use the white-space property with the “pre-wrap” value and word-wrap property.