WordPress makes it easy to manage content on a website without knowing code. But if you know HTML/CSS, it isn’t the best idea to do a lot of inline code that overrides the theme. Occasionally, a bit of margin here or there is fine, but we discourage extensively using inline HTML/CSS to override the theme.
Here’s why:
- Depending on how this HTML/CSS is used, it holds the potential to slow your page delivery down, hurting your search engine optimization. First your theme’s CSS loads, telling it to give every paragraph a 10 pixel margin on the left, then your inline HTML loads, with a command in every paragraph for a 15 pixel margin on the left. This additional code takes a tiny fraction of a second, but if you start multiplying that extensively on every page, it can certainly start to add up.
- If you are planning to update the look of your site with a new theme (actually, I should say when, since it will almost certainly happen at some point in the future), it’s highly probable that someone will then have to go in and undo all of that in-line HTML/CSS to make the new theme display properly. Rule of thumb: try not to create future work for future web managers.
- The focus of our ACWP program is helping people without a lot of tech skills be able to manage their own sites. We’ve learned the hard way that it is infinitely preferable to not create hurdles for lower-tech folks to manage content. If you do a lot of in-line HTML/CSS, you may be the only person who can make changes without creating problems in display. We always want to be planning ahead for a “hit by the bus” scenario – if you are suddenly unable to make changes to the site (for instance, through illness or travel), we want to have done the small things ahead of time that will enable others to make changes without making a mess.
(Note: We’ve had two separate clients where someone with HTML/CSS knowledge created a lot of in-line overwriting of the WP theme, and when that person needed to stop working on the website, the organization had to call us to “fix it” so that all that in-line code didn’t keep messing up what the new web manager was trying to do through the visual editor.)
Even people without code knowledge can inadvertently create these problems. Most frequently, we see this when web managers get carried away with changing font colors. Every time you change the font color, it creates inline HTML. Instead of using inline font colors to emphasize text, try these suggestions.
Best practice: as much as practically possible, you want to rely on the WordPress theme to control the display and look of your site.