How To Set Random Image As Background in blogger

How To Set Random Image As Background in blogger

Updated on 16 May


Making your website responsive and beautiful very good technique to get traffic and visitors to your website.

Today in this article I am going to tell you how you can change background images every time when the page is reloaded you can say how you can change or set random images background.


Hi designers today we are going to build Set Random Image As Background In Blogger. As you know the HTML markup is vital for that so we should have some HTML markup first . Below is the code provided and you have to save it with the filename as provided.

Save It As index.html :

<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>Cara Memasang Random Background Blogger</title>
<link rel="stylesheet" href="css/style.css"/>
</head>
<body>
<div class="container">
<h1>Set Random Image As Background in blogger</h1>
<input type="button" value="Refresh Page" onclick="refreshPage()"></input>
<span>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque dapibus, tortor sit amet rhoncus lobortis, leo libero suscipit justo, ac tincidunt ligula eros sit amet sem. Sed lobortis nisl sed diam porttitor, quis lacinia felis lacinia. In urna nulla, consectetur nec nisi vitae, laoreet pellentesque augue. Donec feugiat, velit eu imperdiet semper, ante sem suscipit nulla, congue suscipit ipsum tellus commodo ipsum. Sed pharetra orci a volutpat faucibus.
</br> </br>
Donec feugiat, velit eu imperdiet semper, ante sem suscipit nulla, congue suscipit ipsum tellus commodo ipsum. Sed pharetra orci a volutpat faucibus.
</br> </br></p>
</span>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque dapibus, tortor sit amet rhoncus lobortis, leo libero suscipit justo, ac tincidunt ligula eros sit amet sem. Sed lobortis nisl sed diam porttitor, quis lacinia felis lacinia. In urna nulla, consectetur nec nisi vitae, laoreet pellentesque augue. Donec feugiat, velit eu imperdiet semper, ante sem suscipit nulla, congue suscipit ipsum tellus commodo ipsum. Sed pharetra orci a volutpat faucibus.
</br> </br>
Donec feugiat, velit eu imperdiet semper, ante sem suscipit nulla, congue suscipit ipsum tellus commodo ipsum. Sed pharetra orci a volutpat faucibus.
</br> </br>
Sed lobortis nisl sed diam porttitor, quis lacinia felis lacinia. In urna nulla, consectetur nec nisi vitae, laoreet pellentesque augue.
</br> </br>
Sed lobortis nisl sed diam porttitor, quis lacinia felis lacinia. In urna nulla, consectetur nec nisi vitae, laoreet pellentesque augue. Donec feugiat, velit eu imperdiet semper, ante sem suscipit nulla, congue suscipit ipsum tellus commodo ipsum. Sed pharetra orci a volutpat faucibus.
</br> </br>
Donec feugiat, velit eu imperdiet semper, ante sem suscipit nulla, congue suscipit ipsum tellus commodo ipsum. Sed pharetra orci a volutpat faucibus.</p>
</span>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"><-e30/script>
<script
src="js/index.js"></script>
</body>
</html>


I have used some images from external website you can choose that images to your own for that you have to change that image code inside your code.

Without CSS our this script (Set Random Image As Background In Blogger) will never look cute. So here we are, our HTML markup is ready now we have to customize our HTML and it can be done using CSS.


So below is the CSS code for our HTML markup and you have to save it with the filename as provided. Make a new folder called css and put this file to that folder.

Save It As css/style.css :

@import url(https://fonts.googleapis.com/css?family=Roboto:400,400i,700,700i);
a,a:link,a:visited {color:#ffa502;text-decoration:none;transition:all .3s}
a:hover,a:hover:visited {color:#ea9906}
*,*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}
body {
  background: #f5f5f5;
  font-family: "Roboto", sans-serif;
  margin: 0;
  padding: 0;
  position: relative;
  line-height: normal;
}

.container {
  max-width: 970px;
  margin: 4% auto;
  padding: 30px;
  background: #fff;
  color: #666;
  font-size: 16px;
  line-height: 1.6;
  border-radius: 10px;
  box-shadow: 0 3px 20px rgba(0, 0, 0, 0.03);
  overflow:hidden
}

.container h1,
.container h2 {
  display: block;
  margin-bottom: 40px;
  font-size: 2rem;
  font-weight: 700;
  color: #000;
}

.container h2 {
  margin-top: 30px;
}

.container input {
  margin: 30px auto;
  text-align:center;
  display:table;
  padding:10px 15px;
  font-size:16px;
  background:#ff7675;
  color:#fff;
  border:0;
  border-radius:3px;
  cursor:pointer;
  transition:all .3s
}
.container input:hover,.container input:active {
  background:#d63031;
  color:#fff;
  outline:none
}



Making your website responsive and beautiful very good technique to get traffic and visitors to your website.

Today in this article I am going to tell you how you can change background images every time when the page is reloaded you can say how you can change or set random images background.

Hi designers today we are going to build Set Random Image As Background In Blogger. As you know the HTML markup is vital for that so we should have some HTML markup first . Below is the code provided and you have to save it with the filename as provided.

Save It As js/index.js :

<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>Cara Memasang Random Background Blogger</title>
<link rel="stylesheet" href="css/style.css"/>
</head>
<body>
<div class="container">
<h1>Set Random Image As Background in blogger</h1>
<input type="button" value="Refresh Page" onclick="refreshPage()"></input>
<span>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque dapibus, tortor sit amet rhoncus lobortis, leo libero suscipit justo, ac tincidunt ligula eros sit amet sem. Sed lobortis nisl sed diam porttitor, quis lacinia felis lacinia. In urna nulla, consectetur nec nisi vitae, laoreet pellentesque augue. Donec feugiat, velit eu imperdiet semper, ante sem suscipit nulla, congue suscipit ipsum tellus commodo ipsum. Sed pharetra orci a volutpat faucibus.
</br> </br>
Donec feugiat, velit eu imperdiet semper, ante sem suscipit nulla, congue suscipit ipsum tellus commodo ipsum. Sed pharetra orci a volutpat faucibus.
</br> </br></p>
</span>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque dapibus, tortor sit amet rhoncus lobortis, leo libero suscipit justo, ac tincidunt ligula eros sit amet sem. Sed lobortis nisl sed diam porttitor, quis lacinia felis lacinia. In urna nulla, consectetur nec nisi vitae, laoreet pellentesque augue. Donec feugiat, velit eu imperdiet semper, ante sem suscipit nulla, congue suscipit ipsum tellus commodo ipsum. Sed pharetra orci a volutpat faucibus.
</br> </br>
Donec feugiat, velit eu imperdiet semper, ante sem suscipit nulla, congue suscipit ipsum tellus commodo ipsum. Sed pharetra orci a volutpat faucibus.
</br> </br>
Sed lobortis nisl sed diam porttitor, quis lacinia felis lacinia. In urna nulla, consectetur nec nisi vitae, laoreet pellentesque augue.
</br> </br>
Sed lobortis nisl sed diam porttitor, quis lacinia felis lacinia. In urna nulla, consectetur nec nisi vitae, laoreet pellentesque augue. Donec feugiat, velit eu imperdiet semper, ante sem suscipit nulla, congue suscipit ipsum tellus commodo ipsum. Sed pharetra orci a volutpat faucibus.
</br> </br>
Donec feugiat, velit eu imperdiet semper, ante sem suscipit nulla, congue suscipit ipsum tellus commodo ipsum. Sed pharetra orci a volutpat faucibus.</p>
</span>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"><-e30/script>
<script
src="js/index.js"></script>
</body>
</html>


I have used some images from external website you can choose that images to your own for that you have to change that image code inside your code.

Completion :

So here we are, We have done and our project Set Random Image As Background In Blogger is ready now you can save all the files as provided.
Like CSS files in css folder and JavaScript files in a JS folder name. Below is folder tree of the files and folders of this project.

  • Set Random Image As Background In Blogger
    • css
      • style.css
    • js
      • index.js
    • index.html
I hope that you will like my this post and if you do then please share it with your friends and keep visiting this site for more this kind of projects and tutorials.

source:raufgraphics.com

0 comments for How To Set Random Image As Background in blogger