Change the button to transition on hover

I found this code online that creates a cool button which looks pressed when clicked. I want to modify it so that the button appears pressed on hover instead of click. How can I achieve this?

/**
 * AddToCalendar Icon Style
 * http://addtocalendar.com
 */

/* Base */

.addtocalendar var{
    display: none;
}

.addtocalendar {
    position: relative;
    display: inline-block;
    background: transparent!important;
}

.atcb-link {
    display: block;
    outline: none!important;
    cursor: pointer;
}

.atcb-link:focus~ul,
.atcb-link:active~ul,
.atcb-list:hover{
    visibility:visible;
}

.atcb-list {
    visibility: hidden;
    position: absolute;
    top: 100%;
    left: 0;
    width: 170px;
    z-index: 900;
}

.atcb-list,
.atcb-item
{
    list-style: none;
    margin: 0;
    padding: 0;
    background: #fff;
}

.atcb-item {
    float: none;
    text-align: left;
}

...

            
                Add to Calendar
            
        

Answer №1

To add hover effect to a specific class, you can use the following code:

.classname:hover{
   background-color:#00FF00;
}

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

The permanent header is covering up the vertical scroll bar

Currently, I am attempting to integrate a jquery plugin from this source - https://gist.github.com/3819758, into a table in order to create a fixed header. However, the table in my case is too wide, causing the generated header to obscure the vertical scro ...

Automating mouse-copy of an anchor text element using Python 2.7 WebDriver

Is there a way to automatically insert an anchor text link into a Facebook Note? Here's a scenario you can try: Navigate to any website and find text with a hyperlink. Manually click and drag across the text using your mouse, then right-click and choo ...

Sharing data between functions in jQuery AJAX promises

Struggling to define a variable in one promise method and use it in another? Here's the scenario: Take a look at this code snippet: $.getJSON('some/file/') .done(function(response) { var bar = response; }) .always(function() { // N ...

Developing a personalized materialize directive that seamlessly integrates with the dynamic {{expression}} within the data-activates attribute

I am currently experimenting with integrating the materialize library with Angular. I have created an attribute directive to initialize the dropdown menu on an element. However, I encountered an issue where the directive throws an exception (check the dev ...

Implementing conditional reduction in JavaScript arrays

I've encountered an issue with the filter and reduce methods. I am attempting to calculate the sum of "smc" values only when "A" equals 2020 from the given array below: arr = [{A:2020, smc:1},{A:2020, smc:2}, {A:2021, smc:3}] My attempted solution so ...

The background image in CSS fails to display when a relative path is utilized

Currently, I am working on a JavaFX project which has the following file structure (CEP serves as the root directory): CEP +img menu.jpg +src +css_files MainMenu.css The main objective is to set the background image from the img dir ...

Implement a function in vanilla JavaScript that will add or remove a class from a separate element when hovering over the parent element

I've searched through various questions similar to mine with no luck in finding a direct example explaining how to use vanilla JS to add and remove a class from one element when hovering over another. I'm aware that it involves setting up a loop ...

Utilize jQuery to dynamically update the box-shadow property with inset added

I have a situation similar to this: $('.inset').click(function(){ if($('.inset').is(':checked')){ $('.box-shadow').css('boxShadow','inset'); }else{ $('.box-shadow&ap ...

Convert the text inside a span element into a key-value object in JavaScript

How can I extract and save the text from a span element as key value pairs within a div? <div class="data-diff-span__composite-list-item__18c5zip data-diff-core__highlight-area__19c0zip"> <div class="data-diff-basic__class-row__4n ...

Dynamic Dropdown Validation During Form Submission

In the form, there are multiple rows displayed dynamically, each with a dropdown menu. The id for each dropdown is "ReasonCd#" where "#" increments from 0 based on the row number. By default, every dropdown has "Select Number" as the selected option, with ...

Using jQuery to highlight the navigation menu when a specific div scrolls into view

I have implemented a side navigation consisting of circular divs. Clicking on one scrolls you to the corresponding .block div, and everything functions correctly. However, I am now curious if it is feasible to highlight the relevant .nav-item div based on ...

AngularJS module is experiencing issues with loading properly

Can someone please help me understand what the issue is? I am new to AngularJS and may have overlooked something. Below is my simple HTML code: <!DOCTYPE html> <html> <script type="text/javascript" src="angular.js"></script> ...

Ensure your div's absolute position is set to the right for a sticky effect

When I set the position of an absolute div like this: left: 700px; It does not move when I resize my browser window. How can I make it float to the right and move left when resizing the window? To illustrate the issue, take a look at this site. Check ou ...

Unable to execute PHP alongside a JavaScript event listener

Using PHP, I am creating a canvas for writing and the text output will appear in a textarea (handled by other functions). There are additional input tags like a title to gather user input. The values from these input tags (title and textarea) will be submi ...

Avoid the scenario in which JQuery .HTML replaces the existing .HTML content before it is shown

In my current implementation, I am using a multidimensional array to store values and loop through it based on specific criteria. This process involves determining if a number matches and if it has a set status, such as "487 Online." The data in the array ...

obtain a link that is clickable from an array of options

$('button').on('click', function(){ let selection = document.getSelection().toString().trim(); document.execCommand('createLink', true, selection); }) <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery ...

Trouble aligning items within a flex-wrap parent using CSS flex-item's align-self functionality

I am facing an issue with my flex parent container. It is set to flex-wrap: wrap and justify-content: flex-end. Within this container, there is a flex-child called button-group that I want to align to the left using align-self, but it seems to not be worki ...

Is it valid CSS when a supposed "Best Solution" for a CSS challenge intentionally leaves out characters and appears to be invalid?

I am completely new to CSS and HTML and have just embarked on my first CSS challenge. Specifically, this one. The winning solution is as follows: :after{width:70;content:'Hello World However, I am quite puzzled by this and other solutions provided o ...

accessing elements in extjs beyond onReadyIs this okay with

I have developed a custom Layout utilizing the ExtJs framework. The layout includes a left menu and a primary tabbed panel, with the main components being Ext.tree.Panel and Ext.tab.Panel within an Ext.Viewport. Upon clicking a menu item, it is dynamicall ...

Display different data in an HTML table for each individual click on the "Read more" event

I am currently extracting data from a SQL table to exhibit it in an HTML table. The issue I am facing is that I would like to implement a "Read More" feature to prevent clutter in the table. As I am retrieving the data row by row, I am utilizing a class n ...