Capitalize first letter of sentences CSS

capitalization, css

Solution

You can capitalize the first letter of the `.qcont` element by using the pseudo-element `:first-letter`.

.qcont:first-letter{
  text-transform: capitalize
}

This is the closest you're gonna get using only css. You could use javascript (in combination with jQuery) to wrap each letter which comes after a period (or comma, like you wish) in a `span`. You could add the same css as above to that `span`. Or do it in javascript all together.

Here's a snippet for the css approach:

.qcont:first-letter {
  text-transform: capitalize
}
<p class="qcont">word, another word</p>

Problem

I want to capitalize the first letter of sentences, and also the first letter after commas if possible. I want to add the code in here: ``` .qcont { width: 550px; height: auto; float: right; overflow: hidden; position: relative; } ```

Original source

Related problems