How to capitalize English first letters in css

青灯夜游
Release: 2021-07-07 17:29:48
Original
6541 people have browsed it

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>
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!