Recent Topics

1 May 07, 2007 05:31    

My b2evolution Version: 1.9.x

I am attempting to set up blogs in a university situation and upon request from many, who want a paragraph indent, I achieve an automatic paragraph indent by inserting this into their skins' style sheets:

p {text-indent: 1cm}

Everyone likes it and it works great, so that every paragraph in posts is automatically indented the way they want them. But, from time to time, people would like to cancel the indent and have a flush left (or block format) which is, of course, the default, but they just want it for one occurence.

Is there some code which someone can insert in a post prior to a paragraph which they don't want indented, so that it can overide what the style sheet is dictating?

I have this solution, but it seems crude.

Prior to the paragraph I wish to have in block format (no indent) I insert this:

<div class="clear">&nbsp;</div> <div>
Then comes the paragraph to be unindented, which is closed with a </div>

Any ideas of how that could be done more elegantly? Might there be something (like a new <div class>) that could be constructed in the style sheet that would accomplish the override? Maybe, that method I'm using is as simple as it can be done, but it seems very awkward.

2 May 07, 2007 11:07

You can make a second paragraph class in your css file like so:

p.clear {
text-indent: 0;
}


In your posts you can wrap the no indent lines in the new class:

<p class="clear">text goes here.</p>

I haven't checked if this interfers with the auto p / auto br plugin that is automatically installed and wraps the text in <p> paragraphs. If so, you can make a <div> in stead of a <p>.

3 May 09, 2007 05:00

That didn't work. Evidently... it just ignores the new p class.

I liked that text-indent=0. I liked the simple execution... but evidently you can't cancel out with another p designation. Is there some other way to do accomplish the clear indent?

4 May 09, 2007 06:46

If so, the second part of my answer comes into action. If you check the source, what does it say? Is the <p class="clear"> wrapped in the <p> from the auto p plugin?

Try in css:

span.clear{
text-indent: 0;
}


and wrap the text in:

<span class="clear">This is the text of the post that is not to be indented</span>


The auto p plugin will still wrap it in it's <p> tag, but hopefully IE has this part of CSS well implemented, because it should be overridden by the <span class="clear"> tag because the span tag comes after the <p> tag in:

<p><span class="clear">Text text text</span></p>

Good luck

5 May 12, 2007 18:05

Afwas: Well done, my friend!! It worked perfectly. I haven't been where I could test this for a week is why I hadn't come back with this positive feedback.

I will mark this one SOLVED! Great work, Afwas (as usual).


Form is loading...