CSS 代码格式化工具
2008-05-25 01:23
218 查看
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> CSS 代码格式化工具 </title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">...
a {...}{color:blue; font-size:12px}
textarea {...}{width:100%; height:300px; display:block; margin:10px 0; font-size:12px}
input {...}{font-size:12px}
</style>
<script type="text/javascript">...
<!--
function formatCSS(n)...{
var c = document.getElementById("abc");
var d = document.getElementById("def");
var v = c.value;
if (n==1)...{
d.value = v.replace(/ /g,"").replace(/}/g,"} ").replace(/*//g,"*/ ");
}
if (n==2)...{
d.value = v.replace(/ /g,"").replace(/}/g,"} ").replace(/s*;s*/g,";").replace(/;/g,"; ").replace(/...{/g,"{ ").replace(/}/g," }").replace(/*//g,"*/ ");
}
if (n==3)...{
c.value = d.value = "";
}
}
//-->
</script>
</head>
<body onload="document.getElementById('abc').focus()">
<h1>CSS 代码格式化工具</h1>
<textarea id="abc" cols=150 rows=20 wrap="off" title="在这里输入CSS代码"></textarea>
<input type="button" value=" 横排 " onclick="formatCSS(1)" />
<input type="button" value=" 竖排 " onclick="formatCSS(2)" />
<input type="button" value=" 清空 " onclick="formatCSS(3)" />
<textarea id="def" cols=150 rows=20 wrap="off" title="这里将输出CSS代码"></textarea>
<a href="http://www.happyshow.org" target="_blank">happyshow.org</a>
</body>
</html>
相关文章推荐
- HTML/CSS/Javascript代码在线压缩、格式化(美化)工具
- HTML/CSS/Javascript代码在线压缩、格式化(美化)工具
- 10 款非常棒的CSS代码格式化工具推荐
- 【代码美化】CSS代码格式化和JS代码格式化工具
- 非常好用的css代码格式化工具
- HTML/CSS/Javascript代码在线压缩、格式化(美化)工具
- 11 种 CSS 代码优化和格式化的工具[转]
- [原创]CSS代码格式化和加密化小工具
- HTML/CSS/Javascript代码在线压缩、格式化(美化)工具
- 10 款非常棒的CSS代码格式化工具推荐
- HTML/CSS/Javascript/json代码在线压缩&格式化常用工具
- CSS 代码格式化工具
- HTML/CSS/Javascript代码在线压缩、格式化(美化)工具
- CSS代码格式化工具
- HTML/CSS/Javascript代码在线压缩、格式化(美化)工具
- CSS代码格式化和JS代码格式化工具
- HTML/CSS/Javascript代码在线压缩、格式化(美化)工具
- HTML/CSS/Javascript代码在线压缩、格式化(美化)工具
- css 10 款非常棒的CSS代码格式化工具推荐
- HTML/CSS/Javascript代码在线压缩、格式化(美化)工具