You can use the .THIS
class in the Lightning Component style file. .THIS
refers to the whole lightning component.
Step 1:
Get the url of the static resource that is similar to this format resource/#############/resourceName
.
You can get this simply by adding the static resource reference in Lightning Component Markup(Component File) - {!$Resource.imageResourceName}
Once you run the component - it will show the URL of the static resource.
Step 2:
Just grab the URL that you got in step one and add it in the .THIS
class, something like this:
.THIS{
background-image: url('/resource/1556180826000/Arunachala_pic') !important;
}
And that's it!
I hope this helps! :)