Site Logo

Nikita Hlopov's

Blog about web development

Blog About Archive Tags

How to create a new element with class name in JavaScript

02 Feb 2021
  • javascript

JavaScript provides a native way to create new elements. A single createElement() method is available inside the document object which is supported by all browsers. But it’s not enough to create a new element with a class name or any other attributes for that matter.

Continue reading →

A list of basic Git commands for beginners for everyday use

29 Jan 2021
  • git
  • development

Knowing how to use Git is a must-have skill for any kind of developer these days. Git is a version control system for tracking file changes.

Continue reading →

Aspect ratio with CSS aka the padding hack

22 Jan 2021
  • css

When working with media whether it’s an image or a video, sometimes you have to preserve its initial proportions (aspect ratio). In this guide, I’ll try to explain how exactly you can achieve such a result with CSS.

Continue reading →

A complete guide to get viewport, device and document sizes with JavaScript

15 Jan 2021
  • javascript

JavaScript provides a native API to get the width and height of a viewport. But it’s important to understand the difference between what sizes you are getting as it may cause you some trouble.

Continue reading →

The difference between Rem vs Em in CSS explained

06 Jan 2021
  • css

It can be confusing and frustrating when trying to understand units in CSS. Especially relative units like em and rem.

Continue reading →
⟨ Previous Next ⟩

This work is licensed under a CC BY 4.0 License.
The code in this work is licensed under an MIT License.

Privacy policy