CSS: The bad bits and how to avoid them
joeforshaw.com
CSS: The bad bits and how to avoid them
1–10 of 109 posts
Re: CSS: The bad bits and how to avoid them
#2This list also assumes the use of a CSS pre-processor.
Re: CSS: The bad bits and how to avoid them
#3The world really doesn't need another "What to Avoid with CSS" list. This list also assumes the use of a CSS pre-processor.
Re: CSS: The bad bits and how to avoid them
#4The world really doesn't need another "What to Avoid with CSS" list. This list also assumes the use of a CSS pre-processor.
Re: CSS: The bad bits and how to avoid them
#5This is the go-to article I send to newbies struggling with z-index. https://hackernoon.com/my-approach-to-using-z-index-eca67feb...
Re: CSS: The bad bits and how to avoid them
#6You could put the style right in the HTML tag, or on the page where it's used, but with dynamic pages (and static stylesheets) both options will cost you bandwidth.
And they split up your styles into separate places.
So putting the style on the id is the right thing to do, and I don't understand why the author is against it.
If I need my footer to look a certain way, then #footer {} is exactly what you should do.
Not add some bogus class based style just in case someone decides we need two footers on one page.
Re: CSS: The bad bits and how to avoid them
#7There's nothing wrong with styling on an id. You could put the style right in the HTML tag, or on the page where it's used, but with dynamic pages (and static stylesheets) both options will cost you bandwidth. And they split up your styles into separate places. So putting the style on the id is the right thing to do, and I don't understand why the author is against it. If I need my footer to look a certain way, then…
If you don't have much resuable stuff on your site, that's a code smell in itself
Re: CSS: The bad bits and how to avoid them
#8Re: CSS: The bad bits and how to avoid them
#9This helped me deliver maintainable and reliable stylesheets that other devs like.
Most importantly using only class names you will gain :
1. Your HTML / CSS is easier to maintain.
2. Is faster to develop.
3. Is faster to refactor.
4. Is more portable.
5. Is faster for the browser.
I even wrote a blog post about it [1].
Re: CSS: The bad bits and how to avoid them
#10The world really doesn't need another "What to Avoid with CSS" list. This list also assumes the use of a CSS pre-processor.