25 CSS Hacks Every Developer Should Know

Full-width elements

Problem: making an element span the full width of its parent.

Solution: use `width: 100vw`.

.full-width {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}