Skip to main content

Image Grid Gallery Using CSS3

 Video: 


Images:






Source Code:

HTML:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="style.css">
    <title>CSS Image Grid Gallery</title>
</head>
<body>
    <main>
        <div class="box1"> </div>
        <div class="box2"> </div>
        <div class="box3"> </div>
        <div class="box4"> </div>
        <div class="box5"> </div>
        <div class="box6"> </div>
    </main>
</body>
</html>

CSS:

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body{
    background: #222222;
    color: #ffffff;
}
main{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    width: 80%;
    display: grid;
    grid-template-rows: repeat(2, 250px) 200px;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 7px;
}
.box1{background: url("bg1.jpg")no-repeat;background-size: cover;
background-position: center;}

.box2{
    background: url("bg2.jpg")no-repeat;background-size: cover;
background-position: center;
    grid-column: 2/-1;
}

.box3{background: url("bg3.jpg")no-repeat;background-size: cover;
background-position: center;}
.box4{background: url("bg4.jpg")no-repeat;background-size: cover;
background-position: center;}

.box5{
    background: url("bg5.jpg")no-repeat;background-size: cover;
background-position: center;
    grid-row: 2/-1;
    grid-column: 3/-1;
}

.box6{
    background: url("bg6.jpg")no-repeat;background-size: cover;
background-position: center;
    grid-column: 1/3;
}


Comments

Popular posts from this blog

Popup Modal Using Html, CSS and JavaScript

Video: Source Code: //HTML <! DOCTYPE   html > < html   lang = "en" > < head >     < meta   charset = "UTF-8" >     < meta   name = "viewport"   content = "width=device-width, initial-scale=1.0" >     < meta   http-equiv = "X-UA-Compatible"   content = "ie=edge" >     < link   rel = "stylesheet"   href = "style.css" >     < title >Javascript Popup Modal</ title > </ head > < body >     < button   onclick = " pop () "   class = "btn" >Click Me!</ button >     < div   id = "box"   class = "box" >         < span   onclick = " hide () " > &times; </ span >         < h2 >Javascript...

Amazing 404 Error Page Using HTML & CSS

  Video: Source Code: <! DOCTYPE   html > < html   lang = "en" > < head >     < meta   charset = "UTF-8" >     < meta   name = "viewport"   content = "width=device-width, initial-scale=1.0" >     < meta   http-equiv = "X-UA-Compatible"   content = "ie=edge" >     < title >Error! 404</ title > </ head > <style> * {     margin:  0 ;     padding:  0 ;     font-family: Nunito;     box-sizing:  border-box ; } body {     background:  linear-gradient (to  right ,  #48dbfb ,  #1dd1a1 );     display:  flex ;     align-items:  center ;     justify-content:  center ;     min-heigh...