you know that it's time to either drop the vendor prefix or to hope that there will not be another browser vendor implementing the exact same functionality and again protect it behind a prefix.
I know that technically, the transform specs are not finalized, but considering this kind of consensus (even IE seems to agree), would it even be wise to change the spec again?
I think it's nice to see. It means the spec is probably pretty close to being finalized, because in order for that to happen, there needs to be at least two browser implementations.
They had me at the heart but then the infinity blew my mind.
For the record it works in what's now the "old" Firefox 3.6 (Firefox 6 final is out in 4 days)
Everything made of triangles works in IE8 (ie. star and pentagon work).
Unfortunately IE6 does not support background:transparent but if you know what solid background color you do want, you can fake it.
If I remember correctly there is also a way to fake the transparency in IE6 with a chromakey and filter. You basically make the parts you want transparent a crazy color like bright pink and then have the filter make that color transparent. Almost not worth the effort anymore though.
How much money would HN save in bandwidth from changing the voting arrow images grayarrow.gif and graydown.gif (both 111b) to two small triangles in CSS as shown in this story? Or would it cost them more to even change to the css-style arrows? Also -- correct me if I'm wrong here -- why doesn't HN use one sprite image instead of serving up the images everytime separately for each story and comment? Probably because it's cached the two small arrows from the beginning so there's very little resources used anyways?
The :before and :after add one element of 60px x 60px on each side of the original element.
"border: 20px solid red;" and "border-radius: 50px 50px 0 50px;" makes these elements' border round on three sides and square on the bottom right. (of bottom left for the :after element)
"transform: rotate(-45deg);" and "transform: rotate(45deg);" turn the two elements so that their square corner meet in the middle, leaving one loop on each side.
CSS is designed for typography and layout. It was never designed to render arbitrary geometric shapes - something like SVG should be used for that. This is just clever hacks pushing the box model to its limit.
Basically, the triangle is made of only the bottom border.
The top border is of width 0px so doesn't show. The element itself is 0x0px so doesn't show either. The right and left borders are transparent so you don't see them, but their width of 50px gives the base of the triangle. (which is then 100px) Finally the bottom border is 100px wide which gives the height of the triangle.
Note that the trapezoid further down is the same thing with a width of 100px for the element itself, as if you stretched that triangle in the middle.
You're absolutely right, visual designers really do need to learn CSS.
But not for this. These examples are as relevant to real-world CSS design as writing a Reddit clone in three lines of Clojure is to real-world web development.
[+] [-] pilif|14 years ago|reply
I know that technically, the transform specs are not finalized, but considering this kind of consensus (even IE seems to agree), would it even be wise to change the spec again?
[+] [-] yuhong|14 years ago|reply
[+] [-] andyford|14 years ago|reply
[+] [-] chriscoyier|14 years ago|reply
[+] [-] eneveu|14 years ago|reply
[+] [-] ck2|14 years ago|reply
For the record it works in what's now the "old" Firefox 3.6 (Firefox 6 final is out in 4 days)
Everything made of triangles works in IE8 (ie. star and pentagon work).
Unfortunately IE6 does not support background:transparent but if you know what solid background color you do want, you can fake it.
If I remember correctly there is also a way to fake the transparency in IE6 with a chromakey and filter. You basically make the parts you want transparent a crazy color like bright pink and then have the filter make that color transparent. Almost not worth the effort anymore though.
[+] [-] DanielRibeiro|14 years ago|reply
[+] [-] genieyclo|14 years ago|reply
[+] [-] tintin|14 years ago|reply
[+] [-] rimantas|14 years ago|reply
[+] [-] program|14 years ago|reply
[+] [-] bruceboughton|14 years ago|reply
[+] [-] Stuk|14 years ago|reply
[+] [-] kaitnieks|14 years ago|reply
[+] [-] Timothee|14 years ago|reply
"border: 20px solid red;" and "border-radius: 50px 50px 0 50px;" makes these elements' border round on three sides and square on the bottom right. (of bottom left for the :after element)
"transform: rotate(-45deg);" and "transform: rotate(45deg);" turn the two elements so that their square corner meet in the middle, leaving one loop on each side.
[+] [-] thatjoshguy|14 years ago|reply
[+] [-] wslh|14 years ago|reply
[+] [-] doctoboggan|14 years ago|reply
[+] [-] olavk|14 years ago|reply
[+] [-] unknown|14 years ago|reply
[deleted]
[+] [-] tambourine_man|14 years ago|reply
What I'd like to see is proper anti-aliasing. I'm obsessive enough that it prevents me from using CSS in such cases.
[+] [-] Raticide|14 years ago|reply
[+] [-] lean|14 years ago|reply
I see what their doing, but why does it make the triangle shape? Shouldn't it just render as a square with different sized rectangular borders?
[+] [-] Timothee|14 years ago|reply
Basically, the triangle is made of only the bottom border.
The top border is of width 0px so doesn't show. The element itself is 0x0px so doesn't show either. The right and left borders are transparent so you don't see them, but their width of 50px gives the base of the triangle. (which is then 100px) Finally the bottom border is 100px wide which gives the height of the triangle.
Note that the trapezoid further down is the same thing with a width of 100px for the element itself, as if you stretched that triangle in the middle.
[+] [-] mnutt|14 years ago|reply
[+] [-] jsavimbi|14 years ago|reply
[+] [-] cageface|14 years ago|reply
[+] [-] mortenjorck|14 years ago|reply
But not for this. These examples are as relevant to real-world CSS design as writing a Reddit clone in three lines of Clojure is to real-world web development.
[+] [-] pointyhat|14 years ago|reply