Scss to achieve triangles in different directions

Source: Internet
Author: User

Define a trigonometric function to achieve triangular compatibility in different directions IE6
The first parameter passes in the direction of
The second parameter passes in the size of
The third parameter passes in a color
Note: The middle of the incoming parameter must be separated by commas
@mixin triangle ($x, $y: 10px, $z: white) {
@if $x = = "Top" {
Border-width: $y;
Border-color:transparent transparent $z transparent;
Border-style:dashed dashed solid dashed;
}
@else if $x = = "Bottom" {
Border-width: $y;
Border-color: $z transparent transparent transparent;
Border-style:solid dashed dashed dashed;
}
@else if $x = = "Left" {
Border-width: $y;
Border-color:transparent $z Transparent transparent;
Border-style:dashed solid dashed dashed;
}
@else if $x = = "Right" {
Border-width: $y;
Border-color:transparent Transparent transparent $z;
Border-style:dashed dashed dashed solid;
}
width:0;
height:0;
Overflow:hidden;
}
. box{
@include Triangle (right, 200px, red);
}

Scss to achieve triangles in different directions

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.