WordPress.org

Ready to get started?Download WordPress

Forums

CSS in post (3 posts)

  1. Owned1Up
    Member
    Posted 9 years ago #

    Where do I put my own CSS to use in my posts? When I go to theme editor and add it to the stylesheet, it seems to ignore it when I try to use it by manually typing class="", etc whereever I want to use it. Thanks

  2. vkaryl
    Member
    Posted 9 years ago #

    In order to use a css declaration in your html, you'll have to use inline styles - you can't just insert the css "bare" as it were.

    Here's an example from http://webdesign.about.com/od/css101classes/a/bl_cssclass2_1a.htm:

    <p style="background-color : #cccccc; border : none;">
    If you put this in your page, this paragraph will have an inline style to change the background color to grey.
    </p>

  3. Lorelle
    Member
    Posted 9 years ago #

    vkaryl is right in how to use styles "inline" in your posts. But you can't do this for every post.

    Check to make sure you are changing the RIGHT style sheet. Check the name of the WordPress Theme you are using and make sure that it matches the name of the folder in which the style.css file you are editing is located.

    When you say that you add it to the style sheet it seems to ignore it, you can't just "add" styles to the style sheet. For instance, if you already have a style set for, say, paragraphs, and you add another style for paragraphs, then which one is it going to pay attention to?

    There is a helpful article on the Codex, the online manual for WordPress, that will help you find the styles within your stylesheet so you can change THAT style specifically.

    And if it "ignores you" then what does that mean? That you can't edit the style sheet or that you don't see the changes on the screen?

    If you are more specific with how you want to change things and what you want to change, then we can be more specific.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags