js 为字符串添加样式
<html>
<body>
<script type="text/javascript">
var txt="Hello World!"
document.write("<p>Big: " + txt.big() + "</p>")//大字体
document.write("<p>Small: " + txt.small() + "</p>")//小字体
document.write("<p>Bold: " + txt.bold() + "</p>")//加粗
document.write("<p>Italic: " + txt.italics() + "</p>")//倾斜
document.write("<p>Blink: " + txt.blink() + " (does not work in IE)</p>")//闪烁
document.write("<p>Fixed: " + txt.fixed() + "</p>")//固定大小
document.write("<p>Strike: " + txt.strike() + "</p>")//划掉
document.write("<p>Fontcolor: " + txt.fontcolor("Red") + "</p>")//字体颜色
document.write("<p>Fontsize: " + txt.fontsize(16) + "</p>")//字体大小
document.write("<p>Lowercase: " + txt.toLowerCase() + "</p>")//小写
document.write("<p>Uppercase: " + txt.toUpperCase() + "</p>")//大写
document.write("<p>Subscript: " + txt.sub() + "</p>")//偏下
document.write("<p>Superscript: " + txt.sup() + "</p>")//偏上
document.write("<p>Link: " + txt.link("http://www.baidu.com") + "</p>")//链接
</script>
</body>
</html>
Big: Hello World!
Small: Hello World!
Bold: Hello World!
Italic: Hello World!
Blink: Hello World! (does not work in IE)(闪烁)
Fixed: Hello World!
Strike: Hello World!
Fontcolor: Hello World!
Fontsize: Hello World!
Lowercase: hello world!
Uppercase: HELLO WORLD!
Subscript: Hello World!
Superscript: Hello World!
Link: Hello World!
js 为字符串添加样式的更多相关文章
- js实现元素添加样式
		
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
 - JavaScript为字符串添加样式
		
<script type="text/javascript"> var txt="Hello World!" document.write(&quo ...
 - js给元素添加样式[addClass][hasClass]
		
function addClass(el, className) { if (hasClass(el, className)) { return } let newClass = el.classNa ...
 - React使用Styled-Componets来添加样式
		
React使用Styled-Componets来添加样式 Styled-Comonents是用JS中ES6 语法的方式来管理CSS样式的一个组件,解决了在import CSS文件时样式重复 安装 项目 ...
 - 原生js动态添加style,添加样式
		
原生js动态添加style,添加样式 第一种 var style="[assign-url='"+str+"']{display:initial}"; var ...
 - Vue.js随笔二(新建路由+component+添加样式+变量的显示)
		
创建一个页面: 1.首先让我们看一下整个vue.js的目录,如下图所示: 2.现在让我们创建一个页面吧: 2-1首先你需要新建路由(就和建立一个如何找到项目文件的目录一个意思):进入src/route ...
 - 改变某个对象的CSS样式时,不要使用JS直接添加样式,
		
重绘: 使用js改变网页的背景颜色 浏览器会把整个网页的颜色重新在画一遍,导致性能降低 回流: 只要改变某个DOM对象的宽或者高,浏览器就会重新再计算网页结构,重新生成一次,导致性能严重降低. CSS ...
 - 原生js移除或添加样式
		
样式效果如下,点击商品详情 添加样式active 代码 <!doctype html> <html lang="en"> <head> < ...
 - js 为url字符串添加、修改参数
		
//为url字符串添加.修改参数 String.prototype.EditUrlParam = function (paramName, replaceWith) { var url = this; ...
 
随机推荐
- LeetCode Counting Bits
			
原题链接在这里:https://leetcode.com/problems/counting-bits/ 题目: Given a non negative integer number num. Fo ...
 - Java 使用GDAL 读写 shapefile
			
读取shp文件,并把它转化为json import org.gdal.ogr.*; import org.gdal.ogr.Driver; import org.gdal.gdal.*; public ...
 - 浅析 Magento网站建站空间的选择
			
对 Magento稍有了解的人都知道,作为一个功能异常强大的网络商城程序,Magento的运行对主机空间的要求是非常高的:很多 Magento建站公司都会推荐 VPS 甚至独立服务器来运行 Magen ...
 - Windows Azure - Troubleshooting & Debugging: Role Recycling
			
每年总会碰到几次Role Recycling,处理完记录下 :) 1. 和往常一样先排查系统日志,修复异常.> 没效果 :( 2. 排查Event Viewer中的Logs,没有发现比较奇怪Lo ...
 - ps commad
			
要对系统中进程进行监测控制,查看状态,内存,CPU的使用情况,使用命令:/bin/ps (1) ps :是显示瞬间进程的状态,并不动态连续: (2) top:如果想对进 ...
 - Oracle常用操作——创建表空间、临时表空间、创建表分区、创建索引、锁表处理
			
摘要:Oracle数据库的库表常用操作:创建与添加表空间.临时表空间.创建表分区.创建索引.锁表处理 1.表空间 ■ 详细查看表空间使用状况,包括总大小,使用空间,使用率,剩余空间 --详细查看表空 ...
 - Emmet使用之HTML
			
前言 前段时间在网上发现一个强大的好玩的东西,emmet,它可以方便我们前端开发者快速编写html和css.可以算是前端开发必备的一款利器,今天先总结一下用emmet写html,有时间再总结下css的 ...
 - 一些有意思的VR设备介绍
			
1.计算机(Computers) 不久以前,一个VR系统需要百万美元的超级计算机:而如今顶级的VR系统正在使用桌面便携式计算机簇,极大的降低了价格和维护成本. 2.跟踪器(Tracking) 为了能与 ...
 - Leetcode: Ones and Zeroes
			
In the computer world, use restricted resource you have to generate maximum benefit is what we alway ...
 - 易语言调用windows消息函数
			
1.SendMessageCallbackA的调用方法 .版本2 .DLL命令 发送消息返回_, 整数型, "user32.dll", "SendMessageCallb ...