CSS - how to make first letter of string uppercase?

9 points
Created by:

Using CSS it is possible to capitalize letters in following way.

1. test-transform style example

// ONLINE-RUNNER:browser;

<!doctype html>
<html lang="en">

    p.capitalize::first-letter {
        text-transform: capitalize;

  <p class="capitalize">this text has been written with small letters only...</p>


Hey 👋
Would you like to know what we do?
  • Dirask is a friendly IT community for learners, professionals and hobbyists to share their knowledge and help each other in extraordinary easy way.
  • We welcome everyone,
    no matter what the experience,
    no matter how basic the question is,
    this community will help you.