分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 教程案例

HTML

发布时间:2023-09-06 02:20责任编辑:赖小花关键词:HTML
自动刷新:
<metahttp-equiv="Refresh"content="1800;URL=
<?php
if($_SERVER[‘SERVER_NAME‘]=="sw.ciaic.com.cn"){
echo‘http://sw.ciaic.com.cn/index.php/Home/Index/index.html?‘.rand(0,1000);
}else{
echo‘index.html?‘.rand(0,1000);
}
?>"/>
手动刷新:
<script>function dlink(){document.location.href="soft.html";}</script>
<input type="button" value="点击刷新" />
//进度条
<styletype="text/css">
.progressbar{height:10px;background:#4e4e4e;border-radius:4px;width:20%;margin:0auto;}
.progress-bar{float:left;height:100%;line-height:20px;color:#fff;background:#dabb85;}
.progress-bar-danger{border-radius:4px;}
</style>
<div><divstyle="width:10%;"></div></div>
自动识别性别默认&&单选&&点击文字选中单选按钮
<td>
<input type="radio" name="sex" value="1" <?php if($val_user[‘sex‘]==1) echo "checked=checked;"?>/>
<label for="man"> 男</label>
<input type="radio" name="sex" value="2" <?php if($val_user[‘sex‘]== "2") echo "checked=checked;"?>/>
<label for="woman" > 女</label>
</td>
// <empty>
<emptyname="name">name为空<else/>name不为空</empty>
<notemptyname="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‘ />";} ?>
//发送邮件
<ahref="mailto:chenjunjun@zhishun.net?subject=邮件标题">chenjunjun@zhishun.net</a>
//触发手机端拨打电话状态
<a href="tel:15265960090">15265960090</a>
//触发手机端发送短信状态
<a href="sms:15265960090?body=">15265960090</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><span>{$page}</span></div>
//标题 关键词和描述
<title>{$pinfo.catname}-{$site.title}</title>
<linkrel="ShortcutIcon"href="__ROOT__/favicon.ico">
<linkrel="Bookmark"href="__ROOT__/favicon.ico">
<metaname="keywords"content="{$site.keywords}"/>
<metaname="description"content="{$site.description}"/>
正则匹配标题:<title>(.*)<\/title>
匹配a标签:<a[^>]+?href=\"([^\"]+)\"[^>]*>([^<]+)</a>
更多:http://blog.csdn.net/qq380107165/article/details/46523207
//定义文本的大小写状态,此属性对中文无意义
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在线聊天代码<atarget="_blank"href="http://wpa.qq.com/msgrd?v=3&uin=570848714&site=qq&menu=yes"></a>
<atarget="_blank"href="tencent://message/?570848714&site=wx.cntywhcm.com&menu=yes"></a>
旺旺在线聊天代码<ahref="http://www.taobao.com/webww/ww.php?ver=3&touid=旺旺&siteid=cntaobao&status=1&charset=utf-8"></a>
skype在线聊天代码<a href="/skype:mengsajewel?call" ><img src= http://mystatus.skype.com/smallclassic/mengsajewel style="border: none;" alt="Call me!" /></a>
腾讯微博代码<ahref="http://t.qq.com/yangwenjie-dream"target="_blank">腾讯微博</a>
新浪微博代码<ahref="http://weibo.com/p/1005051939278202/home?from=page_100505&amp;mod=TAB#_loginLayer_1420954610440"target="_blank">新浪微博</a>
微信公众平台代码<ahref="https://mp.weixin.qq.com/cgi-bin/loginpage?t=wxm2-login&amp;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内联地图
<iframesrc="{:U(‘Index/map‘)}"width="743"height="312"frameborder="0"scrolling="no"seamless></iframe>
//产品详情漂浮
.dingweisss{height:50px;background:#e4e4e4;margin:15px0;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 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>
我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved