Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people's questions, and connect with other people.

Have an account? Sign In

Captcha Click on image to update the captcha.

Have an account? Sign In Now

Sign In

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Sorry, you do not have a permission to ask a question, You must login to ask question.

Forgot Password?

Need An Account, Sign Up Here
Tech Answered Logo Tech Answered Logo
Sign InSign Up

Tech Answered

Tech Answered Navigation

  • Home
  • Tutorials
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • About Us
  • Blog
  • Contact Us
Home / Questions /Q 4510
Next
In Process
dynamicapps5
dynamicapps5

dynamicapps5

  • India
  • 127 Questions
  • 66 Answers
  • 2 Best Answers
  • 198 Points
View Profile
  • 0
dynamicapps5
Asked: July 2, 20242024-07-02T11:18:37+05:30 2024-07-02T11:18:37+05:30In: Web Development

Image Gallery With Animations Using HTML And CSS Code

  • 0

can anyone drop for code to create Image Gallery  Using HTML And CSS. I wanna try it on notepad so guide me to do in notepad. How can i create Image Gallery With HTML And CSS Code.

code for image gallery using css and htmlcsshtmlimage galleryimage gallery with animations full length tutorial using html and css codeimage gallery with html and css
  • 1
  • 1,240
  • 0
  • 0
Answer
Share
  • Facebook

    Related Questions

    • How to fix html servlet error java.io.ioexception broken pipe
    • What is CSS Box model and what are its elements?
    • What is the difference between Tags and Attributes in HTML?
    • How do you remove errors in HTML code
    • html documents are saved in
    • html coding for making website example coding Homepage

    1 Answer

    1. Aniya

      Aniya

      • India
      • 157 Questions
      • 89 Answers
      • 3 Best Answers
      • 100 Points
      View Profile
      Aniya
      2024-07-02T11:23:24+05:30Added an answer on July 2, 2024 at 11:23 am

      Try the following html and css code in notepad to create image gallery with smooth animations using HTML and CSS.

      First take a notepad and save it as image_gallery.html

      and copy paste the below code and replace img src with your image on your computer.

      <!DOCTYPE html>
      <html lang=”en”>
      <head>
      <meta charset=”UTF-8″>
      <meta name=”viewport” content=”width=device-width, initial-scale=1.0″>
      <title>Image Gallery</title>
      <link rel=”stylesheet” href=”style.css”>
      </head>
      <body>
      <h1>Own Image Gallery</h1>
      <div class=”gallery”>
      <img src=”man1.jpg” alt=”Image 1″>
      <img src=”girl1.jpg” alt=”Image 2″>
      <img src=”insta.jpg” alt=”Image 3″>
      <img src=”nature_bg.jpg” alt=”Image 2″>
      <img src=”nature2.jpg” alt=”Image 3″>

      </div>
      <div class=”gallery”>
      <img src=”fb.png” alt=”Image 1″>
      <img src=”nature_bg.jpg” alt=”Image 2″>
      <img src=”nature1.jpg” alt=”Image 3″>
      <img src=”girl2.jpg” alt=”Image 2″>
      <img src=”nature_bg.jpg” alt=”Image 3″>

      </div>
      <div class=”image-container”>
      <img src=”girl2.jpg” alt=”Image description”>
      <img src=”man1.jpg” alt=”Image description”>

      <img src=”nature_bg.jpg” alt=”Image description”>

      <img src=”nature1.jpg” alt=”Image description”>

      <img src=”nature2.jpg” alt=”Image description”>

      </div>
      </body>
      </html>

       

      Now open another notepad file and save it as Styel.css

      .gallery {

      width: 40%; /* Adjust the width as needed */
      margin: 0 auto; /* Center the gallery horizontally */
      display: flex;
      flex-wrap: wrap; /* Allow images to wrap to multiple lines */
      }

      .gallery img {
      border: 1px solid #008080;
      margin: 10px; /* Add spacing between images */
      width: 100px; /* Set image width */
      height: 100px; /* Set image height */
      object-fit: cover; /* Scale image to fit container while maintaining aspect ratio */
      transition: transform 0.5s ease-in-out; /* Smooth transition for animations */
      }
      .gallery img:hover {
      transform: rotate(360deg);
      transform: scale(1.3); /* Zoom in on hover effect */
      opacity: 0.8; /* Slightly reduce opacity on hover */
      box-shadow: 0 0 5px rgba(0, 0, 0, 0.2); /* Add subtle shadow on hover */
      }

      .image-container {
      overflow: hidden; /* Prevent image overflow */
      position: relative; /* Enable absolute positioning for child elements */
      }
      .image-container img {
      margin: 5px; /* Add spacing between images */
      width: 100px; /* Set image width */
      height: 100px; /* Set image height */
      object-fit: cover; /* Scale image to fit container while maintaining aspect ratio */
      float: left; /* Float images to the left */
      border: 2px solid #008080;
      }

      .image-container:after {
      content: “”;
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-image: url(“data:image/svg+xml,%3Csvg xmlns=’http://www.w3.org/2000/svg’ viewBox=’0 0 100 100’%3E%3Ccircle cx=’50’ cy=’50’ r=’10’ fill=’%23fff’ opacity=’0.2’/%3E%3Ccircle cx=’20’ cy=’30’ r=’5′ fill=’%23fff’ opacity=’0.9’/%3E%3Ccircle cx=’80’ cy=’70’ r=’7′ fill=’%23fff’ opacity=’0.1’/%3E%3C/svg%3E”); /* Replace with your particle SVG */
      background-repeat: repeat; /* Allow particles to repeat across the image */
      opacity: 0.2; /* Hide particles initially */
      transition: opacity 0.5s ease-in-out; /* Smooth transition for opacity */
      }

      .image-container:hover:after {
      opacity: 1; /* Show particles on hover */
      animation: disperse 0.7s ease-in-out forwards; /* Animation for particle dispersion */
      }

      @keyframes disperse {
      0% {
      transform: translate(0, 0);
      }
      100% {
      transform: translate(-20px, 20px); /* Adjust for desired dispersion direction */
      }
      }

       

      output :

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    Leave an answer

    Leave an answer
    Cancel reply

    Browse

    Sidebar

    Ask A Question

    More Questions

    • arunraj503

      How to Add, Install SSL Certificate to Your Website

    • EmmaScott

      What are some key considerations when designing a logo for

    • SEO_BRISK

      What part does content play in SEO, and what impact

    • sita

      How to add scrolling text in Blogger

    • Mia_Mia

      Direction

    • nora khan

      how are sitemaps important for the seo process

    • shree

      How to choose color combinations for website

    • dynamicapps5

      React native vs flutter, which is best to use in

    Stats

    • Questions 1,988
    • Answers 2,095
    • Posts 12
    • Best Answers 73

    Related Questions

    • Aniya

      How to fix html servlet error java.io.ioexception broken pipe

    • Nadiminti Naga Satya veni

      What is CSS Box model and what are its elements?

    • Nadiminti Naga Satya veni

      What is the difference between Tags and Attributes in HTML?

    • shree

      How do you remove errors in HTML code

    • nora khan

      html documents are saved in

    • krinal patel

      html coding for making website example coding Homepage

    Explore

    • Home
    • Communities
    • Questions
      • New Questions
      • Trending Questions
      • Must read Questions
      • Hot Questions
    • Polls
    • Tags
    • Badges
    • Users
    • Help

    Footer

    Recent Comments

    • shree on How to use philips citrus press juicer 25 watts Demo
    • kiran kumar85 on How To Insert Names Automatically in Excel Sheet With VBA Code
    • Satish on How To Insert Names Automatically in Excel Sheet With VBA Code
    • jameslaurence on alarm won’t go off while on facetime how to fix
    • jameslaurence on how to solve export problem in kinemaster
    Ask A Question

    Archives

    Tags

    laptop buying guide (1) limit google news notifications (1) printer buying guide (1) stop google news notifications (1) turn off google news notifications (1)

    Social media

    © 2023 @ Techanswered.com.
    Terms, Privacy policy & Sitemap.

    Insert/edit link

    Enter the destination URL

    Or link to existing content

      No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.