Support » Themes and Templates » Text classes

  • Oh, I used to know this, but have not used it in a while, and no longer know how to do it. And I cannot find it by searching anywhere….

    If my paragraph text is generally set to indent the first line, but I have the following language in my stylesheet:

    /* =MISC
    .left {text-align: left;}

    how do I write the tags for a paragraph that should be left-aligned? In other words, what is the syntax for that paragraph’s opening tag?

Viewing 6 replies - 1 through 6 (of 6 total)
  • <p class="left">

    Is that what you’re looking for?

    Well, I would have thought so, yes. But it doesn’t work. Do you think the syntax in the style sheet is correct, or could that be where the problem is?

    Well, this:

    .left {text-align: left;}

    Looks fine to me. It’s possible another element in your stylesheet is overriding it, or there’s an issue of bad nesting popping up here.

    But a real online-world example of this in action would help in troubleshooting it.

    Here’s a copy of the style sheet:

    And here’s the blog:

    As for a real-world example of the problem, all I can say is that posting a regular paragraph with <p> and </p> tags results in a first line indent, which is correct, and that posting a paragraph with <p class=”left”> and </p> tags *also* results in a first line indent, which is not what I want.

    Ah. Modify your .left declaration to include this:

    text-indent: 0;

    Or whatever value suits. Classes almost always inherit the properties of a parent element. In this case you need to force a new value for it.

    Ya know, I thought that would work, and was even thinking about the text of my appreciative reply. But, while I’m still appreciative of your time and attention, the fix didn’t work. The revised style sheet is at the same location as noted above, with the revision at the bottom in the MISC section. An example of a draft post with the .left class can be seen here:

    The syntax for the paragraph was:
    <p class="left"> blah blah blah </p>

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Text classes’ is closed to new replies.