What is causing the issue with @-webkit-keyframes animations not working?

Having trouble with the @-webkit-keyframes animation not working? It seems like everything else is functioning fine, including the transition of background color and font color. Here's the HTML and CSS code:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>test</title>
<link rel="stylesheet" href="test.css" />
</head>
<body id="body">

<nav>
    <ul id="nav">
        <li><a href="#" class="link"><div class="content"><span class="span">About</span></div></a></li>
        <li><a href="#" class="link"><div class="content"><span class="span">Skills</span></div></a></li>
        <li><a href="#" class="link"><div class="content"><span class="span">Works</span></div></a></li>
        <li><a href="#" class="link"><div class="content"><span class="span">Contact</span></div></a></li>
    </ul>
</nav><br />

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="test.js"></script>
<script type="text/javascript" src="jquery_ui.js"></script>
</body>

</html>

CSS:

#nav{
    list-style:none;
    margin:40px auto;
    padding:0;
    width: 820px;
}
#nav li{
    width: 200px;
    height: 300px;
    overflow: hidden;
    position: relative;
    float: left;
    background: #00D8CC;
    -webkit-box-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    margin-right: 2px;
    -webkit-transition: all 300ms linear;
}

#nav li:last-child {
    margin-right: 0px;
}

#nav li a{
    display:block;
    text-align: center;
    position: relative;
    height: 100%;
    color: #333;
}

.content {
    position: absolute;
    left: 0px;
    width: 100%;
    height: 50%;
    top: 50%;
}

.span {
    font-size: 30px;
    opacity: 0.8;
    text-align: center;
    line-height: 40px;
    -webkit-transition: all 300ms linear;
}

#nav li:hover {
    background-color: #00AAAA;

}

#nav li:hover .span{
    color: green;
    -webkit-animation: move 300ms ease;
}

@-webkit-keyframes move { 
    from {
            -webkit-transform: translateX(-100%) rotate(-90deg);
    }
    to {
            -webkit-transform: translateX(0%) rotate(0deg);
    }
}

Any insights would be greatly appreciated!

Answer ā„–1

The issue is related to the way the <span> element is being displayed. Changing it to display: block; should resolve the issue. For a demonstration, check out this link: http://jsfiddle.net/ryanbrill/mdb7X/

Answer ā„–2

Just a couple of things to note:

1 - Both nav and span are elements, not IDs or classes.

2 - You need to have @keyframes move, or transition all attribute in order to activate it. Also, using milliseconds for timing may cause newer browsers to lag, as they expect values in 0.3s decimal format instead.

3 - Keep in mind that animations and certain transitions of this complexity can only be applied to the parent element like div, nav, header, section, article, footer, etc. One workaround is to use the display: inline-blocks method for alignment and place each section in separate containers. This approach will require the first-child to have the pseudo-element ::before (and a second :before for older browsers) and the main container to have the pseudo-element ::after to ensure proper alignment. For examples on how to achieve this effectively, check out 'Codr0ps' site - http://tympanus.net/codrops/

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

How to verify if a node contains plaintext with jsoup?

Is there a way to determine if a node in jsoup has plain text without including link text, instead of using the Element.hasText() method? Any suggestions would be greatly appreciated. Thank you ...

Is it possible to form a union type using an interface?

My goal is to call the function getSvgPresentationAttribute using any valid CSS property name as cssStyleAttribute. However, I am encountering an issue with my current code where I receive the error message Type 'CSSStyleDeclaration' cannot be us ...

Using ng-model to create association between a select box and ng-repeat to populate its options

Here is a Plunker link demonstrating my problem. I have an object that includes a division property. The issue is, there is no division_id in the object, but to set or update the division, I need to set the division_id field. Here's an example of the ...

Angular 4 is unable to attach to 'formGroup' as it is not recognized as a valid property of 'form'

As a beginner with Angular 4, I decided to explore model driven forms in Angular 4. However, I keep encountering this frustrating error. Template parse errors: Can't bind to 'formGroup' since it isn't a known property of 'form ...

Safari is currently experiencing compatibility issues with iPad, resulting in a malfunction

I encountered a unique issue with my most recent website project. The website is built on WordPress, and the custom theme I created is presenting an unexpected problem: Despite functioning perfectly on all browsers and devices, the site fails to display p ...

What is the best way to split the children of a parent div into four distinct styling regions using the nth-child selector?

Imagine having a square parent container with 100 child elements of equal sizes, as illustrated below. How can you use the :nth-child selector to target and style the children in the top-left, bottom-left, top-right, and bottom-right corners separately? ...

What is the best way to target all div elements containing a child with the class "test-class"?

How can you choose all div elements that contain a child element with the class "test-class"? This question has been identified as a duplicate of Is there a CSS parent selector?. After reading that question, it is evident that this question is indeed redu ...

Facing the issue of empty PHP file uploads

Every time I try to upload a file, the result is always empty. The code can be found here. The structure of the index.html file: <html> <body> <form action="upload_file.php" method="post" enctype="multipart/form-data"> <label for="f ...

Ways to eliminate header and footer data while printing a webpage

In my attempt to implement the code displayed below, I am encountering an issue where the header and footer continue to appear on the printed page. Despite numerous attempts with various CSS elements, I have been unsuccessful in removing the header and fo ...

Dividing a button within a flex container

I'm currently building a contact form and I applied display:flex to its div. All the fields are showing up properly and dynamically resizing, except for the submit button which always gets cut in half. Shouldn't it behave like the rest of t ...

Challenges with HTML and CSS drop-down menus

My navigation is giving me a headache. I've been trying to add a dropdown menu, but nothing seems to be working. Here's my current HTML/CSS code. If you have any suggestions on how to fix it, please lend a hand! I've also included a picture ...

Implementing notifications in React JS

Hey there! I'm new to React JS and I need some guidance on how to add notification with action buttons in my PWA. Is there any specific way to achieve this in React JS? I have been attempting to integrate notifications into my progressive web app usi ...

Bootstrap: Customize the Navbar to Collapse on Smaller Screens with nav-side-menu feature

I have implemented a nav-side-menu in my HTML page that remains fixed at the top and left of the screen. My goal is to make it collapse to the left side and display a button with three bars when viewed on smaller screens, without disappearing completely. I ...

Tips for accessing CSS properties on the img tag

I could use some assistance with CSS. I am in the process of creating a tree structure using many <ul> and <li> tags. The issue arises when I have multiple <li> elements with a specific class, each containing an <img> tag. How can ...

Transfer the File object to background.js from the content script, or transmit the createObjectURL and maintain its persistence even after refreshing

My main objective is to execute an in-background file upload task using a file obtained from the content script. I have come to realize that passing a File object directly from the content script to the background is not feasible, as chrome.runtime.sendMe ...

Dealing with a Bootstrap 4 fixed-top navbar issue: Uncovering the mystery behind the white space

I'm encountering an issue with the navbar that is causing a white space: see screenshot. Here is the HTML code I am using: <div class="header"> <div class="overlay"></div> <nav class="navbar fi ...

Generating an excel spreadsheet containing Greek characters

Trying to include Greek characters in xls files has been a challenge for me. I've experimented with different headers to achieve this on the fly. First attempt: header("Content-Type: application/$file_type;charset=utf-8"); header("Content-Dispositio ...

What is the reason behind the fixed order of bootstrap columns on mobile devices?

Iā€™m using the bootstrap grid system for a div order, and I want it to display differently on normal computers versus mobile devices: On regular computers, I want: first second third But on mobile, I want: third second first I have referenced ...

Convert an HTML table with a drop-down menu into a CSV file for exporting

My table has the capability for users to add additional columns, with each new column containing a dropdown list option. However, when attempting to export the table as a CSV file, I encountered an issue where the export functionality only works properly o ...

Retrieve an equal number of elements from HTML with the help of rvest

I am attempting to collect data on the names of cities and addresses of all Apple stores located in the United Kingdom by utilizing the rvest package. library(rvest) library(xml2) library(tidyverse) my_url <- read_html("https://www.apple.com/uk/re ...