What steps are needed to achieve the hover effect on the portfolio page?

Looking to add a unique hover effect to my homepage design.

Here's an example of what I'm envisioning:

https://i.sstatic.net/Sx5Ge.jpg

Can someone help troubleshoot my code? It's not quite working as intended.

.stage_wrapper {
  margin: 0 auto;
  width: 1100px;
  height: auto;
}
.work {
  margin-left: 8px;
  margin-right: 5px;
  margin-bottom: 15px;
  display: inline-block;
  height: 350px;
  width: 350px;
}
.work img {
  width: 350px;
  height: auto;
}
<div class="stage_wrapper">
  <div class="stage">
    <div class="work">
      <a href="#" target="_blank">
        <img src="//dummyimage.com/350" class="media" alt="#" />
        <div class="caption">
          <div class="work_title">
            <h1>Something in 3 rows</h1>
          </div>
        </div>
      </a>
    </div>
  </div>
</div>

Answer №1

Is this the kind of thing you're looking for?

.project {
  width: 400px;
  height: 400px;
  line-height: 400px;
  text-align: center;
  background-color: #4a90e2;
  border: 10px solid #34495e;
  color: white;
  display: inline-block;
}
.project span {
  display: none;
  vertical-align: middle;
}
.project:hover span {
  display: inline-block;
}
.project:hover img {
  display: none;
}
<div class="project">
  <span>Some content</span>
  <img class="gallery-image" src="http://placeholder.com/400.png/09f/fff" width="400" height="400" />
</div>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Mobile Windows Z-Index

Struggling with the z-index issue on a video tag in Windows Mobile, particularly when it comes to my search box. <div portal:substituteby='common/search::search'></div> The goal is for the search box to appear above the video. ...

Eclipse Content Assist feature appears to be malfunctioning as it fails to display

Having an issue with Eclipse on Win 10 (64bit) when working with JavaScript projects. I've tested this problem on both Eclipse Photon and version 2018-09 (64 bit versions) and encountered the same problem on both instances: After creating a new JavaS ...

Click on a div to smoothly scroll to the top, then automatically scroll to the bottom if already at the top position

I've implemented a JQuery code on my website that allows the page to scroll to the top when clicking on a div with the class of .bottom. The code is working perfectly fine, here it is: function scrollToTop(){ $('.bottom').click(function ...

What is the best way to restrict the length and number of lines in a textarea based on pixel dimensions?

I am looking to create a textarea where people can select different fonts, such as "sans-serif" and "serif", to type in text. I plan to have buttons labeled "sans-serif" and "serif" that will change the font of the textarea when clicked. However, there ar ...

Having trouble verifying the dropdown menu in bootstrap

I'm having trouble validating the dropdown using bootstrap. I've tried data-validation and other methods, but nothing seems to work... All of the other validation fields are functioning correctly, except for the dropdown where I want to require ...

Centering the contents of the grid

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=de ...

Tips for displaying two HTML input elements side by side in a single row

This block of code HTML <input type="text" name="category" id="category" value="">&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="category_1" id="category_1" value="" tabindex="1"></div> Despite multiple attempts such ...

Place the division at the bottom of the screen

I'm facing an issue where I am trying to place a div at the bottom of the viewport but it's not working as expected. Here is how my current setup looks like: html <div class="parent"> <div class="bottom"> </div> </div&g ...

Develop an Innovative Data-Driven Application using AJAX Technology

After inputting an artist's name and clicking on the button, I expect to receive a visually appealing list of their songs. I am encountering the following issue: Whenever I hit the button, no results are being returned, and I am unsure of the reaso ...

Removing HTML tags from a string while preserving specific tags in JavaScript

Here is a JavaScript string that I am working with: var test = "<p>test</p> FOLER.PRODUCTS<12345><level-2>"; I'm trying to remove the HTML tags from the string because the service I'm using doesn't accept them. Here ...

Exploring the Power of Websharper with Sitelets and Forms

I have been working on developing a form using Websharper to gather user input. Currently, I have identified three actions for my website: type MyAction = | [<CompiledName "">] Index | [<Method "POST">] GetUser of username : string ...

Center text vertically within a div using CSS

I need assistance with aligning my text vertically centered and left aligned to the logo in my HTML & CSS code. How can I achieve this with the code provided? Link to Fiddle: http://jsfiddle.net/z6yet59f/ .slogan { background:#eaeaea; float:lef ...

The email submission function in my PHP form seems to be malfunctioning. I must be overlooking something

Having an issue with my PHP form, it's only sending field names instead of data to the email address. Here is a simplified version of the code: <?php $ToEmail = 'example@example.com'; $EmailSubject = 'Site contact form'; $ma ...

How can I generate 200 divs that are identical but each displaying a unique file (page0.svg, page1.svg..., page200.svg)?

<div class="mySlides"> <img src="1173/page0.svg" style="width:50%"> </div> <div class="mySlides"> <img src="1173/page1.svg" style="width:50%"> </div> My task involves generating approximately 200 similar div codes ...

what is the process for incorporating a unique style in npm mydatepicker?

What is the best way to customize the style of npm mydatepicker? Here is the code I have been using: <my-date-picker [options]="myDatePickerOptions" (dateChanged)="onDateChanged($event)"></my-date-picker> Is it possible to modify its backgrou ...

How can I transfer array data to a different webpage using JavaScript?

My goal is to use JavaScript to send data from one page to another. This will involve implementing a "next" button with an onClick function. When the button is clicked, I want all the data in the textboxes on the current page to be transferred and displaye ...

spontaneous angular rotations in a constantly shifting CSS environment

Is it possible to apply a random CSS rotation to an image just once, rather than having it continuously spin when hovering over a leaflet map? http://jsfiddle.net/J03rgPf/mzwwfav4/3/ I want the random CSS rotation to be set only one time. How can I achie ...

The cloned rows created with jQuery are failing to submit via the post method

Hello, I am currently working on a project in Django and could use some assistance with my JavaScript code. Specifically, I am trying to incorporate a button that adds new rows of inputs. The button does function properly as it clones the previous row usin ...

Issue with printing data consecutively using Javascript

My JavaScript code aims to display the content of the body tag again when the add button is clicked. The purpose is to add authors, with each author being added in sequence. For example, if there is only 1 author present, the user simply selects whether th ...

Use CSS to style text when it falls on a "/" within a table

I currently have a table with a row that displays like this: word hi Someword/AnotherWord/LastWord My goal is to use CSS to break the text at the "/" symbol like this: hi<br>Someword<br>/AnotherWord<br>/LastWord However, the curr ...