i’m very new at css/html, i’m trying to use an image on my page, but this code does not work :
it should set the image at the window’s width and height with my “100%” but it’s just showing the image as is, and for “myclass”, i tried to add some text, or not, but it does not show the border.
i followed a tutorial but i don’t know where the problem is :
body {
background-image:url("landscape.jpeg");
background-size:100%;
}
.myclass { position:relative; border:1px solid red; }
<div id="myclass">
<p></p>
</div>
Thank you for your help
If the background image does not show, then the reason is probably that the URL is wrong.
The selector
.myclassmatches no element, as there is no element with classmyclass. Changeid="myclass"toclass="myclass".The
background-sizeproperty has limited browser support.