Code: Replace Inline Style with CSS Rules

Chapter 6 - Web Page Optimization

Inline style includes the deprecated font tag, inline style blocks, and nonbreaking spaces. Inline style such as:

<p style="font-size:12px;color:black;">Hardcoded text here.</p>
<p style="font-size:12px;color:black;">Inline style redux</p>

bulks up your code and makes it harder to make style changes. It is more efficient to abstract multiple duplicate styles into CSS rules, like so:

<style type="text/css">
    p{font-size:12px;color:#000;}
</style></head></body>

<p>Unencumbered text here</p>
<p>Free and easy</p>