Home >Web Front-end >HTML Tutorial >CSS如何将单词首字母设置为大写_html/css_WEB-ITnose

CSS如何将单词首字母设置为大写_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:31:201719browse

CSS如何将单词首字母设置为大写:
本章节介绍一下如何使用CSS将英文单词的第一个字母设置为大写状态,代码实例如下:

 

<!DOCTYPE html><html><head><meta charset=" utf-8"><meta name="author" content="http://www.softwhy.com/" /><title>蚂蚁部落</title><style type="text/css">#box {  height:300px;  width:300px;  border:1px solid;  text-transform:capitalize;}</style></head><body><div id="box">i am a good student</div></body></html>

 

以上代码实现了我们的要求,比较简单,可以参阅CSS的text-transform属性一章节,

原文地址是:http://www.softwhy.com/forum.php?mod=viewthread&tid=9649

更多内容可以参阅:http://www.softwhy.com/divcss/

 

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