Make Ur Own Gallery in HTML.
First of all rename your all pictures with 1,2,3...... and copy the following code in notepade and then save it with .html extension in same folder where picture exist.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width">
<style>
img {
max-width: 100%;
}
</style>
<title>gallery</title>
<style>
div id="frame"{
margin:center;
padding:center;
}
div#linkButton{
margin-right:30%;
margin-left:30%;
}
img{
margin:10%;
width: 80%;
height: 80%;
}
button{
background-color: pink;
border-color: red;
width: 50px;
height: 50px;
}
</style>
</head>
<body>
<div id="frame">
<img src="1.jpg" alt="image 1" / id="frameImage">
</div>
<div id="linkButton">
<button onclick="document.getElementById('frameImage').src='1.jpg'" >1</button>
<button onclick="document.getElementById('frameImage').src='2.jpg'" >2</button>
<button onclick="document.getElementById('frameImage').src='3.jpg'" >3</button>
<button onclick="document.getElementById('frameImage').src='4.jpg'" >4</button>
<button onclick="document.getElementById('frameImage').src='5.jpg'" >5</button>
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width">
<style>
img {
max-width: 100%;
}
</style>
<title>gallery</title>
<style>
div id="frame"{
margin:center;
padding:center;
}
div#linkButton{
margin-right:30%;
margin-left:30%;
}
img{
margin:10%;
width: 80%;
height: 80%;
}
button{
background-color: pink;
border-color: red;
width: 50px;
height: 50px;
}
</style>
</head>
<body>
<div id="frame">
<img src="1.jpg" alt="image 1" / id="frameImage">
</div>
<div id="linkButton">
<button onclick="document.getElementById('frameImage').src='1.jpg'" >1</button>
<button onclick="document.getElementById('frameImage').src='2.jpg'" >2</button>
<button onclick="document.getElementById('frameImage').src='3.jpg'" >3</button>
<button onclick="document.getElementById('frameImage').src='4.jpg'" >4</button>
<button onclick="document.getElementById('frameImage').src='5.jpg'" >5</button>
</div>
</body>
</html>

Comments
Post a Comment