zoukankan      html  css  js  c++  java
  • CSS实现英文或拼音单词首字母大写

    CSS实现英文或拼音单词首字母大写,只需要在css样式中加入:

    text-transform: capitalize

    即可。

    测试代码如下:

    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>英文或拼音单词首字母大写</title>
    <style>
    .shou_daxie {
        text-transform: capitalize
    }
    .quan_daxie {
        text-transform: uppercase
    }
    .quan_xiaoxie {
        text-transform: lowercase
    }
    </style>
    </head>
    
    <body>
    <div class="shou_daxie"> 首字母大写:&nbsp;&nbsp;the bus will depart at the scheduled time regardless of latecomers</div>
    <div class="quan_daxie"> 字母全实现大写:&nbsp;&nbsp;tHe Bus wIll dePart at the scHeduled Time rEgardless of latecomers</div>
    <div class="quan_xiaoxie"> 字母全实现小写:&nbsp;&nbsp;tHe Bus wIll dePart at the scHeduled Time rEgardless of latecomers</div>
    </body>
    </html>

    结果如下:

    首字母大写:  The Bus Will Depart At The Scheduled Time Regardless Of Latecomers
    字母全实现大写:  THE BUS WILL DEPART AT THE SCHEDULED TIME REGARDLESS OF LATECOMERS
    字母全实现小写:  the bus will depart at the scheduled time regardless of latecomers

     

    化繁为简
  • 相关阅读:
    备份
    Android资料之-EditText中的inputType
    trim() 是什么意思?
    两数相加
    点击edittext并显示其内容
    php 返回上一页并刷新
    sql one
    sql 语句 查询两个字段都相同的方法
    我为什么喜欢Go语言123123
    数据字典
  • 原文地址:https://www.cnblogs.com/chensihan/p/6867999.html
Copyright © 2011-2022 走看看