harel486 harel486 - 5 months ago 15
CSS Question

CSS change div background image whisch is in a folder

<head id="Head1" runat="server">
<title>Title</title>

<style>

.parallax
{
/* The image used */
background-image: url(Pictures/BackUS.png);


height: 100%;


/* Create the parallax scrolling effect */
background-attachment: fixed;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
</style>

</head>
<body>
<form id="form1" runat="server">

<div class="parallax"></div>


Picture

"aa"
is the page which the code is in, the picture is the folder
"Pictuers"
and it's named
BackUS.png
. All of it in folder
"User"
.

How to write this line:

background-image: url(Pictures/BackUS.png);

Answer

If the Pictures Folder is in the same folder as the html code this should work. Please be aware the div must have a size to see the picture in the back. (You should adapt the size to the picture pixels.)

<body>
    <style type="text/css">
        .parallax {
                /* The image used */
                    background-image: url(Pictures/BackUS.png);


                    height: 100%;


                    /* Create the parallax scrolling effect */
                    background-attachment: fixed;
                    background-position: center;
                    background-repeat: no-repeat;
                    background-size: cover;
        }
    </style>
  <div class="parallax" >Hello</div>
</body>
Comments