CSS3 Create transparent Border triangle

Source: Internet
Author: User

Briefly

In front, we have shared about the implementation of the triangle, mainly according to the border property to set, the following we have to achieve the top, bottom, left, right a variety of different colors of the triangle.

    • Briefly
    • Realize
      • Effect
      • Source

Achieve results

Source
<! DOCTYPE html><html><head><style type=' text/css '>/ * Upper triangle * /. arrow-up {  width: 0;   height: 0;   border-left: px solid transparent;   border-right: px solid transparent;  border-bottom: px solid green; }/ * Lower triangle * /. Arrow-down {  width: 0;   height: 0;   border-left: px solid transparent;   border-right: px solid transparent;  border-top: px solid orange; }/ * Right triangle * /. Arrow-right {  width: 0;   height: 0;   border-top: The px solid transparent;   border-bottom: The px solid transparent;  border-left: solid blue, px; }/ * Left triangle * /. Arrow-left {  width: 0;   height: 0;   border-top: tenpx solid transparent;   border-bottom: tenpx solid transparent;  border-right: tenpx solid silver; }</style></head><body>  <div class="arrow-up"></div>  <div class="Arrow-down"></div>  <div class="Arrow-left"></div>  <div class="Arrow-right"></div></body></html>

The code is relatively simple, I will not too much elaboration!

CSS3 Create transparent Border triangle

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.