Click to See Complete Forum and Search --> : How do I indent text using CSS?


jammer20002
11-21-2004, 10:55 PM
I've got a table.
I want to put text in the cells.
How do I indent the text?
I've tried setting padding and margin, but both don't seem to work for me.

Any help would be appreciated.

Thanks.


Jam

BuezaWebDev
11-21-2004, 11:04 PM
I believe you can indent text with the text-indent property.

Mr Initial Man
11-22-2004, 02:24 AM
Yes.

{
text-indent: ###px;
}


This will only indent the first line of a paragraph, though.

jammer20002
11-22-2004, 05:58 AM
well... i'm doing this...
and it only indents the first line. :(
i want it to indent everything.
i've got code similar to the following:

<span class="myText2 indenting">
This is my text<br>
<br>
More text<br>
<br>
Even more text!<br>
<br>
</span>

my CSS code is as follows:

.indenting
{
margin: 5px;
text-indent: 5px;
padding: 5px;
}

where am i going wrong?

screaming_banjo
11-22-2004, 06:22 AM
You're not using the correct class name, should be:

<span class="indenting">

HTH

jammer20002
11-22-2004, 06:25 AM
well... i solved my problem. :(

i forgot to leave out the other class name.
in my actual code, i have another class called myText2.

i changed padding to be 10px.
that did the trick.
for some reason, 5px doesn't do anything. :confused: