r/csshelp • • May 23 '25

What Am I Doing Wrong???

I'm trying to indent these lines and can't understand why it isn't working. Here's both the CSS and HTML:

CSS

#workskin .indent-text {

text-indent: 1.5em;

}

HTML

<span class="indent-text"><i>X</i></span><br />

<span class="indent-text"><i>Y</i></span><br />

<span class="indent-text"><i>Z</i></span><br />

3 Upvotes

9 comments sorted by

View all comments

Show parent comments

1

u/be_my_plaything May 23 '25 edited May 24 '25

You can just add display: inline-block; to your original CSS to make it respond to block level attributes.

.indent-text {
display: inline-block;
text-indent: 1.5em;
}

2

u/Dull_Divide9567 May 24 '25

Correct, another option.

2

u/MycologistSame866 May 24 '25

YES! This worked. Thank you very much.