Html


#1

<!DOCTYPE html>
<html>

<head>
    <link type="text/css" rel="stylesheet" href="sample.css" />
    <title>SAMPLE</title>
</head>

<body>
    <table>
        <tr>
            <td><img src="untitled.png" /></td>
        </tr>
    </table>
</body>

</html>

THIS IS MY HTML CODE .

AND THIS IS MY CSS CODE

body {
   background-image:url(pexels-photo-149246.jpeg);  
}

WHAT'S WRONG IN THIS?


#2

As you use the
src the png-file is in the same directory as the HTML-file
url() the file is looked for in the same the directory as the CSS file

Some documentation
https://developer.mozilla.org/en-US/docs/Web/CSS/background-image
https://developer.mozilla.org/en-US/docs/Web/CSS/url
https://stackoverflow.com/questions/940451/using-relative-url-in-css-file-what-location-is-it-relative-to
https://stackoverflow.com/questions/12032337/differences-between-url-src-and-href


#3

Should I write the name of the images with the extension for 'e.g.
seed.png'.


#4

I do not understand your question.....
Could you provide the link to the lesson ??


#5

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