CSS tricks are something everyone should know for productivity and doing their projects fast. Here I have gathered 10 simple and must-know tricks f...
For further actions, you may consider blocking this person and/or reporting abuse
Use of
!important
should be discouraged. Instead, if you want to override a previously declared style, you can make the selector more specific. For example, suppose we have this markup:To override the styles assigned to
.element
, it is better to do this:or
instead of that:
The need for !important is usually a sign of poorly written code.
That's comfortable to you.
It's not about comfort or convenience, as use of
!important
is considered a bad practice and should be avoided. Quoting from MDN:It's good for novice developers to know that
!important
exists, as they might eventually need it at some point, but they should also know that it should be the last resort.Sure. This is cool and must know.
Resetting box-sizing is helpful
Very helpful
Hey, take care with indentation!!
Good tips :)
Oops
Hey, Suggestions here
for resetting margin and padding
'* {
margin:0;
padding: 0
}'
(less typing!)
Amazing article as always :-) Really appreciate you spreading knowledge. The trick that surprised me most was the internet explorer one.
Thank You Mike.
There are many typos in this post. A quick proofread would bring a bit more credibility to your article.
I agree with you sir. I blog via phone so it becomes really hard to see. From next time I will surely keep this in mind. I'm sorry.