Adjust the color of the element upon hovering

Is there a way to modify the color of the arrow when hovering over it with a mouse?

I have included the code snippet I used in an attempt to accomplish this. Can you spot where I may be making a mistake (By the way, the 55.5% percentage is intentional)?

.arrow-down {
  width: 100%;
  margin: 0 auto;
  left: 55,5%;
}

.arrow-down::after {
  content: "";
  width: 50px;
  height: 50px;
  position: absolute;
  margin: auto;
  border-right: 4px solid rgba(255, 255, 255, 0.5);
  border-bottom: 4px solid rgb(255, 255, 255, 0.5);
  -webkit-transform: rotate(40deg);
  transform: rotate(45deg);
  -webkit-animation: 3s arrow infinite ease;
  animation: 3s arrow infinite ease;
  left: 48.25vw;
  bottom: -15vw;
}

.arrow-down:hover {
  color:white;
}

@-webkit-keyframes arrow {
  0%,
  100% {
    top: 50px;
  }
  50% {
    top: 80px;
  }
}

@keyframes arrow {
  0%,
  100% {
    top: 50px;
  }
  50% {
    top: 80px;
  }
}

Your assistance would be greatly valued.

Answer №1

body {
  background-color: black
}
.arrow-down {
  width: 100%;
  margin: 0 auto;
  left: 55,5%;
}

.arrow-down::after {
  content: "";
  width: 50px;
  height: 50px;
  position: absolute;
  margin: auto;
  border-right: 4px solid rgba(255, 255, 255, 0.5);
  border-bottom: 4px solid rgb(255, 255, 255, 0.5);
  -webkit-transform: rotate(40deg);
  transform: rotate(45deg);
  -webkit-animation: 3s arrow infinite ease;
  animation: 3s arrow infinite ease;
  left: 48.25vw;
  bottom: -15vw;
}

.arrow-down:hover::after {
  border-right: 4px solid white;
  border-bottom: 4px solid white;
}

@-webkit-keyframes arrow {
  0%,
  100% {
    top: 50px;
  }
  50% {
    top: 80px;
  }
}

@keyframes arrow {
  0%,
  100% {
    top: 50px;
  }
  50% {
    top: 80px;
  }
}
<div class="arrow-down">
</div>

it is important to note that the colors for the arrow are defined in ::after rather than on .arrow-down

the following CSS styles need to be updated

  border-right: 4px solid rgba(255, 255, 255, 0.5);
  border-bottom: 4px solid rgb(255, 255, 255, 0.5);

consider changing it to:

.arrow-down:hover::after {
  border-right: 4px solid white;
  border-bottom: 4px solid white;
}

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

What is the best way to align an InputAdornment IconButton with an OutlinedInput in Material-UI?

Struggling to replicate a text input from a mockup using Material-UI components. Initially tried rendering a button next to the input, but it didn't match. Moving on to InputAdornments, getting closer but can't get the button flush with the input ...

Tips for integrating Bootstrap JavaScript into a React project

I am encountering an issue while trying to incorporate Bootstrap JavaScript into my web app. I have successfully included the CSS, but I am facing difficulties with Bootstrap JavaScript for components like modals and alerts. My package.json includes: "boo ...

Designing a webpage compatible across different browsers that features an image positioned relatively over two rows of a table

I am working on creating a unique table layout for a web page that resembles the design linked below: Click here to view the image http://kelostrada.pl/upload/test.png Your assistance in achieving this would be greatly appreciated. Currently, I have imp ...

Perfectly aligning css tabs both vertically and horizontally with dead centering technique

Can you help me figure this out? Currently, the tabs in the HTML and CSS provided below are positioned close to the top of the screen. How can I adjust the markup so that the tabs are dead-centered (both vertically and horizontally) instead? Check out th ...

The Android webview is blocking the display of a frame due to its X-Frame-Options being set to 'DENY'

Encountering an issue while attempting to display a Google calendar in a webview, an error is displayed: [INFO:CONSOLE(0)] "Refused to display 'https://accounts.google.com/ServiceLogin?service=cl&passive=1209600&continue=https://www.google.co ...

Adjusting color with the .on method in Event Listener

What's wrong with this code? html <!DOCTYPE html> <html> <head> <title>Ending Project</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> &l ...

determining the amount by which a div extends beyond the window's height

My challenge is to have a fixed div appear on top of various background images. The problem arises when this fixed div exceeds the height of the window, causing it not to scroll and resulting in lost content. I've attempted using max-height: 100% and ...

What is the process for calling a class in HTML from a <Div> tag?

I am struggling with the following code snippet: <p class=‘majed’ style="color:#FF0000";>Red paragraph text</p> How can I reference the 'majed' class above? <Div class=‘majed’ > </Div> Your help is greatly appr ...

Retrieve the value of a variable from a JSON decoded response

My json response has been decoded into an array $data: stdClass Object ( [outboundSMSMessageRequest] => stdClass Object ( [deliveryInfoList] => stdClass Object ( [deliveryInfo] => stdClass Object ( [address] => 8606142527 [deliveryStatus] => ...

Rearranging Elements with Bootstrap 4 Grid System When Resizing Window

I need help with designing a responsive layout for my website. Currently, I have a simple layout with 3 elements that I want to display differently based on screen size. On larger screens, I want the elements to be arranged like the layout at the top in t ...

Location of a Confirmation Box

When positioning the confirmBox on a page with lots of content using absolute inside relative positioning, I encountered an issue where the confirmBox was centered in the page but not in the center of the screen. Since the confirmBox can be opened through ...

Clicking on anchor links within an iframe does not produce any result

Can a non-scrolling iFrame be placed inside a scrolling div while ensuring that anchor links within the iFrame function correctly? The goal is for the anchor links within the iFrame to smoothly scroll to their respective locations within the iFrame itself, ...

What is the best approach for rendering HTML on a page both initially and dynamically as it is updated, given the heavy utilization of ajax?

One challenge faced by many web applications today is how to efficiently reuse html templates without redundancy when initially rendering a page and adding new content. What is the most effective approach for this? One option is to render the HTML page ...

Creating personalized HTML tags using React.js

My goal may seem simple at first, but I keep running into a frustrating error from webpack. I want to render a custom tag in React, rather than using the standard tags. Here is the code that is causing me trouble: let htmlTag = "h" + ele.title.importance ...

I am looking to update the background color of my Bootstrap navigation bar

I am looking to update the background color of my bootstrap navigation bar. Here is the current look: https://i.sstatic.net/szUXD.png The HTML code I have been using is as follows: <!DOCTYPE html> <html lang="en"> <head> <meta cha ...

Div or box container with a CSS arrow sliced through

Is there a way to transition from a basic square menu to something more complex like this -> view image example Below is the CSS I've been using: .menu { width:50px; height:50px; display:block; background-color:red; overflow:hidden -ms-transform: ...

Exploring the possibilities of personalized attributes/directives in HTML and Javascript

My current challenge involves understanding how vue.js and angular.js handle custom directives in HTML. Suppose I have a div like this: <div my-repeat="item in items"></div> To replicate the functionality of vue.js, do I need to search throug ...

What is the best way to enclose all succeeding elements with an HTML tag after a specific element?

In my project, I am integrating Vue 2 with Sanity.io and I am looking for a solution to wrap all elements that come after a specific element with an HTML tag, and then wrap this element along with the following elements with another HTML tag. For instance ...

javascript close the current browser tab

Can someone please help me with a JavaScript code to close the current window? I have tried the following code but it does not seem to work: <input type="button" class="btn btn-success" style="font-weight: b ...

Using htaccess to eliminate PHP and HTML files from your website

I've been scouring the Internet for quite some time now, trying to find a working htaccess file for my website. I'm using CuteNews, a news CMS that offers URL rewrite functionality. However, when I enable URL rewriting, it causes my news pages to ...