From the course: CSS: Refactoring Style Sheets
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Update best practices - CSS Tutorial
From the course: CSS: Refactoring Style Sheets
Update best practices
- [Instructor] With all the bugs and formatting issues out of the way, we can turn our attention to true refactoring as in changing and upgrading the CSS to be simpler and easier to understand and up to date with modern best practices. Case in point, at the very top of style dot CSS there's an at import rule that pulls in a style sheet from Google Fonts. This is so that the Open Sans and Roboto Slab fonts can be used later on in the rules. Now this works but using at import to bring in the fonts is no longer considered best practice. It causes performance issues and it's also not very good for the browser. If you think about it, as the browser loads this document the first thing it sees is oh I need to go grab a different document so I'm gonna go pull that in. And meanwhile I'll try to render the fonts, oh wait no I can't because there's this call to the font that was just being downloaded earlier, so I have to wait. So it causes some performance issues. A better method for bringing…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.