r/HTML • u/death_wish93 • Oct 05 '26
Question i require assistance
i am rather new to this and im working on a website for a game that i like and im struggling to figure out how to increase the opacity any help?
code here
<!DOCTYPE html>
<html>
<head>
<style>body{background-image: url('TBB.webp');background-size: cover;}</style>
<title> The Battle Bricks </title>
</head>
<body>
<!-- This is a code comment. It will not be displayed -->
</body>
</html>
yes, this is all i have currently. any help would be appreciated
4
Upvotes
3
u/chikamakaleyley Oct 05 '26
not sure what you mean by "increase the transparency"
But if you are saying you can't see the background image, the image is likely there, however, if you don't have anything inside the body tag, then its a height of '0' by default. You can test this theory by giving the body tag a height of something like 500px, or putting a bunch of text content inside the body tag
if you are just hiding the body content, then its hard to tell what the problem is without seeing more code
3
u/phn-cloudsnake Oct 05 '26
Your comment does not make more sense when reading it. I suggest doing some more research so you know what to ask. MDN and w3schools are great starting points.
1
u/death_wish93 Oct 05 '26
image used (i forgot to put it in)
1
u/chmod777 Oct 05 '26
what does
increase the transparencemean? the "transparence" of what?1
u/Kickbanblock Oct 05 '26
Do you mean something like that?
<!DOCTYPE html><html><head><style>body {background-image: url('TBB.webp');background-size: cover;}#opacity-layer {background-color: rgba(255, 255, 255, 0.3);position: absolute;top: 0;bottom: 0;left: 0;right: 0;}</style><title>The Battle Bricks</title></head><body><div id="opacity-layer"><!-- This is a code comment. It will not be displayed --></div></body></html>2
u/Impressive_Air6111 Oct 05 '26
The comment explaining that it's as comment is a rite of passage almost as important as "Hello, world!". 😂
1
u/armahillo Expert Oct 05 '26
Whitespace is free and improves readability. Theres no reason to cram all that stuff into a single line.
Take a look at how CSS is typically written elsewhere