How-to articles, tricks, and solutions about HTML

HTML Upload MAX_FILE_SIZE does not appear to work

In PHP, you can use the $_FILES array to check the size of an uploaded file.

HTML/PHP - Form - Input as array

To create an HTML form that submits an array as a form parameter, you can use the name attribute of the input element and give it a value in the form of an array.

HTML5 Page Structure

Learn how to create an HTML5 page step by step. From doctype to different sections. See syntax and examples and practice yourself.

If else embedding inside html

There are a few different ways you can embed PHP code inside HTML.

Input Types for HTML Forms

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.

Is It Possible to Nest an HTML <button> Element Inside an <a> Element in HTML5

In this snippet, learn whether it’s possible to nest a <button> tag within an <a> in HTML5. To have a button linking to somewhere, you need an alternative solution.

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.

Is It Possible to Use the CSS @media Rule Inline

In this snippet, you will find out why it is not possible to apply CSS @media rules inline. Read this snippet to learn how to apply them in the internal style.

Lazy load images with JavaScript

Read this tutorial and learn detailed information about some simple and fast techniques that are used to decrease image loading time using JavaScript.

PHP & localStorage

PHP is a programming language that is often used to build web applications.

PHP code to get selected text of a combo box

To get the selected text of a combo box (also known as a dropdown menu or select box) in PHP, you can use the following code:

PHP form - on submit stay on same page

To stay on the same page after a form submission in PHP, you can use the following steps.

php variable in html no other way than: <?php echo $var; ?>

Yes, that is one way to output the value of a PHP variable in HTML.

PHP/regex: How to get the string value of HTML tag?

In PHP, you can use the preg_match() function to extract the string value of an HTML tag.

Remove HTML tags from a String

To remove HTML tags from a string, you can use a regular expression to match and replace the tags with an empty string.

Send html form data to sql database via php (using mysqli)

To send HTML form data to a SQL database using PHP, you will need to use the mysqli (MySQL Improved) extension in PHP.

Send value of submit button when form gets posted

In PHP, you can access the value of a submit button when a form is posted in the following way:

Setting POST variable without using form

To set the value of a POST variable in PHP, you can use the following code:

Submit html table data with via form (post)

Here is an example of how to submit an HTML table data via a form (using the POST method) using PHP:

utf-8 special characters not displaying

This issue is likely caused by a mismatch between the character encoding used by the source of the text (e.g.

What does the CSS Tilde (~) Selector Mean

In this snippet, we will introduce what is the subsequent-sibling combinator (~), why and how it is used. Try some examples to have a better understanding of it.

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.

What is the Difference Between <b> and <strong>, <i> and <em> Tags

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.

What is the Difference Between <section> and <div> Elements

Read this snippet to find out the differences between the HTML <section> and <div> elements and see which element to use in some specific situations.

What is the Difference Between the "id" and "name" Attributes

In this snippet, we’re going to discuss the differences between the “id” and “name” attributes, after which you’ll make a better decision of their usage.