Background doesn't display

Hello everyone
I was practicing how to create links between html and css. When I run the page, all the images are displayed in the browser except the first one and I do not understand why? Thank you for reading the email, have a good day.

.main {
text-align: center;
background: url(“”) no-repeat center center;
background-size: cover;

Could you please provide more code?
As well as a link to the exercise?

Now, based on what you posted:

<.main {
text-align: center;
background: url("") no-repeat center center;
background-size: cover;

I’d like to know what <. and .> are?


1 Like

thank you for your reply Ghostlovescore!

Is this exercise, I put both file in my computer but when I run the html, the first background doesn’t display,


<. and .> oh sorry is a mistake!

Thank you

So, if I got this right, this doesn’t show when both files (html and CSS) are on your computer, not on Codecademy?

I just tried setting this up on my desktop and everything works.

You’ll have to make sure that both files are in the same folder, and that the link to the CSS sheet is correct. They don’t necessarily have to be in the same folder, but for the sake of this exercise, let’s do that.

Put index.html and style.css in the same folder.

Then, in your HTML document, make sure to modify the link to the CSS, like this:

<link href="style.css" type="text/css" rel="stylesheet" />

I just changed /style.css to style.css

That’s basically what I did, and everything worked nicely. What puzzles me is that you said “the first background doesn’t display”. Does that mean the other two do show?

1 Like

I suppose that there is not problems with files emplacement, because is URL, isn’t?
I just would like to know why does it works in the codecademy and it does’nt work in my computer? and why the other urls works and the first one does’nt work?
Yes, exactly!

These are absolute URLs so there shouldn’t be any issues, especially when it’s working fine on my end.

Are you sure you didn’t change anything in the code?

1 Like

No, I’m not sure, now I’m going to verify and follow your recommendations, thank you ghostlovescore.

I will let you know more late if it works, thanks a lot :grinning:

1 Like

Thank you Ghostlovescore, it works ! :smile:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.