Home  >  Article  >  Web Front-end  >  How to capitalize English first letters in css

How to capitalize English first letters in css

青灯夜游
青灯夜游Original
2021-03-22 13:34:456651browse

You can use the text-transform attribute in css to set the capitalization of the first letter of English. The text-transform attribute can control the capitalization of text. You only need to set the "text-transform:capitalize;" code style for elements containing English alphabetical text to capitalize the first letter.

How to capitalize English first letters in css

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

css sets the capitalization of the first letter of English

In css, you can use the text-transform attribute to set the capitalization of the first letter of English.

Example:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<style type="text/css">
  p.capitalize {text-transform: capitalize}
</style>
</head>
<body>
<p class="capitalize">This is some text in a paragraph.</p>
</body>
</html>

Rendering:

How to capitalize English first letters in css

##[Recommended tutorial:

CSS video tutorial]

css text-transform property

The text-transform property controls the case of text.

Attribute value:

How to capitalize English first letters in css

For more programming-related knowledge, please visit:

Programming Video! !

The above is the detailed content of How to capitalize English first letters in css. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn