In css, border creates various shapes and css border shapes.

Source: Internet
Author: User

In css, border creates various shapes and css border shapes.

How css uses border to create various shapes

What is the principle of using border to draw triangles? In fact, border with equal width is docked at 45 degrees, such:

 

Go to border:

 

Set the border width to 0:

Set the border height to 0:

Finally, set the left and right border color to transparent, for example:

Paste code to make a small triangle

<Style>. border {width: 0; height: 0; border-bottom: 100px solid red; border-left: 50px solid transparent; border-right: 50px solid transparent ;} </style> <body> <div class = "border"> </div> </body>

 

This website can see the border shapes of various styles

Https://css-tricks.com/examples/ShapesOfCSS/

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.