In software development we always try to follow rules and best practices to produce better products by minimizing code. One of the most popular mantras is the D.R.Y (Don’t Repeat Yourself) principle and states the following:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
Of course, it is not always easy to perfectly follow this principle. For example, this can become difficult in front-end development and, more precisely, when it comes to CSS.
During the creation of a website, you will sometimes want to add the “float” CSS property to some of your containers to handle alignment within a container.
This CSS property specifies whether or not a box within an element should float.