I'm working on an Angular 18 project, and I need to set a background image for my application. However, I'm not sure how to properly reference and display the image in the app. I've tried a few different approaches, but nothing seems to work.
I placed my image (background.jpg) in the src/assets/ folder.
I used CSS in my component's CSS file
What happens: The background image doesn’t show up, and the is just a blank area without any background.
I’ve also tried using the global styles.css file with the following, but it doesn’t work either:
What I want to achieve: I want the background image to cover the entire screen and remain responsive across different devices. Ideally, I want the background to be applied globally (to the body) or to a specific component, depending on the best approach.
What I expect: The background image should display as expected when the page loads, covering the entire background of the app.
Additional Information: I’m using Angular 18. I’ve checked the file path, and the image is located at src/assets/images/background.jpg.