Using the calc Method in CSS

Feature thumb snip20170711 11

In the more modern versions of CSS, we have the ability to calculate properties. For example, if you want to have a width that takes in the margin size into account, you can use code like this:

.box {
  width: calc(33.33333% - 20px);
  margin: 10px;
}

 

Which will prevent the box from moving down to the next line, as shown here: