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

How to capitalize English first letters in css

云罗郡主
Release: 2018-12-01 11:43:01
Original
15620 people have browsed it

We often see capitalization of the first word in English newspapers, so how to set the capitalization of the first letter of a word? Many people may encounter this problem and don’t know how to operate it. Let’s explain the css How to set English initial letters to be capitalized?

How to capitalize English first letters in css

To realize the capitalization of English initial letters, you can use div css. A text-transform attribute in div css can set the upper and lower case of letters, as well as the full text of letters in upper case and the full text of letters in lower case.

1: text-transform structure syntax:

The text-transform attribute has three attributes, namely Capitalize, Uppercase and Lowercase.

Capitalize means that no matter whether the letters are uppercase or lowercase, all letters will be converted to first letter capitalization. Syntax: div{text-transform:capitalize};

Uppercase means no matter whether the letters are uppercase or lowercase, all letters will be capitalized. Convert all letters to uppercase, syntax: div{text-transform:uppercase};

Lowercase means that no matter whether the letters are uppercase or lowercase, all letters are converted to all lowercase by CSS, syntax: div{text-transform:lowercase }

2: The code example is as follows:

<!DOCTYPE html>
<html>
<head>
<style type="text/css">
h1{text-transform:capitalize}
h2{text-transform:uppercase} 
h3{text-transform:lowercase} 
</style>
</head>
<body>
<h1>php.cn</h1>
<h2>php.cn</h2>
<h3>php.cn</h3>
</body>
</html>
Copy after login

The display effect is as follows:

How to capitalize English first letters in css

## Regardless of letters Whether it is uppercase or lowercase, we can use the text-transform style attribute to set it. The above is a complete introduction to how to set English initial letters in css. If you want to know more about

CSS3Tutorial, please pay attention to php Chinese website.


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:
css
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