Practical WordPress Tip #4: Use inline styling for testing CSS

(Reading time: 2 – 3 minutes)

Great website design results in return visitors.

Problem: Making small changes to the design of a web page sometimes results in large effects.

Practical WordPress Tip: Test small style changes in your website design using inline styling before hacking your CSS file.

Here’s how to override the styles you’re interested inline:

  1. Here’s an example inline style which colors text within a paragraph red: <p style="color: red;">. Colors are easy. Experiment with borders, padding and margins for more challenge.
  2. Once your inline style is correct then create a class in your style file with those atttibutes. For example:
    1
    2
    3
    
    p.redtext {
       color: red;
    }

    Make sure to back up your CSS stylesheet before you make modifications.

  3. Then replace the inline style: <p class="redtext">.
  4. If it doesn’t work, check your spelling, try again. Spelling is a very common cause of blunders.
  5. If it still doesn’t work, check how the style sheets are being loaded.
  6. Then check how the selectors are being used. For example, Thesis theme for WordPress requires a .custom class when you modify the CSS in a custom style sheet.

Why: When you’re operating on a running site, and I know that’s what you do because I do it too, it’s a little like doing open heart surgery with the whole family in the audience. If you mess it up, your site goes into cardiac arrest, publicly. Using inlines to handle small style tests reduces the risk to your website. If you are going to make major changes, you should install a local working environment and rebuild your CSS first, then deploy.

Previous Practical WordPress Tip: Practical WordPress Tip #3: Keep A Few Spare Posts Handy

Next Practical WordPress Tip: Practical WordPress Tip #5: Keep rough drafts ready to publish at any time


Do you have a Tip? Would you like to write a Practical WordPress Tip? Each Tip is very short, and focuses on a single action that anyone can use right away, no programming required! If you have a Tip that fits into this series, and you’d like to publish it here on Website In A Weekend, send it on!


Practical WordPress Tip #3: Keep A Few Spare Posts Handy

(Reading time: 2 – 2 minutes)

Regular blog posting is rewarded with higher search engine rankings.

Problem: Something came up all of a sudden, which wasn’t planned in advance. Perhaps the surf is firing. Perhaps you just want to take the day off. But you don’t have time or energy to crank out your daily blog post.

Practical WordPress Tip: Write a few articles—in advance—specifically for when you want to take off to the mountains.

This is similar to writing in advance when you are going on vacation, the difference being that vacation articles are scheduled ahead of time, but these articles stay in your draft queue, finished and ready for publication on a moments notice. Carry the dates on these a day or two ahead of the current date, instead of a month ahead as suggested in Practical WordPress Tip #2: Make Your Draft Queue Work For You.

Why: As it turns out, this tip was written expressly to publish sometime in the next week… the surf will come up, and I’ll make a command decision to go surfing instead of write blog posts.

Previous Practical WordPress Tip: Practical WordPress Tip #2: Make Your Draft Queue Work For You

Next Practical WordPress Tip: Practical WordPress Tip #4: Use inline styling for testing CSS


Do you have a Tip? Would you like to write a Practical WordPress Tip? Each Tip is very short, and focuses on a single action that anyone can use right away, no programming required! If you have a Tip that fits into this series, and you’d like to publish it here on Website In A Weekend, send it on!