Hovering into Transition Time

My article card has a transition on the top attribute of the info div, which is supposed to be smooth and last for 0.3 seconds. However, the description suddenly appears during this transition. I'm trying to figure out why this is happening and how to fix it. Any ideas?

.article-card{
    background-image: url(" ")
    -webkit-box-shadow: 0px 0px 20px 1px #919191; 
    box-shadow: 0px 0px 20px 1px #919191;
    width: 30vh;
    height: 40vh;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
    background-position: center;
}

.article-card-info{
    position: relative;
    top: 18vh;
    height: 10vh;
    background-color: white;
}
.article-card-title{
    color: #1a2434;
    text-align: center;
    padding-top: 2vh;
    font-size: 1rem
}

.article-card-description{
    display: none;
    position: relative;
    top: 10vh;
    text-align: center;
    font-size: 0.6rem;
    font-family: 'Zona Pro Thin';
    font-weight: 1000;
    color: #1a2434;
    margin: 2px;
}

.article-card:hover .article-card-info{
    transition: 0.3s ease;
    height: 15vh;
    top:13vh;
}

.article-card:hover .article-card-description{
    display: block;
    top: 1vh;
    transition: 0.3s ease;
}
<div class="article-card">
    <div class="article-card-info">
          <p class="article-card-title"> Title</p>
          <p class="article-card-description"> Description </p> 
     </div>
</div>

Answer №1

To create a smooth appearance for the description, you can utilize the opacity property.

.article-card{
    background-image: url(" ")
    -webkit-box-shadow: 0px 0px 20px 1px #919191; 
    box-shadow: 0px 0px 20px 1px #919191;
    width: 30vh;
    height: 40vh;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
    background-position: center;
}

.article-card-info{
    position: relative;
    top: 18vh;
    height: 10vh;
    background-color: white;
}
.article-card-title{
    color: #1a2434;
    text-align: center;
    padding-top: 2vh;
    font-size: 1rem
}

.article-card-description{
    position: relative;
    top: 10vh;
    text-align: center;
    font-size: 0.6rem;
    font-family: 'Zona Pro Thin';
    font-weight: 1000;
    color: #1a2434;
    margin: 2px;
    opacity: 0;
    transition: 0.3s ease;
}

.article-card:hover .article-card-info{
    transition: 0.3s ease;
    height: 15vh;
    top:13vh;
}

.article-card:hover .article-card-description{
    top: 1vh;
    opacity: 1;
}
<div class="article-card">
    <div class="article-card-info">
          <p class="article-card-title"> Title</p>
          <p class="article-card-description"> Description </p> 
     </div>
</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

Use CSS3 and jQuery.validate to highlight mandatory fields in red

I've been attempting to change the color of required fields in a form to red, but so far I haven't had any success. Here is the form code and the CSS that I have experimented with. contact.html <h2>Send us an ...

What is the best way to transfer information from a server running Express.js to a client using React.js?

When using Express.js, I have the ability to send an HTML file that includes a React component. app.get('/index', function(req, res) { res.sendFile(path.join(__dirname + '/src/index.html')); }); Suppose I want to send a uniqu ...

How to load MTL files from local storage using Three.js in Chrome

I'm encountering an issue when attempting to load MTL files using Three.js on Chrome. While everything runs smoothly on Safari, I keep running into a cross-origin request error in Chrome when working with local files. I'm at a loss on how to reso ...

ASP.NET repeater causing jQuery scrollTop to malfunction after first use

I am facing a peculiar issue where I need to scroll through repeater items in a RadWindow using arrow keys in an ASP.NET application. Below is the code snippet: function isScrolledIntoView(elem) { var docViewTop; var docViewBottom ...

Steps to transforming a standard array into a multidimensional array

I have a JSON array that is generated after submitting a form using the formSerialize function. Here is an example of how the array looks: [ {"name":"client_management-testmonitoring","value":"0"}, {"name":"client_operations-testmonitoring","v ...

What is the technique for performing asynchronous querying of multiple SQL databases?

Currently, I am in the process of developing a web application using nestjs and typeorm. I have been contemplating the functionality of the following code: const r1 = await this.connection.query(sqlA) const r2 = await this.connection query(sqlB) Does th ...

The correlation between dynamic pricing and surge pricing in relation to PX

I'm exploring the translation of measurements from dp and sp to pixels within Google's new material design for a website I'm working on. Usually, my web designs have used pixel-based measurements for both grid and font sizing over the four y ...

Learn the process of utilizing JavaScript/Node.js to dynamically upload images onto a webpage directly from a database

Currently, I am developing a web application and building a user profile page where I aim to showcase user information along with a profile picture. Working with node/express/jade stack, I have a javascript file that manages loading the appropriate jade vi ...

Immense trade adhesive navigation bar menu

Currently, I am in the process of enhancing a big commerce website and aiming to implement a sticky menu on scroll. I attempted to use bootstrap along with CSS to achieve this functionality, however, encountered some issues. Below is the snippet of code I ...

Leverage Angular's directives to incorporate HTML elements into your project

I am trying to integrate the HTML code from a file called protocol-modal.html into my main HTML file as a directive: <div class="modal-content"> <form class="form-horizontal" role="form" name="questionForm"> <div class="modal-heade ...

What is the best way to eliminate spaces, commas, and periods from a variable in javascript?

After attempting var res = str.replace(/ |,|.|/g, ""); and var res = str.replace(/ |,|.|/gi, "");, I'm still puzzled as to what I might be missing. var str = "Text with comma, space, and period."; var res = str.replace(/ |,|.|/g, ""); document.writ ...

Displaying numerous images/items in a Bootstrap 2.3 carousel

I have been working on a PHP-based website that utilizes Twitter Bootstrap 2.0. Currently, I am retrieving user information from a MySQL database and attempting to display them in separate frames or items within a carousel instead of all at once using a wh ...

Struggling to generate a div using my JS/jQuery code

Currently working on a post-it web application to improve my skills in JavaScript and jQuery. I've encountered a few errors that have me stumped. Although I'm new to StackOverflow, I often use it as a helpful resource. You can find the code here ...

ng-disabled with function that activates on change

I am attempting to create a submit validation button that will only enable when all fields have been entered correctly. Due to the complexity of the validation process, I am unable to rely solely on formName.$invalid and need to write a custom function for ...

Gathering information from an HTML form and displaying it through JavaScript by utilizing Bootstrap's card component

I've been working on integrating form data from my index.html page into a card component using Bootstrap. I've successfully collected the data in the backend, but now I'm struggling to display it on the frontend as a card component. Any help ...

Using PHP to download a file

I have successfully uploaded a PDF file to a directory named 'documents' on my web server. Currently, I am populating a table with data from my database, and I want to create links in the forms column that directly link to the associated files w ...

Issues with implementing CSS Icon Generated Content on a live Azure Web Role

My dilemma lies with my MVC4 web application that I'm attempting to deploy as an Azure web role. The site incorporates Metro UI CSS. While the deployed web role is functioning properly overall, I am encountering an issue with the CSS-generated conten ...

Multiple Ajax calls interacting with each other are causing issues

Within my Index.php file, there is an ajax call that loads a php page containing an HTML form. I am attempting to trigger another ajax call from Index.php whenever a select box is changed. Everything functions properly except for the ajax on change event ...

When I modify the state in Vue.js, the two-way binding feature does not seem to function properly

I'm facing an issue with my dynamic array "slots" of objects which looks something like this: [{"availability": 1},{"availability": 3}] I render multiple inputs in Vue.js using v-for like so: <div v-for="slot in array"><input v-model="slot.av ...

What could be the reason behind Typescript's unexpected behavior when handling the severity prop in Material UI Alerts?

Trying to integrate Typescript into my react project and encountering a particular error: Type 'string' is not assignable to type 'Color | undefined'. The issue arises when I have the following setup... const foo = {stuff:"succes ...