WordPress.org

Ready to get started?Download WordPress

Forums

Alternative to DIV in Posts (7 posts)

  1. DevonTT
    Member
    Posted 9 years ago #

    Maybe I'm just braindead at this hour, but I'm having trouble figuring out a way to use a .css class or id to format recurring text I'm using in posts.
    I want to format text something like this:
    Tweedledee: Now is the time for all good men to come to the aid of their country.
    Tweedledum: The quick brown fox jumped over the lazy dog.
    (I also want to assign a different color to the names, but that's not enabled on this board.)
    The problem is that the DIV tag apparently isn't allowed in WordPress posts, and the P tag is inserting an extra line.
    What simple and elegant fix am I missing that will probably occur to me in the middle of the night? :D
    Thanks for your help.
    DTT

  2. chiensavant
    Member
    Posted 9 years ago #

    The problem is that the DIV tag apparently isn't allowed in WordPress posts, and the P tag is inserting an extra line.

    Humm.. I don't think so. I use DIV in pretty much all of my posts to specify the position of images inside the post. So DIVs ARE allowed and they work well. But DIVs are inserting a blank line also, which obvioulsy is what you don't like about them.
    As for the colors, Beel's solution works fine.

  3. Root
    Member
    Posted 9 years ago #

    I've added a div with an id in js quicktags.

  4. DevonTT
    Member
    Posted 9 years ago #

    DIV is inserting the extra line? Hmm. Why would it do that? It doesn't work that way in straight-up HTML, does it?
    Root, can you explain what you mean and how to use it?
    Thanks for your responses.
    DTT

  5. DevonTT
    Member
    Posted 9 years ago #

    OK, I downloaded jsquicktags... Uh, what do I do with it now? (Couldn't find any instructions in the zip files.)
    Thx.

  6. DevonTT
    Member
    Posted 9 years ago #

    Em.. OK, I'm slowly catching on to this.
    I created classes for the two different styles, then used SPAN. For some reason, though, neither BOLD nor STRONG would work, even though the text color was displaying correctly. So I finally just increased the text size by 10%, which gives me the effect I was looking for.

  7. Root
    Member
    Posted 9 years ago #

    quicktgs.js is a WP file.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.