How-to articles, tricks, and solutions about HTML

How to Make the Div Height to Auto-Adjust to the Background Size

It is possible to make the <div> to automatically adjust to the background size without setting a specific height or min-height. In our snippet, we’ll show how this can be done.

How to Make the Text Bold in HTML

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.

How to Make the Text Input Non-Editable

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.

How to Manage a Redirect Request after a jQuery Ajax Call

In this JavaScript tutorial, you will read and learn detailed information about the method used for managing a redirect request after a jQuery Ajax call.

How to Match an Empty Input Box with CSS

It is possible to match an empty input box only if the input field is required. In this snippet, we’ll show how to do this using the CSS :valid pseudo-class.

How to match whitespace, carriage return and line feed using regular expression in PHP?

In PHP, you can match whitespace, carriage return, and line feed using the following regular expression:

How to minify php page html output?

To minify HTML output in PHP, you can use the following steps:

How to Open a Link From <iframe> in the Parent Window

In this snippet, you can find out how it is possible to open a link from the HTML <iframe> element in the parent window. For that, you can use the <base> element.

How to Open Hyperlink in a New Window

How to open hyperlink in a new tab using the target="_blank" attribute. Learn also how to do that by using JavaScript function. See examples.

How to output the response HTML data by a jQuery AJAX request?

In a jQuery AJAX request, you can output the response HTML data using the .html() method.

How to Overlay Images with CSS

Overlays can be a great addition to the image and create an attractive website. In this snippet, you can find different examples of overlaying images with CSS.

How to Overlay One Div Over Another

In this snippet, we’ll demonstrate how you can create an overlay effect for two <div> elements. For that purpose, use the CSS position and z-index properties.

How to Place a Div in the Middle of the Screen when It is Smaller than the Page

On this page, we’ll demonstrate how you can place your <div> element in the middle of the screen. For that, you need to use the CSS position property.

How to Position One Image on Top of Another in HTML/CSS

Sometimes, you may need to place one image over another one. It can be easily done with HTML and CSS. See how to use the position and z-index properties.

How to Prevent Long Words from Breaking a Div

In this snippet, we are going to present some methods that you can use to prevent long words from breaking a <div> element. For that, use HTML and CSS.

How to Prevent Scrollbar from Repositioning Web Page

When you center a page, it may move slightly on some browsers when navigating between pages. In this snippet, we’ll demonstrate how to solve this problem.

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.

How to Prevent the Appearance of Lines Around a Circle Created with clip-path

On this page, you will find out how it is possible to prevent the appearance of lines around a circle, which is created with the CSS clip-path property.

How to Redirect a Web Page in HTML

The meta tag with the http-equiv parameter set to Refresh is used to redirect a web page in HTML. Take a look at how you should do it. Practice with examples.

How to Relatively Position an Element without It Taking Space in the Document Flow

On this page, we’re going to demonstrate how you can relatively position an element without it having to take space in the document flow. Use CSS properties.

How to Remove All the Child Elements of a DOM Node in JavaScript

Read this JavaScript tutorial and learn several simple and fast methods that are used for removing all the child elements of the DOM node with examples.

How to Remove Default Arrow Icon from a Dropdown List

In this snippet, we’re going to demonstrate how you can remove the default arrow icon from a dropdown list. For that, you can use the appearance property.

How to Remove Focus Around Buttons on Click

In this snippet, you can see how to remove the focus around a button on click. To solve this problem, you use the CSS outline property with the “none” value.

How to remove line breaks (no characters!) from the string?

There are a few different ways to remove line breaks from a string in PHP. Here are two options.