CSS concave navigation buttons and css navigation
Generally, the rounded corner looks more comfortable, but the right angle below is slightly stiff.
As a result, the designer has the following requirements:
Concave type? Concave type? Concave type? A little abnormal. How can this be achieved ...........
The image must have been taken into consideration first. CSS implementation seems to be difficult .......
Don't be afraid, let's get killed. go...
First, let's look at the html structure. This is very simple and there is nothing to explain:
<! DOCTYPE html>
Look at CSS again
# Nav {background: # fff; border-bottom: 1px solid # 7bd1ff; width: 960px; margin: 100px auto; height: 60px ;;## nav ul li {float: left; list-style: none; height: 60px; margin: 0 10px;} li * {float: left; transition: all. 2 s ;}. con {width: 60px; height: 60px; line-height: 60px; text-align: center; background: # 7bd1ff; border-radius: 10px 10px 0 0 ;} /* set the concave size and locate it using margin */. left ,. right {width: 7px; height: 7px; margin: 53px 0 0 0;}/* Below is the key, mainly using the radial gradient radial-gradient, proportional division is used to achieve direct transparency over to the background color. No gradient test results show that transparent 50% is not a translucent half of the color, 70% + when to compare */. left {background:-webkit-radial-gradient (top left, circle, transparent 70%, # 7bd1ff 30% );}. right {background:-webkit-radial-gradient (top right, circle, transparent 70%, # 7bd1ff 30%);} li: hover. con {background: # 2d85ff} li: hover. left {background:-webkit-radial-gradient (top left, circle, transparent 70%, # 2d85ff 30%);} li: hover. right {background:-webkit-radial-gradient (top right, circle, transparent 70%, # 2d85ff 30% );}
So, this way, isn't there any difficulty, it's easy to deal.