The CSS3
has gained so many utilities that previously were only possible with programming, for example: Media queries, fb, keyframe, transition etc ...
So what are the advantages, disadvantages and when should I use?
The CSS3
has gained so many utilities that previously were only possible with programming, for example: Media queries, fb, keyframe, transition etc ...
So what are the advantages, disadvantages and when should I use?
Must use CSS whenever possible. The only drawback you can / should have is because of older browsers that may not support modern functionality.
CSS3 and its features are already part of the browser software, which means that intepretting CSS is faster to process, you do not need to read / parse JavaScript to do a fade in for example, this is very useful. It's faster rendering and you do not need to download so many Kb.
I consider using all.
For example, in a single file .js
I mix pure JavaScript and jQuery, in other%% of me I benefit from the control I can have over the style of each element in a more organized way.
Another example is the creation of animations. In CSS, animations like fadeOut are less practical than jQuery. As far as styling (colors, sizes, filters, etc.), in my opinion, CSS is the best choice.
When it comes to jQuery and pure JS, the former is reputed to be more practical because of its simple syntax, but for calling functions I always opt for the old JS because I feel more comfortable using function calls like .css
in which part you want in HTML, be minhaFuncao()
, onclick
, etc.