Web browser not displaying background image

Hello I can’t seem to get my background image to display in the browser here is the code:

body{

     background-image:url("https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fcdn.vox-cdn.com%2Fthumbor%2F-pb3q25KzXisXFCcA6Rc2zhLNTM%3D%2F35x0%3A460x283%2F1200x800%2Ffilters%3Afocal(35x0%3A460x283)%2Fcdn.vox-cdn.com%2Fassets%2F934098%2FThomsonKick02.jpg&f=1&nofb=1");

             background-repeat:no-repeat

                      background-size cover;

}

Missing colon.

Also, fix the URL so that it resolves to a single CDN without being a referrer link from a search engine.

not familiar with that terminology, just looked it up and I’m not sure what one single cdn would look like

The link above is to a search engine result. Not very appropriate content, imho, but whatever blows your skirt up. We have enough violence in the world, surely you could find a better picture to use as a background image. Be sure that the link is directly to the image in the Content Distribution Network (CDN) and that you have appropriate permission to use it on a web facing page. It is copyright infringement to use pictures from another domain. That is tantamount to theft.

1 Like

I realize that there is tons of violence in this world but I wanted to accurately depict the sport which is violent but I guess I could just use the ring or octagon where they battel, furthermore how can I tell that the image is directly from the image and not its page because iv seen videos on this subject and they just take images off of google so I just assumed I would be able to do the same.

Just because others are doing it does not make it right, or okay to do so. Come by your images honestly and only from legitimate sources. That it is found on Google does not relinquish ownership. Google indexes the web. It does not know or care about ownership. The web is its domain.

Thanks for the advice but I’m still at a loss on where to get my images from.

Search for ‘free stock images’, for starters. Otherwise search for ‘public domain stock images’.

Images in the public domain have no copyright protection.

1 Like

One should add the importance of source domain. An image may be public domain, but that doesn’t mean the host want’s you to hot link to it. Download it, upload to another (your) domain, and serve it from there.

Just as using images we have no right to is wrong, requesting images from a domain that is not our own is also wrong since it is using their paid for bandwidth. We are in this sense stealing bandwidth.

These may be old world problems, but they nonetheless deserve some understanding. If a myriad of exploiting sites are requesting an image from my site, then I might have no recourse than to shut down my site. It’s content has been stolen and I am paying for the bandwidth of all those requests. My purpose in creating a site was not to have it stolen from me.

From now on I will use only free stock images thank you.

1 Like

I am new to codecademy I just read this article and found it most informitive, I had no idea that I shouldnt take an image from the internet because it is a copyright violation I’ll make sure that I dont do that in the futchure ,I also now know what CDN means.

1 Like

O BTW I meant to say that I am grateful where to look for images. excuse the misspelling of words I wanted to get that out and didn’t take the time to correct my spelling.

1 Like

so now I have the free stock image I downloaded it to my computer and I have the following code and it’s still not working
body{

background-image: "pexels-vlad-dediu-2581662.jpg";

    background-repeat: no-repeat;

        overflow: scroll;

            background-size: cover ;

}

h1{color:darkviolet}

    h2{color:blue}

        p{color:red}

We need to use the URL function to load an image.

background-image: url(pexels-vlad-dediu-2581662.jpg);

Not that the quotes are optional. Be sure the file is in the same folder as the CSS, else you will need to adjust the path.

thanks that worked perfectly

1 Like

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