Implement a process bar with arrows using CSS

Source: Internet
Author: User
This article describes the use of pure CSS with the arrow process progress bar, compatible to IE8, the need for friends below to learn together.

First, write a basic style.

. Cssnav li{      padding:0px 20px;       line-height:40px;      Background: #50abe4;      Display:inline-block;       Color: #fff;      position:relative;  }

Next use: After Pseudo-class to draw a triangle, navigate to the right, as follows:

. Cssnav li:after{      content: ';      Display:block;      border-top:20px solid red;      border-bottom:20px solid red;      border-left:20px solid blue;      Position:absolute;       Rightright: -20px;       top:0;  }

Then after the color modification, the basic prototype has been seen.

. Cssnav li:after{      content: ';      Display:block;      border-top:20px solid transparent;      border-bottom:20px solid transparent;      border-left:20px solid #50abe4;      Position:absolute;       Rightright: -20px;       top:0;      z-index:10;  }

Continue to use: before Pseudo-class to draw the left triangle. As follows:

. Cssnav li:before{      content: ';      Display:block;      border-top:20px solid red;      border-bottom:20px solid red;      border-left:20px solid blue;      Position:absolute;       left:0px;       top:0;  }

Then modify the color under before and copy multiple modules to see.

Finally, the beginning and the end of a slightly modified.

. Cssnav li:first-child{        border-radius:4px 0 0 4px;        padding-left:25px;  }    . Cssnav li:last-child,.cssnavend{        border-radius:0px 4px 4px 0px;        padding-right:25px;  }    . Cssnav li:first-child:before{        display:none;    }    . Cssnav li:last-child:after,.cssnavend:after{        display:none;    }

Add the selected state and you are done.

. Cssnav li.active {      background-color: #ef72b6;  }  . Cssnav Li.active:after {      border-left-color: #ef72b6;  }


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.