Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-10-23 09:51:09

Gallex
Member
Registered: 2006-10-08
Posts: 1,308

[textile] indentation

how to get indentation to first line of a paragraph?

Offline

#2 2010-10-23 11:00:23

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: [textile] indentation

I suppose you are talking about styling, right? If you want to present the browser with indentation, you need to do it with CSS. For example you could target the first letter of the paragraph, or you could tell the browser to show all whitespace you put inside the paragraph.

/*
	Targeting the first letter of the paragraph
	and adding some padding to it:
*/
p:first-letter {
	padding-left: 30px;
	/* etc */
}

See:

  • “:first-letter”:http://www.w3schools.com/css/pr_pseudo_first-letter.asp
  • padding
  • white-space

Last edited by Gocom (2010-10-23 11:06:08)

Offline

#3 2010-10-23 11:15:11

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: [textile] indentation

Gallex wrote:

how to get indentation to first line of a paragraph?

Textile also has a native format for this but it isn’t as powerful as using a class-based CSS rule as it uses an embedded style on the <p> tag.

p)). Right pad 2em.

The best textile manual I’ve seen is still Zem’s and is worth bookmarking. In this case look for the section called Padding.


Steve

Offline

#4 2010-10-23 11:23:53

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: [textile] indentation

net-carver wrote:

Textile also has a native format for this but it isn’t as powerful as using a class-based CSS rule as it uses an embedded style on the <p> tag.

That adds padding to the whole paragraph, not the the first line ;-)

Offline

#5 2010-10-23 12:47:12

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: [textile] indentation

Gocom wrote:

That adds padding to the whole paragraph, not the the first line ;-)

Yep. Missed that in the OP. Oh well, it might be useful to someone.


Steve

Offline

#6 2010-10-23 21:06:18

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: [textile] indentation

In addition to Gocoms tip:

In CSS exist several properties that can be used for a similar proposal: text-indent and the pseudo-element :first-line.

Last edited by GugUser (2010-10-23 21:06:43)

Offline

#7 2010-10-24 07:06:56

Gallex
Member
Registered: 2006-10-08
Posts: 1,308

Re: [textile] indentation

using css solutions, reflects all paragraphs, you won’t have choices when to use it, when not

Offline

#8 2010-10-24 09:06:29

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: [textile] indentation

You will if you give the paragraphs that you want indented a class. I think the CSS “text-indent” option is the cleanest solution and does allow for negative indentation if you want it.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#9 2010-10-24 10:52:50

Gallex
Member
Registered: 2006-10-08
Posts: 1,308

Re: [textile] indentation

of course! thank’s guys

Offline

#10 2011-07-21 23:41:40

Calion
New Member
Registered: 2011-07-19
Posts: 3

Re: [textile] indentation

You can just use p{text-indent:20px}.

But the problem with this option is that you then must put a newline in between every paragraph, which kind of defeats the point of having first line indents.

Otherwise, you have to resort to html:
<div style=“text-indent:20px;”>Your paragraph here…</div>

But that’s a pain. Anybody have a better idea?

Offline

Board footer

Powered by FluxBB