No action is triggered when the button is hovered over

I've implemented these hover effects but for some reason, they are not working as expected. I'm struggling to understand why this is happening.

The primary button at the bottom is also experiencing the same issue.

body { background-color: #aaa }

.button {
  background: #fff;
  border-radius: 5px;
  border: none;
  padding: 5px;
  width: 100px;
  height: 50px;
}

.button:hover {
  background: #1c1c1c;
  color: #fff;
  transition: 0.3s ease;
  cursor: pointer;
}

.button-primary {
  background: yellow;
  border-radius: 5px;
  border: none;
  padding: 5px;
  width: 100px;
  height: 50px;
  margin-bottom: 10px;
}

.button-primary:hover {
  background: #1c1c1c;
  transition: 0.3s ease;
}

.button-down {
  height: 70px;
  width: 70px;
  border-radius: 50%;
  border: 1px solid white;
  background: transparent;
  color: white;
}

.button-down:hover {
  background: white;
  color: #1c1c1c;
  border: 1px solid #1c1c1c;
  cursor: pointer;
}
<div>
  <div class="down">
    <button class='button-down'><i class='fas fa-arrow-down'></i></button>
  </div>

  <input type="text" name='email' id='email' placeholder='signup to our newsletter...'>
  <br>
  <button class='button-primary' type='submit' name='submit'>Submit</button>
</div>

Answer №1

Did you remember to link your stylesheet to your HTML document? Additionally, it seems like the .button-down class is missing from your CSS file, but instead, you have a .button class. Please update the .button class to .button-down and give it another try.

.button-down{
    background: #fff;
    border-radius: 5px;
    border: none;
    padding: 5px;
    width: 100px;
    height: 50px;
}
.button-down:hover{
    background: #1c1c1c;
    color: #fff;
    transition: 0.3s ease;
    cursor: pointer;
}

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

Why is my Feed2JS RSS feed functional locally but not operational after deployment on GitHub Pages?

I've been using feedtojs.org to display my Medium blog posts on my GitHub Pages website. Strangely enough, it works perfectly fine on my local server but not on the actual domain. The RSS feed is valid. Here's how it appears on my local server: ...

After clicking the submit button, how can I eliminate the following: "config.php?username=++psw&Text=psw&submit=send?" and remain on the same page?

Whenever I hit the submit button on my form, PHP completes its task but instead of staying on the page (or simply reloading it), I am redirected to the same URL with '/config.php?username=technologies.%0D%0A++&submit = Send ". Is there a way ...

The copying of array values is not supported by Chromium

While utilizing Webworker to process an array of pixels from Canvas and then assign it back, I encountered a strange behavior. Firefox works flawlessly in this scenario, however, Chromium seems to insert an empty pixel array into the Canvas. Upon further ...

Learn how to cycle through three different texts that appear in the same spot using smooth transitions

I am working with three different rows that contain the Typography component. My goal is to display the first row, followed by the second, then the third, and back to the first one in a continuous loop. All three rows should be shown in the same location, ...

What is the best way to display multiple files in a vertical stack when choosing a file?

<div class="selected-file-container align-items-center justify-content-between d-none"> <div class="selected-file d-flex align-items-center"> <img id="selectedImage" class="hidden" src="&qu ...

Is there a way to execute a POST command in HTML without utilizing a form tag?

Currently, I have a form that gathers input from the user and redirects to a new page upon submission by clicking a button. However, I am looking for a way to automatically open this destination page when the current page loads, without the need for manual ...

The validation process is still failing even though the correct credentials have been entered

I'm diving into the world of Javascript and DOM today, but I've hit a roadblock. Can you take a look at this code snippet and help me figure out what's causing me to always end up in the else block, no matter what I input in the text field? ...

"Resolving an inconsistency problem with the Vary header in Htaccess

Could someone help me identify the issues in my htaccess code? I'm encountering errors: This response is negotiated, but doesn't have an appropriate Vary header. The resource doesn't send Vary consistently. ## add vary header <IfModule ...

Float two DIVs horizontally with the same height using jQuery

Having a strange issue with the website I'm currently working on and can't seem to figure out what's causing it. Something is definitely off with my javascript, but I just can't pinpoint the exact problem. Here's the situation: I ...

Every time Tailwind compiles, it seems to generate a glitchy class

There was a time when I accidentally wrote 2 classes without a space max-w-[412px]mb-[36px]. This caused an error, so I added a space between the classes. However, the error persisted even after making this correction. In a last attempt to resolve the issu ...

Apply the jQuery method to select elements with index 3, 4, 5, 6, or 7, then add

My current Wordpress blog displays 20 posts. I am looking to apply a specific class to posts numbered 2 through 10, and then again from 12 to 20. I do not want the first post or post number 11 to have this class added. I attempted using CSS selectors lik ...

Changing the loading spinner icon in WooCommerce

Could someone help me change the loading spinner icon in WooCommerce? The current icon is defined in the woocommerce.css: .woocommerce .blockUI.blockOverlay::before { height: 1em; width: 1em; display: block; position: absolute; top: 50 ...

jQuery - delete a single word that is case-sensitive

Is there a way to eliminate a specific case-sensitive word from a fully loaded webpage? The word in question is "Posts" and it appears within a div called #pd_top_rated_holder that is generated by Javascript. The Javascript code is sourced externally, so ...

Solutions for altering the appearance of a combobox using CSS

Currently, I am experimenting with javafx 2 and trying to modify the background color of the menu/list through CSS. Despite attempting the code snippet below, nothing seems to be working as expected. Do you have any suggestions or insights on how to achi ...

Increasing the size of iframe in a Flexbox layout

I'm facing a challenge in making the iframe element stretch to occupy the remaining space within my web application. While I have ensured that the maximum space is allocated for the div by setting a border, the iframe's height does not automatica ...

"Unlocking the power of Bootstrap modals in Django

Using Django, I have a loop of div elements. When I click on a div, I want a modal to be displayed. Here is my HTML code: {% for object in theobjects %} <div class="row" style="margin-top:0.5%;"> <div name="traitement" <!-- onclic ...

In HTML, adjust column widths for multiple tables according to the widest column present in any of them

With Python, I am creating an HTML page that contains multiple tables with the same number of columns, all holding the same type of data. While the generated page is functional, I would like to improve readability by ensuring that all tables have the same ...

bootstrap 5 with uneven spacing

I am working on some HTML/CSS code that utilizes Bootstrap 5.2 and the justify-content-between class in order to move two buttons to the edges of a container. <div class="container"> <div class="row"> <div cla ...

Looking for assistance with troubleshooting CSS issues specifically in Internet Explorer

Hey there! I've been working on a landing page and it's looking good in Safari, Firefox, and Chrome. The only issue is that the layout is all messed up in IE (any version). If any of you experts could take a look at it and give me some suggesti ...

conceal a targeted section from the bottom of the iframe

I have a website embedded inside an iframe for use in a webview application. <body> <iframe id="iframe" src="http://www.medicamall.com"></iframe> </body> This is the CSS code: body { margin:0; padding:0; height:10 ...