The code in the JSFiddle
below creates a menu bar that has a border around it. I thought it might be nice if I added an effect on the li
element when you click it to help show that the li
element is active
. To do this I put the following translation on the li
element when it is active
box-shadow: 0 -3px hsl(180, 0%, 22%);
@include transform(translate(0, 2px)); //SCSS Mixin which acts the same as transform: translate(0, 2px);
@include transition(all, 0.25s); //SCSS Mixin which acts the same as transition: all 0.25s;
However, when I used this code, I noticed that the background of the li
element didn't follow the border radius whilst the transition was taking place. So I did some research and found this answer to a question which found the same problem. However, this did not provide a solution for me. I would appreciate any help in making the background follow the border radius.
See the image for a visual aid of the problem and the JSFiddle
for a code example