1

Is there a way I can make an exception to text-transform: lowercase; such that the word 'I' (i.e. a space, followed by the letter I, followed by a space) would still be rendered as a capital?

Thanks.

2 Answers 2

3

If you can wrap the I inside a span tag, you can override the case.

.text {
  text-transform: lowercase;
}
.text span {
  text-transform: uppercase;
}
<div class="text">All lowercase BUT <span>I</span> is uppercase</div>

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks. That's essentially what I'm doing right now with: .pronounI {text-transform: uppercase !important;} and <span class="pronounI">I</span> I was hoping there may be a way to automate this in CSS.
Unfortunately, CSS cannot select text nodes. No vanilla CSS solution for it.
OK. Thanks. At least I now know to stop looking.
0

Try this:

p {
   text-transform: lowercase;
}

p::first-letter {
    text-transform: uppercase;
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.