余温博客

笨人的可怕处并不在其笨
而在其自作聪明

好玩的网页代码

大家有不会改的地方直接私聊我就好了

ps:用电脑预览的效果会好一些

<html>

<head> 

<meta charset="utf-8">

<title>余温博客</title>

<style type="text/css">

@charset "utf-8";



* {

margin: 0;

padding: 0;

outline: none;

}



#content {

width: 500px;

height: 300px;

position: relative;

border: 2px solid #333;

margin: 100px auto

}



h1 {

text-align: center;

position: relative;

top: 30px;

color: #333

}



input[type="button"] {

width: 120px;

height: 40px;

border: 2px solid #333;

background: #bb7450;

font-size: 14px;

color: #fff

}



#line {

border: 1px solid #000;

margin-top: 100px;

}



#By {

    position: absolute;

    top: 190px;

    left: 100px;

}



#Bn{

    position: absolute;

    top: 190px;

    left: 300px;

}

#text {

text-align: center;

position: relative;

top: 135px

}

</style>

</head>

<body>

<div id="content">

<h1>你是猪吗?</h1>

<div id="line"></div>

<div id="text"></div>

<div id="By">

<input type="button" value=" 是的 " onclick="f1()" />

</div>

<div id="Bn">

<input type="button" value="  不是  " onmouseover="f()" />

</div>

</div>





<script type="text/javascript">

var flag=1;

function f1()

{

document.getElementById("text").innerHTML="哈哈,我知道了~";

}

function f()

{

if(flag==1)

{

Bn.style.top='90px';

flag=2;

}

else if(flag==2)

{

Bn.style.top='90px';

Bn.style.left='50px';

flag=3;

}

else if(flag==3)

{

Bn.style.top='190px';

Bn.style.left='300px';

flag=1;

}

}

</script>

</head>

</body>

</html>
forum(1).jpg

执行代码结果图


感谢您的支持,我们会一直保持!

扫码支持
请土豪扫码随意打赏

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

打赏作者
版权所有,转载注意明处:余温博客|一个小男孩的梦 好玩的网页代码
标签: 代码
分享本文至:

版权所有:《余温博客|一个小男孩的梦
文章标题:《好玩的网页代码
除非注明,文章均为 《余温博客|一个小男孩的梦》 原创
转载请注明本文短网址:http://fengyijia.cn/?post=133  [生成短网址]

发表评论

表情

网友评论(0)

sitemap