M
M
Michael R.2015-03-18 20:55:35
css
Michael R., 2015-03-18 20:55:35

How to make an icon appear smoothly (css/html)?

Hello! Faced the problem of "sharp" appearance of the icon when clicking, I wanted to make the appearance / disappearance smooth through the "transition", but the idea was not successful ... =(
Here is the css code:
content: "\f00c";
font: normal 10px FontAwesome;
text -align: center;
color: #2da5da;
position: absolute;
left: 3px;
top: 3px;
Can anyone tell me how to solve the problem? Thanks!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vadim Belkin, 2015-03-18
@Mike_Ro

Depending on whether the icon was originally (that is, it occupied some space in the block) or is inserted dynamically (which leads to a jump and displacement of adjacent elements). If initially it is present, you can usually change the transparency (opacity) from 0 to 1 using transition. If it is inserted dynamically, which leads to displacement of neighboring elements or parent sizes, then you can smoothly change the font-size from 0 (or better from 0.001px - on some versions of android there is a bug with font-size: 0) to the required value ( if the icon is in font). Thus, you can somehow make a smooth shift.

A
Alexander Zachinalov, 2015-03-19
@SanDiesel

Like this? https://jsfiddle.net/yus383p8/

K
Kevgar, 2015-03-21
@Kevgar

daneden.github.io/animate.css Download, connect, assign the "animate" class and the class with the name of the desired animation to the element.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question