r/csshelp • u/jakethespectre • Jan 03 '15
Help adding a transition to the sr-drop thing.
I'm working on /r/jakethespectre and I want the .drop-choices.sr-drop thing to "slide" down. I know there needs to be some sort of transition effect, but I'm fairly new to css and haven't worked with them yet.
3
Upvotes
4
u/6022e20 Jan 04 '15
Use this:
Example in my sub: /r/testcss2
Will only work if the height of the dropdown is less than 999px. If you want to, I can write up an explanation.
1
u/[deleted] Jan 03 '15
To set a transition play around with the
transition:attribute. You'll have to select the element i.e a table or take opacity for an example. If i wanted to make something face slowly between two opacity's than you'd puttransition: opacity 0.5s ease;under a specified class. (Obviously having a different opacity for the pseudo element & primary class. Most likely for hover the pseudo class =:hover)Put simply if you want the slide down than put this
transition: left 0.2s;under the class you want to slide down after the pseudo element is triggered (:Hovertrigger on hover or:checkedtrigger on checked).