Has a small line running through the arrow on safari (mobile). FYR
CSS arrow please
11–20 of 76 posts
Re: CSS arrow please
#12I love the creativity that results from CSS' limitations (or, arguably, its flexibility). Neat trick. It took me a moment to realize exactly what was going on to make this work. For those interested: borders are styled in such a way that they angle toward the edges if the border is large enough: \ / / \ That gives you four "V"s to work with. Therefore, to create the arrow, you simply need to hide all but the appropri…
Re: CSS arrow please
#13I love the creativity that results from CSS' limitations (or, arguably, its flexibility). Neat trick. It took me a moment to realize exactly what was going on to make this work. For those interested: borders are styled in such a way that they angle toward the edges if the border is large enough: \ / / \ That gives you four "V"s to work with. Therefore, to create the arrow, you simply need to hide all but the appropri…
I still don't get it. What do you mean that "borders are styled in such a way that they angle toward the edges if the border is large enough"? What causes the angle?
Re: CSS arrow please
#14Re: CSS arrow please
#15For those who enjoy sass: =triangle($direction: up, $size: 10px, $color: #000) width: 0 height: 0 @if $direction == up border-left: $size solid transparent border-right: $size solid transparent border-bottom: $size solid $color @else if $direction == down border-left: $size solid transparent border-right: $size solid transparent border-top: $size solid $color @else if $direction == left border-top: $size solid transp…
I normally use SCSS, but this should work as well. =triangle($direction: top, $size: 10px, $color: #000) width: 0 height: 0 border: $size solid transparent border-#{$dir}-color: $color
Re: CSS arrow please
#16I love the creativity that results from CSS' limitations (or, arguably, its flexibility). Neat trick. It took me a moment to realize exactly what was going on to make this work. For those interested: borders are styled in such a way that they angle toward the edges if the border is large enough: \ / / \ That gives you four "V"s to work with. Therefore, to create the arrow, you simply need to hide all but the appropri…
I still don't get it. What do you mean that "borders are styled in such a way that they angle toward the edges if the border is large enough"? What causes the angle?
Ultimately, how the border is joined at the corners is undefined by the specification:
http://www.w3.org/TR/css3-background/#border-style
> Note: This specification does not define how borders of different styles should be joined in the corner. [...]Many rendering engines will join borders at an angle, producing those diagonal lines.
Re: CSS arrow please
#17Re: CSS arrow please
#18wrap it up in a cocoa app please, so I can use it when I'm not online.
Re: CSS arrow please
#19This is the way to do it, until the graphics guy wants the box to have a drop shadow. The pseudo elements' shadow is square, so your options are either to hope that nobody notices that the arrow doesn't have a shadow (like in this example), or to use an image for the arrow.
Maybe it's time to propose a mask-shadow property?