Earlier quoted context omitted.
No, making a shape in CSS is silly. CSS is for styling not drawing. If you want to make a triangle, without an additional (unnecessary) HTTP request, you should use the appropriate web tech which is SVG. Just like all other resources you can easily embed an SVG in your HTML if you're being stingy on the requests (which is a good thing).
not all browsers support SVG (namely IE8). for folks who have to support LOB, this is still an issue.
Animation to Explain CSS Triangles
81–90 of 107 posts
Re: Animation to Explain CSS Triangles
#82Earlier quoted context omitted.
No, having to open an image editor to create a simple shape you can make in CSS is silly. So is an additional, unnecessary HTTP request.
No, making a shape in CSS is silly. CSS is for styling not drawing. If you want to make a triangle, without an additional (unnecessary) HTTP request, you should use the appropriate web tech which is SVG. Just like all other resources you can easily embed an SVG in your HTML if you're being stingy on the requests (which is a good thing).
Re: Animation to Explain CSS Triangles
#83Earlier quoted context omitted.
...and all those impaired people and people with old and slow devices are finally locked out of our new shiny "sane" web. The web isn't just one visual presentation layer, its a multitude of presentation layers for all kind of people and that demands some compromise.
That seems like a false dichotomy. Why should a nice graphic layer immediately exclude everything else?
Also: A lot of the shiny new web apps developed during the last few years are unusable with screen readers and/or on low end devices. As long as we can have graceful degradation, i have nothing against more graphical aspects.
Re: Animation to Explain CSS Triangles
#84Earlier quoted context omitted.
Better to use Arial unicode characters like ▲ or ▼ ASCII encodings and UTF-8 More logical and you can apply all the text styling like color, shadows, skewing, rotate, jquery prepends etc. Put it inside a div and it can go it wherever you want. And it wouldn't be a hack. Some hacks are awesome.. and others are nice playful things but not to be taken with any kind of serious inquiry.
Positioning that accurately would be a massive nightmare due to font rendering differences between OSes and browsers.
Re: Animation to Explain CSS Triangles
#85Re: Animation to Explain CSS Triangles
#86Earlier quoted context omitted.
No, making a shape in CSS is silly. CSS is for styling not drawing. If you want to make a triangle, without an additional (unnecessary) HTTP request, you should use the appropriate web tech which is SVG. Just like all other resources you can easily embed an SVG in your HTML if you're being stingy on the requests (which is a good thing).
Back in the real world, however, we can't use the ideal solution every time because of browser support. Thus, the easiest, most flexible option is CSS.
If you want compatibility with older versions of IE, use both SVG and VML, depending on the browser (VML for IE 8 and earlier, SVG for everything else). This gives you a lot more flexibility (you can draw any polygon, arc, or bezier curve that you want), and compatibility all the way back to IE 5.
Re: Animation to Explain CSS Triangles
#87I find it depressing how most of CSS related drawing is basically all just hacks. I saw the same a few weeks ago when someone posted a bunch of different CSS shapes - the code behind it was the most unintuitive stuff. It's like saying - here's a bicycle - now lets get another one and weld it together in some ugly way and make a car out of it. I dont understand why CSS / Browsers have not come far enough to natively s…
As for the compatibility thing, you're coming at it the wrong way. Don't tell Google et al. to support yet another standard for CSS shapes. Let them spend their time implementing SVG and Canvas according to the existing spec. Inventing a new spec not only doesn't solve the problem, it actually re-introduces it.
Re: Animation to Explain CSS Triangles
#88Honestly, why is there no basic web drawing app out there that exports to CSS? Should be doable and hence done.
OK, that's it everybody. Trying to do something? Is it done yet? Nope? Pack it in. All the things have been done.
Re: Animation to Explain CSS Triangles
#89Earlier quoted context omitted.
Back in the real world, however, we can't use the ideal solution every time because of browser support. Thus, the easiest, most flexible option is CSS.
It's not really the most flexible option. It allows you to make only a fairly limited type of triangle, only pointing in one of eight directions. If you want compatibility with older versions of IE, use both SVG and VML, depending on the browser (VML for IE 8 and earlier, SVG for everything else). This gives you a lot more flexibility (you can draw any polygon, arc, or bezier curve that you want), and compatibility a…
Re: Animation to Explain CSS Triangles
#90Earlier quoted context omitted.
It's not really the most flexible option. It allows you to make only a fairly limited type of triangle, only pointing in one of eight directions. If you want compatibility with older versions of IE, use both SVG and VML, depending on the browser (VML for IE 8 and earlier, SVG for everything else). This gives you a lot more flexibility (you can draw any polygon, arc, or bezier curve that you want), and compatibility a…
I'm racking my brain trying to see the 8 directions. I only see 4: up, down, left & right. Care to explain the other 4?
Here's a series of examples showing how it works (not a fun animation like the OP, but a little easier to follow): http://jsfiddle.net/X8gXS/
Basically, you can get any triangle as long as at least one of the sides is horizontal or vertical.