How to set width to 100% – 100px in CSS?

Spread the love

Sometimes, we want to set width to 100% – 100px in CSS.

In this article, we’ll look at how to set width to 100% – 100px in CSS.

How to set width to 100% – 100px in CSS?

To set width to 100% – 100px in CSS, we use calc.

For instance, we write

div {
  width: calc(100% - 100px);
}

to set the div’s width to 100% – 100px with calc(100% - 100px).

Conclusion

To set width to 100% – 100px in CSS, we use calc.

Leave a Reply

Your email address will not be published.