TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

CSS3 Features That You Can Finally Start Using

167 pointsby fvrghlover 11 years ago

14 comments

bbxover 11 years ago
&quot;Finally Start Using&quot;??<p>If you&#x27;re waiting for all browsers to implement these CSS3 features correctly, you&#x27;ll end up never using them.<p>For example, CSS animations have been around for at least <i>2 years</i>. Only Firefox and Webkit browsers supported them and you had to rely on vendor-prefixed properties, but animations were exciting enough for me to start experimenting with them as soon as I could.<p>There is permanent rant towards &quot;fancy&quot; CSS3 features that haven&#x27;t reached a &quot;W3C standard&quot; status yet. But a website experience doesn&#x27;t need to be visually consistent across browsers. If you&#x27;re using a plain hexadecimal color code as a replacement for rgba, it&#x27;s ok. If your intro is animated in Chrome but not IE, it&#x27;s ok too. If your last paragraph has a margin that the pseudo-element :last-child should have canceled, it&#x27;s ok as well.<p>Front-End developers have waited more than a decade for CSS improvements. You can&#x27;t wait for a unified browser environment to start implementing them. I&#x27;m surprised by this article&#x27;s tone, as if today, <i>suddenly</i>, everything changed. No way: browser support is a permanent process. Don&#x27;t wait for that perfect day because it will never come. Just start having fun with CSS3 <i>while</i> providing a decent experience for IE (the main culprit).
评论 #6622450 未加载
评论 #6626492 未加载
lazyjonesover 11 years ago
Roughly 4% of our users still use MSIE 6 (some report that they need to due to their restricted work environment). I need a good reason to risk 4% of our revenue for some eyecandy, or a good fallback mechanism (difficult if my layout relies on calc(), for example). HTML&#x2F;CSS is a sad story ...
评论 #6621960 未加载
评论 #6622305 未加载
评论 #6622008 未加载
评论 #6622188 未加载
评论 #6623250 未加载
评论 #6625043 未加载
评论 #6621968 未加载
评论 #6621954 未加载
评论 #6622247 未加载
评论 #6621979 未加载
评论 #6622413 未加载
scotthover 11 years ago
In the article, it&#x27;s mentioned that there isn&#x27;t great support for flexbox, which is only half true.<p>Using a combination of the older and new syntax (display: box and display: flex), you can already do quite a bit.<p>I&#x27;ve been using autoprefixer (<a href="https://github.com/ai/autoprefixer" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ai&#x2F;autoprefixer</a>) for a few months now, building simple flexboxes all over the place with the attributes from the new spec, and have only run into one or two little issues that I can generally hack away.
mmmbaneover 11 years ago
From the article: &quot;The standardization bodies have probably had their reasons, but it doesn’t feel at all intuitive to have the CSS width and height of an element affected by its padding and borders.&quot;<p>And not only are height and width affected by padding+borders, they are affected in different ways, respectively. It&#x27;s just weird. Does anybody have any insight into what the standardization bodies&#x27; reasons were?
评论 #6622341 未加载
Lercover 11 years ago
I&#x27;m still waiting on decent attr() support.<p><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=435426" rel="nofollow">https:&#x2F;&#x2F;bugzilla.mozilla.org&#x2F;show_bug.cgi?id=435426</a><p>In an ideal world, instead of attr() and calc(). I&#x27;d like a simple pure functional language to calculate values for CSS properties. Properties defined by such a system could be efficiently cached and recalculated as required. Easy Parallel evaluation would be a bonus too.<p>I&#x27;d like to be able to do things like define a path as a mathematical function and then have an &lt;UL&gt; that evenly spaces &lt;LI&gt; items along that path. Preferably without requiring the browser to be specifically aware of the concept of a path.
评论 #6624233 未加载
oneeyedpigeonover 11 years ago
There&#x27;s a brief mention in passing, but the lack of good support for CSS columns is really frustrating. I have a requirement on a project that I&#x27;m working on for columns, but they just cannot be satisfactorily implemented in CSS alone, in any browser. Apart to resort to JavaScript instead.
评论 #6623550 未加载
评论 #6621872 未加载
DougWebbover 11 years ago
A bunch of those demos don&#x27;t work on the Android browser. I also happen to know that calc() doesn&#x27;t work on Safari 6.x, among others.<p>I&#x27;ve been updating my webapp software to use flexbox-based layouts, and I have to use a fair number of calc() styles to get the layout I want. (The newer css grid layouts would probably work better, but for now flexbox is the best available.) I&#x27;ve found that a combination of old and new flexbox syntax, Modenizr&#x27;s flexbox detection, and javascript code that detects whether or not calc is available and runs a method to simulate all of my calc() styles when it isn&#x27;t, is all necessary to give me good browser compatibility. IE7 and IE8 work surprisingly well, Safari 5 on Windows and 5+ on Mac work, Mobile Safari 5 on the original iPad 1 works, and Mobile Safari 6+ on newer iPads and iPhones work. Firefox, Chrome, and IE9+ work great as well, of course.<p>It&#x27;s a lot of additional effort, but it&#x27;s worth it and definitely doable if you need the browser support and you want to use modern techniques.
评论 #6622500 未加载
评论 #6623114 未加载
评论 #6622546 未加载
RoboKittenover 11 years ago
Modernizr is a great way to be able to start using some of these features with legacy browsers. I actually have to battle with some of my customers to <i>upgrade</i> to IE8 (and not to set the group policy that forces &quot;compatibility mode&quot;).
tomasienover 11 years ago
Calc() is a huge deal. For non-business oriented applications where IE8 may still be in use, calc() is going to be a god damn lifesaver. I replicate the function in javascript all the time, no longer!
pornelover 11 years ago
There are soo many pointless uses of calc()… in this example `margin: 0 20px` gives identical result.<p>In most other cases all authors really want is `box-sizing: border-box` (which works in IE8+).
评论 #6622462 未加载
评论 #6622514 未加载
评论 #6622525 未加载
welderover 11 years ago
Speaking of cool CSS animations, try this pure-css library:<p><a href="https://daneden.me/animate/" rel="nofollow">https:&#x2F;&#x2F;daneden.me&#x2F;animate&#x2F;</a> (Animate.css)
评论 #6622972 未加载
jebblueover 11 years ago
I run Ubuntu on my PC, it&#x27;s an i7 8 core machine with nVidia GTX 660 and the latest tested Restricted driver from the repository. That animation drove my CPU aggregate by top to 90% usage. I clicked the Edit button and while the code was showing the CPU activity dropped back to minimal.
评论 #6625733 未加载
评论 #6622364 未加载
exo_duzover 11 years ago
Calc is the most interesting item here in my opinion and the browser support. <a href="http://caniuse.com/calc" rel="nofollow">http:&#x2F;&#x2F;caniuse.com&#x2F;calc</a><p>I&#x27;d kill for the ability to do variables in CSS like LESS and SCSS.
stephpover 11 years ago
Pet peeve: Default z-index makes elements farther down in the code display on top of elements higher up in the code. With multiple backgrounds, the first listed has the highest z-index.