How-to articles, tricks, and solutions about TEXT
Learn the ways of how to disable text selection highlighting, how to disable copy, cut and paste, how to disable right-click. See example with CSS, JavaScript and jQuery.
Learn How to Find All Files Containing Specific Text on Linux with W3docs tutorial. Also, try the examples yourself and see the results.
CSS3 allows us to have various effects, including text flipping due to transformation functions. See examples of upside down, horizontal and vertical flipping.
Use CSS3 opacity property to make an image or a background transparent. Learn also how to change the opacity while hovering. All with examples.
Although CSS does not provide many options for the underlines below texts, there are some ways to do this. Read our snippet and find out the solutions.
In this snippet, you can find out how to limit the text length to one line by clipping the line, adding an ellipsis or strings. Use the text-overflow property.
In this snippet, you’ll see how to make the text bold by using the <strong> or <b> tags. Also, you can use the CSS font-weight property in the HTML part.
In this snippet, you can find two methods of making a text input non-editable. Use either the HTML “readonly” attribute or add the CSS pointer-events property.
To print colored text to the console using System.out.println, you will need to use special escape sequences in your string to specify the desired color.
One way to read a text file into a list or an array with Python is to use the split() method.
Use outline: none to remove the ugly border color for a form field in Chrome. Learn also how to give your own style for showing that the box is active. All with examples.
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.
You can use the strpos() function in PHP to search for a specific string within another string.
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.
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”.
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.
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.
To position text vertically positioned with CSS you can use vertical-align, line-height, transform properties, flexbox. Learn more methods. Try examples.
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.
Learn about mostly usedLearn about mostly used input types which are used when creating HTML Forms. See Syntax and examples. input types which are used when creating HTML Forms. See Syntax and examples.
In Python, you can use the built-in open() function to create a text file and write a string to it.
This code opens the file "filename.txt" and reads it line by line. Each line is printed to the console until the end of the file is reached.
Use text-shadow and box-shadow CSS properties for shadow effects in CSS. See how to have amazing effects for texts, borders and boxes.
In this snippet, we’re going to explain the differences between the <b> and <strong>, <i> and <em> tags. Find out the differences and use them correctly.