Text classes (7 posts)

  1. jbn10161
    Posted 9 years ago #

    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?

  2. Kafkaesqui

    Posted 9 years ago #

    <p class="left">

    Is that what you're looking for?

  3. jbn10161
    Posted 9 years ago #

    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?

  4. Kafkaesqui

    Posted 9 years ago #

    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.

  5. jbn10161
    Posted 9 years ago #

    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.

  6. Kafkaesqui

    Posted 9 years ago #

    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.

  7. jbn10161
    Posted 9 years ago #

    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>

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.