Transitioning CSS properties before they are applied

Looking to add a transition effect to my WordPress menu item by including an icon on hover...

Successfully tested this with a word and it's working well...

.academy .avia-menu-text:hover::before {
    content:'Now ';
  transition:all 3s;
-webkit-transition:all 3s;
}

However, the transition isn't as smooth as desired. Need help achieving a smoother fade in effect. Check out testfile for reference.

Answer №1

If I understand correctly, you are looking to add animated text before your element.

You can achieve this effect without using a hover state:

.academy .avia-menu-text:before {
    width: 0; 
    transition: 3s;
    content: 'your text'; 
}
.academy .avia-menu-text:hover:before {
    width: 100%; 
}

Here is a simple example of how you can implement this in a container:

p:before{ content: 'hello world';  width: 0; display: block; overflow: hidden;  transition: .3s; position: absolute; left: -100px; top: 0; white-space: nowrap;}
p:hover:before{ width: 100%; }
div{ width: 300px; height: 100px; }
p{ position: relative; left: 100px; }
<div>
  <p>Text here</p>   
</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

Semi-transparent navigation bar with dropdown functionality

Trying to create a Bootstrap menu similar to the one on I've made progress, but I can't seem to achieve a completely transparent effect on hover. In my fiddle below, there always seems to be a hint of grey in the dropdown when hovered over. I& ...

Create a hexagon shape using a Div element and start from one of its sides

Is there a way to create a Div with a background image that appears like a hexagon when viewed from one side? Check out this demo to see exactly what I'm looking for: Demo In the example/demo, the header is designed to look like a hexagon from its ...

Is it possible to incorporate a LINK within the CSS GRID layout?

Hey everyone, I've encountered an issue with my link placement in the grid. I'm looking to turn the entire box into a clickable link. * { padding: 0; margin: 0; } body { font-family: Hiragino Kaku Gothic Pro W3, Arial; } .title-conta ...

Positioning the slider based on the width

I've created a slider on my website: However, I noticed that when I slide to the right, there is some space between the image and the edge of the container. Despite setting everything's width to 1100px, I can't figure out where this extra s ...

FlexBox in CSS not aligning horizontally on vBulletin forum in Internet Explorer

I've been working on aligning four images/links using Flexbox for a basic banner row. It's working smoothly in Chrome and Firefox, but in IE 11, the Flexbox is not behaving as expected, causing the images to stack vertically instead of horizontal ...

Uniquely Designed JQuery Alert Box

One issue I am facing is that I have two types of alert boxes, one for success and the other for error. In my Zend-based application, these alert boxes show up when users fill out forms such as profile updates or new submissions. My goal is to customize th ...

Mobify enables the activation of jQuery Tabs on carousels

Looking to implement a tab menu above my Carousel that will correspond to different packages within the carousel when clicked. Additionally, I want the tabs to adjust accordingly when the carousel is swiped, ensuring that the active tab reflects the curre ...

Manipulating the DOM to show various elements upon clicking on text

Currently, I am engaged in a small project that involves experimenting with DOM manipulation. The project revolves around creating a Todo list where users can generate various categories (such as work, gym, finances, etc.) and then add corresponding subtas ...

Highlighting table rows on mouseover using CSS

I am trying to add a hover effect to my table rows, but when I apply the CSS styles for this behavior, the rows start wrapping. Here's a comparison of how the table rows look before and after applying the styles. You can see the wrapping issue in the ...

Tips for utilizing external CSS solely within a designated section

Currently, I'm working on a web application that requires the option to display a specific area using Bootstrap 4.1 or Bootstrap 3. The entire application is already built using Bootstrap 3: https://i.sstatic.net/pPuM6.png I have already implemented ...

The WordPress issue of a background image not displaying properly when using both a linear gradient and an image

Code snippet: style="background-image: linear-gradient(151deg,#6a7a8f 9%,#8692A4 30%,#a9b1be 49%, #ced2d9 66%, #f1f0f1 88%),url(<?php echo $page['image']; ?>);" Within the div, only the linear gradient is visible. When I switch the order ...

The synchronization issue between ng-class and animation

I'm experiencing a strange issue with ng-class and suspect that it may be related to a race condition. Here is the example on Plunker: example Below is the relevant JavaScript code: self.slideLeft = function() { if (self.end_index < se ...

Adjust the input value with CSS when hovering

Whenever I click on a button, the name of that button is displayed on the site. However, I am looking to change this button name when hovering over it but I am not sure how to do it. echo '<form id="button" method="POST" >&ap ...

When you hover over the Dropdown Menu, the Hoverable Dropdown Menu will automatically close

I am currently working on creating a dropdown menu that pops up when hovering over an item. However, I am facing two challenges: Once my mouse moves away from the item, the dropdown disappears. Therefore, I would like the dropdown to remain visible as lo ...

Example of Image Slider using AngularJS

<body ng-app="myApp"> <div ng-controller="slideShowController" class="imageslide" ng-switch='slideshow' ng-animate="'animate'"> <div class="slider-content" ng-switch-when="1"> <img src="../images/ship.png" /> & ...

The css values for component _nghost-c0 in an Angular application

Recently, I've been delving into Angular 5 and couldn't help but notice the peculiar html tags with ng generated attributes like _nghost-c0 and _nghost-c1... This got me wondering, what exactly do these attributes signify? [_nghost-c3] .employee ...

Tips for incorporating border/outline/stroke into SVG elements using CSS

Currently, I am incorporating SVG elements into a webpage using D3js. However, I am facing challenges when it comes to styling these elements as typical CSS syntaxes like path { border: 3px solid green; } do not seem to work. Is there a way to apply bo ...

Determine a comparative measurement using specific numerical values

I am currently in the process of creating a webpage and I want to ensure that it is responsive by adjusting certain values based on the width of the viewport. Specifically, I have a DIV element that I want to split into 2 columns. For smaller screens (min ...

The output produced by ASP.NET remains unaffected by JQuery or JavaScript interference

I am facing an issue with manipulating a dynamically generated directory tree in HTML format using JavaScript. I have a piece of code that generates the tree server-side in ASP.NET and then tries to add a '+' at the end of each list item using jQ ...

Mpdf does not support inline CSS rendering

I recently implemented Mpdf into my Symfony project using Composer. The installation process involved running the following command: composer require mpdf/mpdf Next, I included the Mpdf.php file in autoload.php. Here is an example of how to use Mpdf in ...