Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <head>
<link href="https://fonts.googleapis.com/css?family=Amatic+SC|Caveat|Montserrat|Quicksand&display=swap" rel="stylesheet">  
<link href="https://fonts.googleapis.com/css?family=Montserrat|Six+Caps&display=swap" rel="stylesheet">  
  
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>  
  
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">  

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
  

  
</head>
<body>
  
<div id="container">
  <button id="shuffle" onclick="random_imglink()">SEE MORE</button>
    
  <div id="navbar">
     <div id="div1" >
       <img id="img1" src="https://www.edreams.com/blog/wp-content/uploads/sites/3/2013/07/shutterstock_1013396287.jpg">
       
    </div>    
    
    
     <div id="div2"><img id="img2" src="https://www.listchallenges.com/f/items/7738effd-24b5-4b46-8ca5-1b19ab764b21.jpg">
 
    </div>
    
     <div id="div3"><img id="img3" src="https://www.edreams.com/blog/wp-content/uploads/sites/3/2013/07/shutterstock_548968690.jpg">
 
    </div>
    
     <div id="div4"><img id="img4" src="https://i.pinimg.com/originals/db/f3/9d/dbf39d231f5c9256c3c1fe831a55ba17.jpg">
  
    </div>
    
     <div id="div5"><img id="img5" src="http://www.100placestovisit.com/wp-content/uploads/2013/07/100-places-to-visit-before-you-die-edinburgh.jpg">
     
    </div>
    
    <div id="div6"><img id="img6" src="https://cdn.pixabay.com/photo/2016/02/08/04/48/greece-1186044_960_720.jpg">
     
    </div>
    
     <div id="div7"><img id="img7" src="https://www.edreams.com/blog/wp-content/uploads/sites/3/2013/07/shutterstock_1293922393.jpg">
     
    </div>
    
     <div id="div8">
       <img id="img8" src="https://www.edreams.com/blog/wp-content/uploads/sites/3/2013/07/shutterstock_445057963.jpg">
     
    </div>
    
     <div id="div9"><img id="img9" src="https://i.ytimg.com/vi/K2jw6ktOi20/maxresdefault.jpg">
       <span class="tooltiptext"><a id="a9" href="https://www.amazon.com/000-Places-See-Before-You/dp/0761104844" target="_blank">Discover all places >></a></span>
    </div>
    
    <div id="div10"><img id="img10" src="https://i.pinimg.com/originals/df/ca/39/dfca396237af72e3ff7a21dd104101dc.jpg">
     
    </div> 
    
    </div>
  </div>
</body>
              
            
!

CSS

              
                body{
  background-color:#121212;
}

#container{
  display:flex;
  justify-content:center;
  align-items:center;  
  padding-top:20px;
}

#navbar {
  height:auto;
  width:auto;
  margin-top:10px;
  margin-bottom:10px;
  background:black;
  border:2px solid #3edbea;
  padding:10px;
  box-shadow:7px 7px 10px rgba(160, 177, 174, 0.4);
  display:grid;
  grid-template-columns:100px 100px 100px 100px;
  grid-template-rows:130px 100px 100px 100px;
  grid-gap:10px;
  grid-template-areas:"div1 div2 div3 div3"
                      "div1 div5 div4 div7"
                      "div6 div9 div9 div7"
                      "div8 div9 div9 div10"
                     ;
  
}

@media only screen and (max-width:720px){
  #navbar {
    display:flex;
    flex-direction:column;
    flex-wrap:wrap;
  }
  img{
    height:auto;
    width:80%;
    object-fit:cover;
    
  }
  #div1{
    height:300px;
    width:300px;
    margin-bottom:15px;
    
  }
  #div2{
    height:300px;
    width:300px;
    margin-bottom:15px;
    
  }
  #div3{
    height:300px;
    width:300px;
    margin-bottom:15px;
   
  }
  #div4{
    height:300px;
    width:300px;
    margin-bottom:15px;
   
  }
  #div5{
    height:300px;
    width:300px;
    margin-bottom:15px;
    
  }
  #div6{
    height:300px;
    width:300px;
    margin-bottom:15px;
   
  }
  #div7{
    height:300px;
    width:300px;
    margin-bottom:15px;
    
  }
  #div8{
    height:300px;
    width:300px;
    margin-bottom:15px;
   
  }
  #div9{
    height:300px;
    width:300px;
    margin-bottom:15px;
   
  }
  #div10{
    height:300px;
    width:300px;
    
  }
  #navbar > #div9 .tooltiptext {
    margin-left:-200px;
  }
}

img{
  height:100%;
  width:100%;
  object-fit:cover;
  
}

#div1{
 grid-area:div1;
 position:relative;  
}

#div2{
grid-area:div2;
position:relative;    
}

#div3{
grid-area:div3;
position:relative;    
}

#div4{
grid-area:div4;
position:relative;    
}

#div5{
 grid-area:div5;
 position:relative;  
}

#div6{
grid-area:div6;
position:relative;    
}

#div7{
grid-area:div7;
position:relative;    
}

#div8{
grid-area:div8;
position:relative;    
}

#div9{
grid-area:div9;
position:relative;   
}

#div10{
grid-area:div10;
position:relative;  
}

#navbar > #div9 .tooltiptext {
  visibility: hidden;
  width: 120px;
  height:100px;
  background-color: rgba(0, 0, 0, 0.94);
  color:white;
  text-align: center;
  border-radius: 15px;
  padding: 10px 0;
  top:50%;
  margin-left:-180px;

  /* Position the tooltip */
  position: absolute;
  z-index: 1;
}


#navbar > #div9:hover .tooltiptext {
  visibility: visible;
  
}

a{
  text-decoration:none;
  font-family:'Quicksand';
  color:white;
  font-size:15px;
}

a:hover{
  text-decoration:underline;
  font-size:17px;
}

#shuffle{
  position:absolute;
  top:15px;
  background:rgba(0, 0, 0, 0.89);
  border:1px solid #3edbea;
  color:white;
  font-family:'Quicksand';
  padding:3px 5px;
  
  
}

#shuffle:hover{
  border:1px solid white;
  color:#3edbea;
}


              
            
!

JS

              
                function random_imglink(){
var imgCount = 3;

var randomCount = Math.round(Math.random() * (imgCount - 1)) + 1;
var images = new Array
images[1] = "https://www.farecompare.com/wp-content/uploads/2018/12/2019-Top-Travel-Destinations-Singapore.jpg",
images[2] = "https://thumbor.forbes.com/thumbor/960x0/https%3A%2F%2Fspecials-images.forbesimg.com%2Fdam%2Fimageserve%2F1171238184%2F960x0.jpg%3Ffit%3Dscale",
images[3] = "https://i.pinimg.com/originals/6d/01/a1/6d01a1cbb7a172df77bef22e7dbb5402.png",

document.getElementById("img1").src = images[randomCount];

var imgCount = 3;

var randomCount = Math.round(Math.random() * (imgCount - 1)) + 1;  
var imagestwo=new Array
imagestwo[1] = "http://www.world-around.me/wp-content/uploads/2016/04/top-destination-1170x600.jpg",  
imagestwo[2] = "https://www.traveller.com.au/content/dam/images/g/h/d/f/b/p/image.gallery.galleryLandscape.620x414.ghgq96.png/1433489931758.jpg", 
imagestwo[3] = "https://media1.popsugar-assets.com/files/thumbor/NBmkhh5uuTXxIP1w2AoPs48vTbk/fit-in/728xorig/filters:format_auto-!!-:strip_icc-!!-/2014/04/08/814/n/1922441/dfba9a098f616cac_shutterstock_109357922/i/25-Top-World-Destinations-2014-TripAdvisor.jpg", 
document.getElementById("img2").src = imagestwo[randomCount];  

var imgCount = 3;

var randomCount = Math.round(Math.random() * (imgCount - 1)) + 1;
var imagesthree=new Array
imagesthree[1] = "https://aavietnamtravel.com/wp-content/uploads/2019/10/unnamed-4.jpg",
imagesthree[2] = "https://i.pinimg.com/originals/af/0d/29/af0d29e8b6343451c7f9464ae9398129.jpg",
imagesthree[3] = "https://www.avernausa.com/wp-content/uploads/2018/06/vacation-650x434.jpeg",  
document.getElementById("img3").src = imagesthree[randomCount];
  
var imgCount = 3;
var randomCount = Math.round(Math.random() * (imgCount - 1)) + 1;
  var imagesfour=new Array
imagesfour[1] = "https://i.pinimg.com/originals/42/bb/e5/42bbe59ef679dc6a97cbfb9ef154be49.jpg",
imagesfour[2] = "https://news.expats.cz/wp-content/uploads/2019/03/iStock-831740990.jpg",
imagesfour[3] = "https://travelwirenews.com/wp-content/uploads/2019/01/image-27.jpg",  
document.getElementById("img4").src = imagesfour[randomCount];
  
var imgCount = 3;

var randomCount = Math.round(Math.random() * (imgCount - 1)) + 1;
var imagesfive=new Array
imagesfive[1] = "http://www.slovakia-maps.com/wp-content/uploads/2018/08/15.-Top-world-destinations.jpg",
imagesfive[2] = "http://travelercorner.com/wp-content/uploads/2016/06/london-top-rated-destination.jpg",
imagesfive[3] = "http://www.victoryinafrica.org/wp-content/uploads/2018/08/14.-Top-world-destinations.jpg",  
document.getElementById("img5").src = imagesfive[randomCount]; 
  
var imgCount = 3;

var randomCount = Math.round(Math.random() * (imgCount - 1)) + 1;
 var imagessix=new Array
imagessix[1] = "https://www.edreams.com/blog/wp-content/uploads/sites/3/2013/07/shutterstock_168634214.jpg",
imagessix[2] = "https://www.edreams.com/blog/wp-content/uploads/sites/3/2013/07/shutterstock_1221929191.jpg",
imagessix[3] = "https://www.edreams.com/blog/wp-content/uploads/sites/3/2013/07/shutterstock_1406860232.jpg",  
document.getElementById("img6").src = imagessix[randomCount];   
  
var imgCount = 3;

var randomCount = Math.round(Math.random() * (imgCount - 1)) + 1;
 var imagesseven=new Array
imagesseven[1] = "https://www.edreams.com/blog/wp-content/uploads/sites/3/2013/07/shutterstock_630570752.jpg",
imagesseven[2] = "https://www.edreams.com/blog/wp-content/uploads/sites/3/2013/07/shutterstock_175331063.jpg",
imagesseven[3] = "https://www.edreams.com/blog/wp-content/uploads/sites/3/2013/07/shutterstock_1040847316.jpg",  
document.getElementById("img7").src = imagesseven[randomCount];   
  
var imgCount = 3;

var randomCount = Math.round(Math.random() * (imgCount - 1)) + 1;
  var imageseight=new Array
imageseight[1] = "https://www.edreams.com/blog/wp-content/uploads/sites/3/2013/07/shutterstock_700484761.jpg",
imageseight[2] = "https://www.edreams.com/blog/wp-content/uploads/sites/3/2013/07/shutterstock_1038725650.jpg",
imageseight[3] = "https://www.edreams.com/blog/wp-content/uploads/sites/3/2013/07/shutterstock_599713124.jpg",  
document.getElementById("img8").src = imageseight[randomCount];   

var imgCount = 3;

var randomCount = Math.round(Math.random() * (imgCount - 1)) + 1;
  var imagesten=new Array
imagesten[1] = "https://www.edreams.com/blog/wp-content/uploads/sites/3/2013/07/shutterstock_65988730.jpg",
imagesten[2] = "https://www.thedubrovniktimes.com/media/k2/items/cache/29ce24a084a94893947f3fca54d7155f_XL.jpg",
imagesten[3] = "https://coconuts.co/wp-content/uploads/2017/03/bali-1542569_640.jpg",  
document.getElementById("img10").src = imagesten[randomCount];  
}				

              
            
!
999px

Console