remove padding if necessary, then reduce the width .
Try to save them as a percentage, for example
padding:5%; width:80%;
when they are added, it must be less than or equal to 100%. If you have margin then consider it as well. (suppose margin:5%; )
Example:
<----------------100%----------------> margin | padding| div |padding | margin |<--5%-->|<--5%-->|<--80%-->|<--5%-->|<--5%-->|
This is the same for adjusting horizontally (width) or vertically (height).
Mr_Green
source share