'How can I make the css background? [closed]

I'd like to create static basic HTML & CSS page but I was wondering how can I make the background like the Image attached?



Solution 1:[1]

Here is a simple CSS code. Add this in you <head>-tag.

<style>
body {
background-image url(image.png);
}
</style>

You can replace body. E.g.: div#idcard or div.idcard.

Solution 2:[2]

To elaborate on aWebDesigner123's answer:

body {
background-image: url(https://na-dache.pro/uploads/posts/2021-05/1620984771_105-p-greipfrut-foto-119.jpg);
background-repeat: no-repeat;
background-attachment: fixed;
background-position: center;
background-size: cover;
}

Solution 3:[3]

background-image: url(path); should be added to give the background image to the website.

For further syntax, you can refer the following documentation : https://developer.mozilla.org/en-US/docs/Web/CSS/background-image

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 aWebDesigner123
Solution 2 Crimp
Solution 3 Akshaya Dupati