HTML5文本细节

textarea保存换行符和空格解决方案:

this.submitInfo.healDesc=$(".methodText").val().replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' ');

<sub></sub>文本下标

<sup></sup>文本上标

<ruby>鑫<rt>しん</rt>芮<rt>ずい</rt></ruby>假名标记

关于进度条及其初始化:

<progress max="100" value="30">30% saved</progress>

progress {border: 1px solid #f03e3e;  background-color:#f3f5f7;color: #f03e3e;border-radius: 4px;height: 8px;}
/*progress::-moz-progress-bar { background: #f03e3e; }*/
/*已经完成的进度条,使用progress::-moz-progress-bar { }表示,这与Chrome浏览器是相反的。*/
progress::-webkit-progress-bar { background: #f3f5f7; }
progress::-webkit-progress-value  { background: #f03e3e; }

letter-spacing: 0.5em 字母之间距离

扫描二维码关注公众号,回复: 8769371 查看本文章

word-spacing: 0.5em 单词之间距离

p{text-indent: 0.8em}首行缩进

word-wrap:break-word内容在边界内换行

.ell-wrap{ line-height: 30px; overflow : hidden;text-overflow: ellipsis;display: -webkit-box;-webkit-line-clamp: 2 ;-webkit-box-orient: vertical;} 

有行数地添加省略号 方法一(不适用与firefox)

<div class="text_overflow">打电话发送的合法的是否打算就恢复了卡萨话费卡萨的尽快恢复萨科技和放大看撒娇和发送</div>
$(document).ready(function(){ //限制字符个数 $(".text_overflow").each(function(){ var maxwidth=23; if($(this).text().length>maxwidth){ $(this).text($(this).text().substring(0,maxwidth)); $(this).html($(this).html()+'...'); } }); });


用jQuery添加省略号

text-align:justify  文本两端对齐

text-transform:capitalize每个单词首字母大写uppercase所有字母大写lowercase所有字母小写

发布了13 篇原创文章 · 获赞 1 · 访问量 5639

猜你喜欢

转载自blog.csdn.net/sinrryzhang/article/details/51177708