Adding CSS to our Headlines application

Our site remains pretty bare. There's a lot of white and some black. Most users prefer color, animations, borders, margins, and so on. As mentioned before, we're not really going to focus on aesthetics now, but we'll add some basic colors and styles.

External, internal, and inline CSS

There are a few ways that CSS can be added to a web page. The best way is to keep it completely separate from the HTML and save it in an external file, which is included in the HTML in a <link> element. This is sometimes referred to as the external CSS. The worst way is called inline CSS. Using the inline method, CSS is defined on a per element basis; this is considered bad practice as any changes to style require trawling through ...

Get Flask By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.