Background does not appear [HTML5]

Asked

Viewed 58 times

-2

(Solved) I don’t know what I did, I just know it’s working now :thinking:

Good morning/late/evening.
I started studying Html5 this week, but ended up getting stuck at the time of inserting a background image in the project. I tried to put the entire directory of the image, however it still doesn’t work... Here’s a part of the code in question

<!DOCTYPE html>
<html lang="pt-br">
<head>
  <meta charset="UTF-8"/>
  <title>Google glass foi uma bosta</title>
  <style>
    body {
	
	background-image: url("site-background.jpg");
	background-color: gray;
	color: black;
	}
    p {
	    text-align: justify;
		text-indent: 50px;}
  
  
  </style>
</head>
<body>

  • 1

    I don’t know if it will, but you don’t need to quote the name of the image inside the background-image: url( site-background.jpg ); and check if the extension is . jpg or . jpge vc tb can try to put a height on the body, like height:100%

  • 1

1 answer

-2


Try to put it on the body. Do this test. If the image appears there is something wrong in the tag style.

img src="images/photo.png" alt="Page image not found" width="330" height="202"

  • The image appeared Igor. It must be something wrong in the <style> tag like you said, but what would it be?

  • I have no idea what I’ve done, but it’s working now...

  • If it’s working and you haven’t done anything because it’s cache, be careful. Clear the cache and see if it still works.

  • Clear the browser cache?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.