How to make CSS position absolute element full width?

Spread the love

Sometimes, we want to make CSS position absolute element full width.

In this article, we’ll look at how to make CSS position absolute element full width.

How to make CSS position absolute element full width?

To make CSS position absolute element full width, we make the set left and right properties both to 0.

For instance, we write

#site_nav_global_primary {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

to set left and right properties both to 0 to make the element with ID site_nav_global_primary full width.

Conclusion

To make CSS position absolute element full width, we make the set left and right properties both to 0.

Leave a Reply

Your email address will not be published. Required fields are marked *