HTML
自动刷新:
<meta http-equiv="Refresh" content="1800;URL=
<?php
if($_SERVER[ 'SERVER_NAME' ]=="sw.ciaic.com.cn"){
}else{
echo 'index.html?'.rand(0,1000);
}
?>" />
手动刷新:
<script> function dlink(){ document.location.href="soft.html"; }</script>
<input type="button" onclick="dlink()" value="点击刷新" />
//进度条
<style type="text/css">
.progressbar{height:10px;background:#4e4e4e;border-radius:4px;width:20%;margin:0 auto;margin-top:25%;}
.progress-bar{float:left;height:100%;line-height:20px;color:#fff;background:#dabb85;}
.progress-bar-danger{border-radius:4px;}
</style>
<div class="progressbar"><div class="progress-bar progress-bar-danger" style="width: 10%;"></div></div>
自动识别性别默认&&单选&&点击文字选中单选按钮
<td>
<input type="radio" name="sex" value="1" id="man" <?php if($val_user['sex']==1) echo "checked=checked;"?>/>
<label for="man"> 男</label>
<input type="radio" name="sex" value="2" id="woman" <?php if($val_user['sex']== "2") echo "checked=checked;"?>/>
<label for="woman" > 女</label>
</td>
// <empty>
<empty name="name">name为空<else /> name不为空</empty>
<notempty name="name">name不为空</notempty>
//循环
<volist name='list' id='val' key='k' ></volist>
<foreach name="list" item="val" ></volist>
//当前时间和添加文章时间比对,显示最新和不显示
<?php if(time()-5*24*60*60<=strtotime($list['inputtime'])){echo "<img src='__PUBLIC__/Home/images/new.gif' border='0' />";} ?>
//发送邮件
<a href="mailto:mail@qq.com?subject=邮件标题">mail@qq.com</a>
//触发手机端拨打电话状态
<a href="tel:手机号码或电话号码">手机号码或电话号码</a>
//触发手机端发送短信状态
<a href="sms:手机号码或电话号码?body=">手机号码或电话号码</a>
//marquee首尾相连循环滚动效果
<marquee behavior="scroll" contenteditable="true" onstart="this.firstChild.innerHTML+=this.firstChild.innerHTML;" scrollamount="3" width="100" onmouseover="this.stop();" onmouseout="this.start();">
这里是要滚动的内容
</marquee>
//分页样式
<style type="text/css" >
.manu{padding:3px;margin:3px;text-align:center; font-size:14px;}
.manu a{border:#eee 1px solid;padding:2px 5px;margin:2px;color:#036cb4;text-decoration:none;}
.manu a:hover{border:#999 1px solid;color:#666;}
.manu a:active{border:#999 1px solid;color:#666;}
.manu .current{border:#036cb4 1px solid;padding:2px 5px;font-weight:bold;margin:2px;color:#fff;background-color:#036cb4;}
.manu .disabled {color: #ddd;margin: 2px;padding: 2px 5px;}
</style>
<div class="manu"><span class="disabled" >{$page}</span></div>
//标题 关键词和描述
<title> {$pinfo.catname}-{$site.title}</title>
<link rel="Shortcut Icon" href="__ROOT__/favicon.ico">
<link rel="Bookmark" href="__ROOT__/favicon.ico">
<meta name="keywords" content="{$site.keywords}" />
<meta name="description" content="{$site.description}" />
正则匹配标题:<title>(.*)<\/title>
匹配a标签:<a[^>]+?href=\"([^\"]+)\"[^>]*>([^<]+)</a>
//定义文本的大小写状态,此属性对中文无意义
text-transform 取值:capitalize | uppercase | lowercase | none | inherit
capitalize: 首字母大写
uppercase: 大写
lowercase: 小写
none: 正常无变化(默认)
inherit: 继承
//在线沟通链接
MSN在线聊天代码 <a href="msnim:chat?contact=xie_wansong@hotmail.com" target=blank>点这里和我MSN聊天</a>
QQ在线聊天代码<a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=QQ号码&site=qq&menu=yes"></a>
<a target="_blank" href="tencent://message/?570848714&site=wx.cntywhcm.com&menu=yes"></a>
旺旺在线聊天代码<a href="http://www.taobao.com/webww/ww.php?ver=3&touid=旺旺&siteid=cntaobao&status=1&charset=utf-8"></a>
skype在线聊天代码<a href="/skype:mengsajewel?call" onclick="return skypeCheck();"><img src= http://mystatus.skype.com/smallclassic/mengsajewel style="border: none;" alt="Call me!" /></a>
新浪微博代码<a href="http://weibo.com/p/1005051939278202/home?from=page_100505&mod=TAB#_loginLayer_1420954610440" target="_blank">新浪微博</a>
微信公众平台代码<a href="https://mp.weixin.qq.com/cgi-bin/loginpage?t=wxm2-login&lang=zh_CN" target="_blank">微信公众平台</a>
//页面上的所有链接规定默认地址或默认目标
<base href="http://www.alonesky.com/" />
<base target="_blank" />
<!-- 强制让http的访问https -->
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" />
//iframe内联地图
<iframe src="{:U('Index/map')}" width="743" height="312" frameborder="0" scrolling="no" seamless></iframe>
//产品详情漂浮
.dingweisss{ height:50px; background:#e4e4e4;margin:15px 0;position: fixed;top:0;width: 100%;z-index:1}
$(window).scroll(function(){
if($(this).scrollTop() > 925){
$(".proinfo-eq").addClass("dingweisss");
} else{
$(".proinfo-eq").removeClass("dingweisss");
}
});
//文本框不可重设大小(css)
textarea{ resize:none;}
//鼠标经过和离开时图片
<img onmouseout="this.src='1.jpg'" onmouseover="this.src='2.jpg'" src="1.jpg">
//超出隐藏:overflow: hidden|visible;
//禁止用户选择:
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
//文字超出处理:text-overflow: ellipsis |clip; ellipsis 省略号,clip 直接剪去
//一行排列:white-space: nowrap;
//等比例缩放
<a style="width:100px; height:auto; "></a>
background-color: rgb(30, 178, 225);
/*选中时背景颜色及文字颜色*/
*::-moz-selection { color: #c00; background: #fff;}
//渐变
background: linear-gradient(45deg, #1F221F 0%,#0CA818 100%);
//form 表单自动填充:autocomplete="off"
//html5属性
<!doctype html>
<html lang="en">
<head>
<title>html5</title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
</head>
<body onload="drawSquare()">
<canvas id="square" width="60" height="60">我是画布</canvas>
<section>
<header><h1>Tihs Is Title</h1></header>
<nav>
<ul>
<li><a href="">Tihs Is Nav1</a></li>
<li><a href="">Tihs Is Nav2</a></li>
</ul>
</nav>
<section>
<section>
<form action="">
<input type="color" />颜色<br>
<input type="date"/>日期<br>
<input type="datetime"/><br>
<input type="email" /><br>
<input type="month" /><br>
<input type="number" /><br>
<input type="search" /><br>
<input type="time" /><br>
<input type="range" /><br>
<input type="tel" /><br>
<input type="url" /><br>
<input type="week" /><br>
</form>
</section>
<p>自适应</p>
</section>
</section>
<footer>
Tihs Is footer
</footer>
<script type="text/javascript">
function drawSquare () {
var canvas=document.getElementById('square')
if (canvas.getContext) {
var content=canvas.getContext('2d');
content.fillStyle="rgb(13,114,208)";
content.fillRect(15,15,30,30);
}else{
alert("biubiubiu");
}
}
</script>
</body>
</html>