Reputation: 13
I am tasked with adding a background image for a home page. However, I do not have access to the CSS file associated with the HTML document I am working on (3rd party company created / has that file). The document I am working with consists of the HTML code's body.
Is it possible to add a background-image within the body of an HTML document? (All the examples I have seen add it in the head)
Upvotes: 0
Views: 7582
Reputation: 53
There many ways to do this, but I wouldn't suggest this because it's not the professional way! Any way this is an example:
<body style="background-image: url(https://cdn.pixabay.com/photo/2016/04/15/04/02/water-1330252__340.jpg)">
<p>Content</p>
Upvotes: 1
Reputation: 141
There are some ways you could tackle this.
body
element<body style="background-image: url(image.jpg);">
It's not the nicest technique but you could add this to your HTML
<style>body {background: url(image.jpg);}</style>
Upvotes: 0
Reputation: 26
<body style="background-image: url(#);">
This should do the trick for you!
Upvotes: 1
Reputation: 163
<body background="image.png">
By adding image path in body you can add image without having access to css
Upvotes: 0