Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

text-indent on second line with CSS 3

Status
Not open for further replies.

RoKKos

Programmer
Feb 3, 2003
50
SE
Hi.

I want a text-indent on the second line of a <h3>-element but I do not know how to do it.

have tried all kinds of things like:
h3:first-line:after{text-indent: 40px}
<div style="left:20px; position:relative; text-indent:-20px;">

But I cant get it to work... any ideas??
 
Do you mean your H3 is spanning 2 lines and the second must have an indent?

Do it manually with a &lt;br /> and spaces &amp;nbsp;




<!--#sig value=''É'' url='' -->
 
h3 { margin-left: 30px }

< h3>This entire header will be left indented. Even if it line wraps.< /h3>
 
cian: well... that is the way I have done it but I would like to do it with css
 
wiser3: the thing is that I dont want the indent on the first line :-(
 
This is known as a hanging indent.

Try something like:
Code:
H3.hang {text-indent: -40px; padding-left: 40px}

Tom Morrison
 
k5tm>> Thanx... works like a charm :)
Just what I needed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top