How do I make the width responsive?

In this case you should use media query. You can see the CSS on this topic as example "That page doesn't exist or is private" restyling with CSS