Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rotated border based triangle rendering in firefox

When I make a css triangle it's all good, but when I rotate it a strange line appears in the middle. Why is this?

enter image description here

Here's a fiddle.

div {
    position:absolute;
    top:100px;
    width:0; 
    height:0; 
    border:100px solid rgba(0,0,0,0); 
    border-top-color:#333;
    -webkit-transform:rotate(45deg);
    -moz-transform:rotate(45deg);
    transform:rotate(45deg);
}
like image 565
Skatch Avatar asked Jul 04 '15 15:07

Skatch


People also ask

How do I rotate an image 180 degrees CSS?

Rotating images in real-time with the rotate parameter To rotate the image by 180 degrees, we need to add rt-180 transformation parameter to the URL, as shown below. The resulting image is the same as passing 180deg to the rotate function in CSS.

How do I rotate a Div 90 degrees?

An element can be rotated 90 degrees by using the transform property. This property is used to move, rotate, scale and others to perform various kinds of transformation to elements. The rotate() transformation function can be used as the value to rotate the element.

How do you rotate a shape in CSS?

rotate() The rotate() CSS function defines a transformation that rotates an element around a fixed point on the 2D plane, without deforming it. Its result is a <transform-function> data type.


1 Answers

its bug - https://bugzilla.mozilla.org/show_bug.cgi?id=818109

add translate3d( 0, 0, 1px)

div {
    position:absolute;
    top: 100px;
    width: 0; 
    height: 0; 
    border: 100px solid rgba(0,0,0,0); 
    border-top-color: #333;
    -webkit-transform: rotate(45deg) translate3d( 0, 0, 1px);
    -moz-transform: rotate(45deg) translate3d( 0, 0, 1px);
    transform: rotate(45deg) translate3d( 0, 0, 1px);        
}
<div></div>
like image 97
Dmitriy Avatar answered Sep 24 '22 16:09

Dmitriy