Hello, I am trying to get the photo directly when I visit one of my pages with photos. But when I do it does not work. Try many things but it did not work.
Could someone explain to me how I can do to download my photo directly?
The code of my html would be the following:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function insert(){
var src = document.getElementById("gamediv");
var img = document.createElement("img");
img.src = "imagen.png";
src.appendChild(img);
}
</script>
</head>
<style>
body, html {
height: 100%;
margin: 0;
}
.bgimg {
background-image: url('fondo.jpg');
height: 100%;
background-position: center;
background-size: cover;
position: relative;
color: white;
font-family: "Courier New", Courier, monospace;
font-size: 25px;
}
#gamediv{
height: 20%;
}
.topleft {
position: absolute;
top: 0;
left: 16px;
}
.bottomleft {
position: absolute;
bottom: 0;
left: 16px;
}
.middle {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
}
hr {
margin: auto;
width: 40%;
}
</style>
<body>
<div class="bgimg">
<div class="topleft">
<!--<p>Logo</p>-->
</div>
<div class="middle">
<!--<h1>COMING SOON</h1>
<hr>
<p>35 days left</p>-->
</div>
<div class="bottomleft">
<!--<p>Some text</p>-->
</div>
<div id="gamediv">
<script type="text/javascript">
insert();
</script>
</div>
</div>
</body>
</html>
Try php but I opened another window. Try javascript but I do not know how I can do it so that I can download my photo directly.