4 replies [Last post]
Anonymous
Anonymous's picture
Guru
calgary,alberta
calgary,alberta

Is there an easy way to indent the first sentence of each paragraph :?:
At the moment I'm using "nbsp"
There must be a better way to do this with CSS.

Sven
Sven's picture
Offline
Enthusiast
Brisbane, Australia
Last seen: 7 years 6 weeks ago
Brisbane, Australia
Timezone: GMT+10
Joined: 2003-03-12
Posts: 166
Points: 0

Try using text-indent

text-indent is probably what you're after, so try something like:

p {text-indent:3em}

That's assuming you're using <p> tags to structure your content. CSS - is there anything it can't do?

Trevor
Offline
newbie
Last seen: 11 years 18 weeks ago
Timezone: GMT+10
Joined: 2003-03-21
Posts: 1
Points: 0

em

Thanks Sven,
em's don't mean much to me so I played around a little and was suprised to find that 1em indents about 1.5 characters, 3 em indents about 8.5 characters and to indent about 1 character .7 seems to give the desired result.
So what exactly is an em :?:
Do all browsers handle them the same, I've only tried ie 6 and Netscape 7 :?:

potatoe
Offline
Regular
USA
Last seen: 11 years 17 weeks ago
USA
Joined: 2003-03-24
Posts: 12
Points: 0

Indenting paragraphs

em is about one line-height's worth of space.

ghijkl
Offline
newbie
Melbourne
Last seen: 11 years 18 weeks ago
Melbourne
Timezone: GMT+10
Joined: 2003-03-23
Posts: 2
Points: 0

em is a word

It is ironic. em looks pretty weird. But for once it is not a new cyber-word.
The Shorter Oxford Dictionary defines it as (1) the letter "m" (2) (In typography) A unit of horizontal measurement in typesettingequal to the body of any size of metal typeor the nominal type-size in photosetting, used for calculating the extent of a line or text; loosely a length of 12 points.
Really ironic - the industry made obsolete by this industry - typesetting - survives in one of its more obscure words.