0

Bootstrap defines CSS classes to cover most common website design elements, but I can't figure out how to specify a background image file using Bootstrap classes without adding clunky customized CSS.

1 Answers1

1

You will have to give background-image:url(''); property using style to give the path of the image and you can make the image responsive using .bg-image class.
Here's how you can do that:
Add background-image via inline CSS.
Add .bg-image class to scale the image properly and to enable responsiveness.
Example:

<div class="bg-image" 
     style="background-image: url('https://i.postimg.cc/ZnHTP71s/aircraft-airplane-boat-1575833.jpg');
            height: 100vh">
</div>

vh stands for viewport height.
Here the height:100vh means 100% of the available height.

HarshShah
  • 119
  • 7