Web Developer Notes - Page 8
How to Center an Element Vertically Using CSS (Vertical Alignment)
Last updated: 21.02.2026
Views: 385
There are several ways of vertical alignment. In different situations, different ways are suitable. Consider some of them.
1. Using Flexbox
The easiest and most widely used method:
[css]
.container {
display: flex;
align-items: center; /* Centers vertically */
justify-content: center; /* Optional: Centers horizontally */
height: 100vh; /* Full viewport height, if needed. Or set you...
Countdown Timer in JavaScript
Last updated: 02.04.2026
Views: 416
Countdown timers are commonly used on websites that promote products, services, or special offers. You can often see them on landing pages or in online stores, where they are used to highlight limited-time deals and create a sense of urgency. By showing how much time is left until a specific event or deadline, such timers can help increase user engagement and encourage faster decision-making.
I...
How to Upload Files to a Server Using PHP
Last updated: 21.02.2026
Views: 367
Uploading files to a website is a common task. Consider uploading files to a PHP server using the POST method. This will require a form with the "file" field type and an enctype attribute with a multipart/form-data value. We will not use AJAX in this example, but will do a regular HTML form submission.
HTML
[html]
<form method="POST" enctype="multipart/form-data">
&l...
Swipe Events on Touch Devices in JavaScript
Last updated: 21.02.2026
Views: 269
Every day sensory devices are being introduced into our lives. These devices have specific events, unlike the desktop. One of these events is the swipe. Especially often have to deal with it when developing a mobile version of the site.
Swipe events on touch devices allow developers to detect gestures like swiping left, right, up, or down, commonly used for navigation or interaction. These even...
How to Get Max Value in JavaScript Array
Last updated: 21.02.2026
Views: 296
A short note about finding the maximum value in a JavaScript array with numeric values. The Array object in JS does not have its own max method.
To find the maximum value in a JavaScript array, you can use several methods. Here are the most common and efficient approaches:
1. Using Math.max() with the spread operator
The Math.max() function returns the largest number from a set of numbers...