Home › Forums › CSS › How To: Make hidden span slide up with transition duration? › Re: How To: Make hidden span slide up with transition duration?
March 3, 2013 at 3:58 am
#126733
Merri
Participant
margin: 0 auto; only works for block elements that are static or relative and have a width. Now price element doesn’t have anything to “auto” to as it isn’t in regular page flow – element isn’t in page flow if you float an element or if it is absolutely positioned.
The trick you need to do is to give the elements a left and top of 50% and then use negative top margin to move the price element up by half of height + padding (= 70px) and do the same kind of changes to the left margin. Then also change the :hover state so that it is based on margin instead of left and top.