html国外经典案例代码(html 案例)
华为云服务器特价优惠火热进行中! 2核2G2兆仅需 38 元;4核4G3兆仅需 79 元。购买时间越长越优惠!更多配置及优惠价格请咨询客服。
合作流程: |
今天给各位分享html国外经典案例代码的知识,其中也会对html 案例进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!
微信号:cloud7591如需了解更多,欢迎添加客服微信咨询。
复制微信号
本文目录一览:
- 1、实例教程:HTML中会移动的文字
- 2、HTML5怎么做导航栏
- 3、html中逐字显示字怎么写代码?举个简单的例子。
- 4、求一个简单的个人网页html模板
- 5、html如何点击按钮跳转页面,并且更改跳转过后页面中某些标签的样式 求类似的案例代码 急
- 6、ASP网页程序设计中10个非常有用的实例代码
实例教程:HTML中会移动的文字
我们在浏览页面的时候,会看到在页面上移动的文字,文字的移动方向有从左到右、从右到左、从上到下、从下到上等。下面,我们来看看如何使用HTML代码编写会移动的文字吧。
工具/材料
HTML
01
语法代码
(1)一般使用marquee/marquee来设置移动文字,比如我们编写如下代码:
(2)marquee会移动的文字/marquee
预览效果可以发现编写在marquee/marquee标签内的文字,会从右边到左边循环移动,如下图所示:
02
文字移动速度
(1)使用scrollamount来设置文字的移动速度,比如我们编写如下所示代码:
marquee scrollamount=16快点,快点/marquee
marquee scrollamount=12等等我/marquee
(2)预览效果
可以看到scrollamount的数值越大,移动的速度就会越快,如下图所示:
03
设置文字移动的方向
(1)direction在英文上是方向的意思,同样使用direction来设置文字的移动方向,方向可以设置为左、右、上、下等等,编写如下代码:
marquee direction=left文字从右边向左边/marquee P
marquee direction=right从左边向右边移/marquee
(2)预览效果
可以看到当direction=left时,文字从右边向左边,当direction=right时,文字从左边向右边,如下图所示:
04
文字循环的次数
(1)一般来说文字是默认无限次循环的,下面,我们来看看如何指定文字的循环次数吧。使用loop来设置文字的循环次数,比如编写代码如下:
marquee loop=3 文字只会循环三次/marquee
(2)预览效果
可以在浏览器上看到,文字只会循环三次,如下图所示:
05
文字对齐
在HTML中的文字对齐功能,使用align属性来设置,属性值可以为top、Middle、button,比如我们编写如下所示的代码:
(2)预览效果
然后在浏览器中预览效果,可以看到文字向上对齐,如下图所示:
06
移动面积
(1)设置会移动的文字范围,比如文字在长为多少,宽为多少的区域内移动,比如我们编写如下代码:
marquee height=40 width=50% bgcolor=pink在区域内移动的文字/marquee
(2)预览效果
在浏览器中可以看到文字在高为40,宽为浏览器一半的区域内移动,且区域的颜色为粉红色,如下图所示:
07
延时
(1)设置文字的运行速度,让文字可以时而快,时而慢地做运动,编写代码如下所示:
(2)预览效果
在浏览器中预览效果,可以看到文字先做快速度,然后做慢速度,如下图所示:

HTML5怎么做导航栏
建议使用FF,Safari,举个例子:
!doctype html
html
head
titleHTML5+CSS3+JavaScript/title
meta http-equiv="Content-Type" content="text/html; charset=gb2312" /
meta http-equiv="Content-Type" content="text/html; charset=gbk" /
meta http-equiv="Content-Type" content="text/html; charset=utf-8" /
meta http-equiv="Content-Language" content="zh-cn" /
meta name="Generator" content="EditPlus"
meta name="Author" content=""
meta name="Keywords" content=""
style type="text/css"
body {
behavior: url(ie-css3.htc);
}
* {margin:0 auto;padding:0;}
body {font-size:13px;font-family:Arial;}
ul li {list-style:none;}
#menu {
width:982px;
height:35px;
margin-top:20px;display:block;
background: #e3e3e3;
background: -moz-linear-gradient(top, #ccc, #999);
background: -webkit-gradient(linear, left top, left bottom, from(#ccc), to(#999));
-moz-box-shadow: 1px 1px 3px #333;
-webkit-box-shadow: 1px 1px 3px #333;
box-shadow: 1px 1px 3px #333;
-webkit-border-top-left-radius:4px;;
-webkit-border-top-right-radius:4px;
-moz-border-radius-topleft:4px;
-moz-border-radius-topright:4px;
-webkit-border-bottom-left-radius:4px;
-webkit-border-bottom-right-radius:4px;
-moz-border-radius-bottomleft:4px;
-moz-border-radius-bottomright:4px;
-o-border-radius:4px;
-khtml-border-radius:4px;
text-shadow: 0 1px 0 white;
}
#menu ul {
margin-left:0;
}
#menu ul li {
display:inline;
}
#menu ul li a:link, a:visited {
text-align:center;float:left;width:6.8em;text-decoration:none;padding:7.5px 0.75em;font-size:16px;font-weight:bold;margin-top:0px;border-right:1px solid #ccc;color: #454545;
}
#menu ul li a:hover {
text-decoration:none;
background:-webkit-gradient(linear, left top, left bottom, from(#333), to(#ccc));
background: -moz-linear-gradient(top, #333, #ccc);
-webkit-background-size:0 35px;
color: #ddd;
text-shadow: 0 1px 0 black;
}
.text {
border:1px solid gray;width:150px;height:17px;position:relative;top:8px;left:13px;font-family:Arial;
-webkit-border-top-left-radius:90px;;
-webkit-border-top-right-radius:90px;
-moz-border-radius-topleft:90px;
-moz-border-radius-topright:90px;
-webkit-border-bottom-left-radius:90px;
-webkit-border-bottom-right-radius:90px;
-moz-border-radius-bottomleft:90px;
-moz-border-radius-bottomright:90px;
-o-border-radius:90px;
-khtml-border-radius:90px;
}
/style
script language="JavaScript" type="text/javascript"
(function()
{
if(!0)
return;
var e = "abbr,article,aside,audio,bb,canvas,datagrid,datalist,details,dialog, eventsource,figure,footer,hgroup,header,mark,menu,meter,nav,output,progress,section,time,video".split(','),i=0,length=e.length;
while(ilength)
{
document.createElement_x(e[i++])
}
})();
/script
/head
body
menu id="menu"form action="index.php" method="get"
ul
lia href="#" title="HomePage"HomePage/a/li
lia href="#" title="Introuduce"Introuduce/a/li
lia href="#" title="Products"Products/a/li
lia href="#" title="My album"My album/a/li
lia href="#" title="Shopping"Shopping/a/li
lia href="#" title="Contact our"Contact our/a/li
/ul
input type="search" class="text" value="search..." //form
/menu
body
html中逐字显示字怎么写代码?举个简单的例子。
第一步:请修改BODY:
BODY onload=init()
第二步:将以下代码加入HEML的BODY/BODY之间
script language=javascript
var layers =document.layers,style=document.all,both=layers||style,idme=908601;
if(layers){layerRef='document.layers';styleRef ='';}if(style){layerRef='document.all';styleRef = br/'.style';}
function writeOnText(obj,str){
if(layers)with(document[obj]){ document.open();document.write(str);document.close();}
if(style)eval(obj+'.innerHTML=str'); }
var dispStr=new Array("打字效果代码");//这里面的就是内容文字
var overMe=0;
function txtTyper(str,idx,idObj,spObj,clr1,clr2,delay,plysnd){
var tmp0=tmp1= '',skip=100;
if (both idx=str.length) {
if (str.charAt(idx)==''){ while(str.charAt(idx)!='') idx++;idx++;}
if (str.charAt(idx)==''str.charAt(idx+1)!=' '){ while (str.charAt(idx)!= ';')idx++;idx++;}
tmp0 = str.slice(0,idx);
tmp1 = str.charAt(idx++);
if (overMe==0 plysnd==1){
if (navigator.plugins[0]){
if(navigator.plugins["LiveAudio"][0].type=="audio/basic" navigator.javaEnabled()){document.embedsbr/[0].stop();br/setTimeout("document.embeds[0].play(false)",100);}
} else if (document.all){
ding.Stop();
setTimeout("ding.Run()",100);}
overMe=1;}else overMe=0;
writeOnText(idObj, "span class="+spObj+"font color='"+clr1+"'"+tmp0+"/fontfont color='"+clr2
+"'"+tmp1+"/font/span");
setTimeout("txtTyper('"+str+"', "+idx+", '"+idObj+"', '"+spObj+"', '"+clr1+"', '"+clr2+"', "+delay+" ,"+plysnd+")",delay);}}
function init(){txtTyper(dispStr[0], 0, 'ttl0', 'ttl1', '#339933', '#99FF33', 300, 0);}
/script
DIV class=ttl1 id=ttl0/DIV
求一个简单的个人网页html模板
这种模板很多的,百度打开一个网页右键源代码就能找到了。
html xmlns=""headmeta http-equiv="Content-Type" content="text/html; charset=gb2312"
meta name="viewport" id="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1"
meta name="apple-mobile-web-app-capable" content="yes"
meta name="apple-mobile-web-app-status-bar-style" content="black"
link href="{dede:global.cfg_templets_skin/}/images/apple-touch-icon-57.png" sizes="57x57" rel="apple-touch-icon"
link href="{dede:global.cfg_templets_skin/}/images/apple-touch-icon-72.png" sizes="72x72" rel="apple-touch-icon"
link href="{dede:global.cfg_templets_skin/}/images/apple-touch-icon-114.png" sizes="114x114" rel="apple-touch-icon"
title{dede:global.cfg_webname/}/title
meta name="keywords" content="{dede:global.cfg_keywords/}"
meta name="description" content="{dede:global.cfg_description/}"
link href="{dede:global.cfg_templets_skin/}/style/style.css" rel="stylesheet" type="text/css"
script type="text/javascript" src="{dede:global.cfg_templets_skin/}/style/jquery-1.9.1.js"/script
script type="text/javascript" src="{dede:global.cfg_templets_skin/}/style/theme_trust.js"/script
style type="text/css"
html,
body {
margin: 0;
padding: 0;
}
.iw_poi_title {
color: #CC5522;
font-size: 14px;
font-weight: bold;
overflow: hidden;
padding-right: 13px;
white-space: nowrap
}
.iw_poi_content {
font: 12px arial, sans-serif;
overflow: visible;
padding-top: 4px;
white-space: -moz-pre-wrap;
word-wrap: break-word
}
/style
script type="text/javascript" src="{dede:global.cfg_templets_skin/}/main.js"/script
script
jQuery(document).ready(function() {
jQuery('#openSidebar').click(function() {
jQuery('.wrapper').toggleClass('openNav');
});
jQuery('#menu a').click(function() {
jQuery('.wrapper').removeClass('openNav');
});
});
/script
script type="text/javascript" src="{dede:global.cfg_templets_skin/}/api"/scriptscript type="text/javascript" src="{dede:global.cfg_templets_skin/}/getscript"/scriptlink rel="stylesheet" type="text/css" href="{dede:global.cfg_templets_skin/}/bmap.css"
style type="text/css"
html,
body,
wrapper {
height: 100%;
}
/style
/head
body
div class="wrapper"
div class="sidebar"
div class="clearfix k1120"
div class="navBox" id="openSidebar"
a href="javascript:void(0)" class="navOpen"/a
/div
div id="menu"
ul class="clearfix"
lia href="#home" class="nav_home current"span首页br /bHome/b/span/a
/li
lia href="#services" class="nav_services"span服务范围br /bServices/b/span/a
/li
lia href="#case" class="nav_case"span案例展示br /bCase/b/span/a
/li
lia href="#about" class="nav_about"span关于我们br /bAbout us/b/span/a
/li
lia href="#news" class="nav_news"span新闻动态br /bNews/b/span/a
/li
lia href="#contact" class="nav_contact"span联系我们br /bContact us/b/span/a
/li
/ul
/div
/div
/div
div class="pageMain"
div id="header"
div class="k1120 clearfix"a href="{dede:global.cfg_basehost/}" id="logo"logo/a
/div
/div
div id="home" class="scrol-page"
div class="banner"
div class="b_1" style="background-position: 50% 0px;"
div class="k1120 clearfix"
div class="b_pic"
div class="mac" style="margin-top: 0px; opacity: 1;"img src="{dede:global.cfg_templets_skin/}/images/mac.png"
/div
div class="iphone" style="margin-top: 0px; opacity: 1;"img src="{dede:global.cfg_templets_skin/}/images/iphone.png"
/div
div class="ipad" style="margin-top: 0px; opacity: 1;"img src="{dede:global.cfg_templets_skin/}/images/ipad.png"
/div
/div
div class="b_text" style="margin-top: 0px; opacity: 1;"
{dede:global.cfg_ggg/}
/div
/div
/div
/div
div class="banner"
html如何点击按钮跳转页面,并且更改跳转过后页面中某些标签的样式 求类似的案例代码 急
跳转好实现
input type="button" value="点此跳转" onclick="goUrl()"/
script type="text/javascript"
function goUrl() {
location.href = "";
}
/script
但是你想要直接更改跳转之后的页面样式,那样是行不通的,比如,你从A页面跳转到B页面,这时候浏览器已经重新加载成B页面了,所以A页面里的JS已不存在。
变通办法,跳转时加个参数,比如B.jsp?ischange=1,然后在B页面里根据是否传了这参数来决定更改某些标签的样式
ASP网页程序设计中10个非常有用的实例代码
ASP网页程序设计中10个非常有用的实例代码
ASP可以与Web数据库以及其它程序进行交互,是一种简单、方便的编程工具。下面由我带来ASP网页程序设计中10个非常有用的实例代码。
1.如何用Asp判断你的网站的.虚拟物理路径
答:使用Mappath方法: %= Server.MapPath("\")%
2.我如何知道使用者所用的浏览器
答:使用the Request object方法:
3.如何计算每天的平均反复访问人数
答:解决方法
% startdate=DateDiff("d",Now,"01/01/1990")
if strdate 0 then startdate=startdate*-1
avgvpd=Int((usercnt)/startdate) %
显示结果
% response.write(avgvpd) %
that is it.this page have been viewed since November 10,1998
4.如何显示随机图象
% dim p,ppic,dpic
ppic=12
randomize
p=Int((ppic*rnd)+1)
dpic="graphix/randompics/"p".gif"
%
显示
img src=" %=dpic% "
5.如何回到先前的页面
答: a href=" %=request.serverVariables("Http_REFERER")% " preivous page /a
或用图片如: img src="arrowback.gif" alt=" %=request.serverVariables("HTTP_REFERER")% "
6.如何确定对方的IP地址
答: %=Request.serverVariables("REMOTE_ADDR)%
7.如何链结到一副图片上
答: % @Languages=vbscript %
% response.expires=0
strimagename="graphix/errors/erroriamge.gif"
response.redirect(strimagename)
%
8.强迫输入密码对话框
答:把这句话放载页面的开头
% response.status="401 not Authorized"
response.end
%
9.如何传递变量从一页到另一页
答:用 HIDDEN 类型来传递变量
% for each item in request.form %
input namee=" %=item% " type="HIDDEN"
value=" %=server.HTMLEncode(Request.form(item)) % "
% next %
/form
10.怎样才能使得htm文件如同asp文件一样可以执行脚本代码
答:Internet Sevices Manager - 选择default web site - 右鼠键- 菜单属性-〉主目录- 应用程序设置(Application Setting)- 点击按钮 "配置"- app mapping - 点击按钮"Add" - executable browse选择 \WINNT\SYSTEM32\INETSRV\ASP.DLL EXTENSION 输入 htm method exclusions 输入PUT.DELETE 全部确定即可。但是值得注意的是这样对htm也要由asp.dll处理,效率将降低。
;
html国外经典案例代码的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于html 案例、html国外经典案例代码的信息别忘了在本站进行查找喔。
