CSS concave navigation buttons and css navigation

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.