html5答题源码(html5基础题库)
本文目录一览:
- 1、急求html5网页及源代码,不要特别难,下面是作业,用记事本帮我写下源代码
- 2、找一点html5写的源代码案例,供初学者学习
- 3、求助!!HTML源代码!要求可以实现在线答题,且为多项选择题的源码!
急求html5网页及源代码,不要特别难,下面是作业,用记事本帮我写下源代码
html xmlns=""
head runat="server"
title/title
style type="text/css"
.divHead
{
background-color: #202020;
height: 40px;
width: 100%;
position: absolute;
overflow: hidden;
}
.ul {
color: white;
list-style: none;
height: 100%;
margin-left: 170px;
width: 40%;
float: left;
}
.ul1 {
color: white;
list-style: none;
height: 100%;
margin-left: 200px;
width: 20%;
float: left;
}
.ulli {
float: left;
padding-left: 10px;
padding-right: 10px;
display: block;
height: 100%;
margin-top: -16px;
padding-top: 10px;
}
.ulli:hover {
background-color: black;
}
.ul1li {
float: left;
padding-left: 10px;
padding-right: 10px;
display: block;
height: 100%;
margin-top: -16px;
padding-top: 10px;
}
.ullia
{
color: white;
text-decoration: none;
}
.ul1lia
{
color: white;
text-decoration: none;
}
.ul1li:hover {
background-color: black;
}
/style
/head
body
form id="form1" runat="server" style="overflow: hidden"
div id="divHead" class="b7a9-8c0f-c28f-f30a divHead"
ul class="8c0f-c28f-f30a-d879 ul"
li
a href="#"Note/a
/li
li
a href="#"首页/a
/li
li
a href="#"笔记/a
/li
li
a href="#"网站推荐/a
/li
/ul
ul class="c28f-f30a-d879-aaeb ul1"
li
a href="#"登录/a
/li
li
a href="#"退出/a
/li
/ul
/div
div id="divMain" style="height: 550px; width: 100%"
div style="height: 60%;background-color: #B89460;width: 100%"
div style="width: 10%;float: left"
/div
div style="width: 80%;float: left"
/div
div style="width: 10%;float: left"
/div
/div
div style="height: 40%;background-color: white;width: 100%"
div style="width: 80%;height: 100%;margin-left: 10%"
div style="width: 33%;height: 100%;float: left;text-align: center"
p style="font-size: 30px;font-weight: bold;"
前端技术br/a style="font-size: 17px;font-weight: normal"
hahahahhahhhahhah
/a
/p
input type="button" value="查看详情" /
/div
div style="width: 33%;height: 100%;float: left;text-align: center"
p style="font-size: 30px;font-weight: bold;"
前端技术br/a style="font-size: 17px;font-weight: normal"
hahahahhahhhahhah
/a
/p
input type="button" value="查看详情" /
/div
div style="width: 33%;height: 100%;float: left;text-align: center"
p style="font-size: 30px;font-weight: bold;"
前端技术br/a style="font-size: 17px;font-weight: normal"
hahahahhahhhahhah
/a
/p
input type="button" value="查看详情" /
/div
/div
/div
/div
div id="divFoot" style="background-color: #202020; height: 30px; width: 100%; text-align: center;
padding-top: 10px; color: white; font-size: 14px;"
@版权所有:大华明智软件
/div
/form
/body
/html
找一点html5写的源代码案例,供初学者学习
首先准备好11张图片,放到img文件夹下供调用
代码如下:
!DOCTYPE html
html
head
meta charset="UTF-8"
title/title
/head
body
p/p
img src="img/0.JPG" /
img src="img/0.JPG" /
img src="img/colon.JPG" /
img src="img/0.JPG" /
img src="img/0.JPG" /
img src="img/colon.JPG" /
img src="img/0.JPG" /
img src="img/0.JPG" /
script
//var oBody=document.body;
var oP=document.getElementsByTagName("p")[0];
var aImg=document.getElementsByTagName("img");
fn();
setInterval(fn,1000)
function fn(){
var mytime=new Date(); //当前的系统时间 年月日 时分秒 星期 对象
var iHour=mytime.getHours();//小时
var iMin=mytime.getMinutes();//分钟
var iSen=mytime.getSeconds() ;//秒钟
var str="";
//220640
str=toZero(iHour)+":"+toZero(iMin)+":"+toZero(iSen);
oP.innerHTML=str;
for(var i=0;iaImg.length;i++){
if(str.charAt(i)==":"){
aImg[i].src="img/colon.JPG";
}else{
aImg[i].src="img/"+str.charAt(i)+".JPG";
}
}
}
function toZero(n){
if(n10){
return n="0"+n;
}else{
return n=""+n;
}
}
/script
/body
/html
求助!!HTML源代码!要求可以实现在线答题,且为多项选择题的源码!
你说的多项选择题,我是不是可以理解成多选??
多选的实现是这样的:
第一: 必须将多选框放到form里面。
第二: 然后name属性完全一样,value不相同。这样当你提交到Action中的时候,只需要使用request对象获取toselect的值就行了。
第三: 获取值:request.getParameterValues("toselect"),就会将选中的多选框里面的value获取,并且返回一个String[]数组,这个数组里面就有你想要的值:即选中的值
html
body
form
input type = "checkbox" value = "A" name = "toselect"/A
input type = "checkbox" value = "B" name = "toselect"/B
input type = "checkbox" value = "C" name = "toselect"/C
input type = "checkbox" value = "D" name = "toselect"/D
/form
/body
/html