SyntaxFix
Write A Post
Hire A Developer
Questions
To keep the aspect ratio, use background-size: 100% auto;
background-size: 100% auto;
div { background-image: url('image.jpg'); background-size: 100% auto; width: 150px; height: 300px; }