<!DOCTYPE html>
< html>
< head>
< title> 标题</ title>
< meta charset = " UTF-8" >
< meta name = " keywords" content = " html,网页,网页结构" >
< meta name = " description" content = " 这是一个示例" >
</ head>
< body>
< h1> H1标题</ h1>
< p> 段落</ p>
</ body>
</ html>
<!DOCTYPE html>
< html lang = " en" >
< head>
< title> 示例1的标题</ title>
< meta charset = " utf-8" >
< script type = " text/javascript" >
var colors = [ "red" , "green" , "blue" ] ;
var index = 0 ;
setInterval ( function ( ) { document. getElementById ( "dvContent" ) . style. backgroundColor = colors[ ( index++ ) % 3 ] ; } , 1000 ) ;
</ script>
< style type = " text/css" >
div {
border : 3px solid yellow
}
.content {
width : 200px;
height : 200px;
margin : 0 auto;
}
</ style>
</ head>
< body style =" text-align : center; " >
< h2> 示例1</ h2>
< div id = " dvContent" class = " content" style =" background-color : blue; " > </ div>
</ body>
</ html>
<!DOCTYPE html>
< html>
< head>
< title> 我的第一个网页</ title>
< meta charset = " utf-8" >
< meta name = " keywords" content = " 第一个网页,html,HTML,SEO" >
< style type = " text/css" >
.my-style {
color : red;
}
</ style>
< link rel = " stylesheet" type = " text/css" href = " xxx.css" >
< script type = " text/javascript" >
var a = 5 ;
</ script>
< script type = " text/javascript" src = " xxx.js" > </ script>
</ head>
< body bgColor = " lightYellow" >
< h1> ----------------块级标签----------------</ h1>
< h1> 如何学习Web前端(h1)</ h1>
< h4> html+css+javascript+vue(h4)</ h4>
< p> 要学习好Web前端,首先,要熟悉网络的基本原理,如Http请求等;其次,要熟悉基本的前端基础技术,包括HTML、CSS和Javascript;再次,要熟悉一种前端框架,如Vue、Angular;最后还要熟悉一些UI框架,如Element-UI、AntDesign等。(p)
</ p>
< div> 在HTML标签中,div标签使用较多,比如用来布局,用来做为浮层等。(div)</ div>
< div> 列表标签,显示列表数据或局部布局</ div>
< ul>
< li> 篮球</ li>
< li> 足球</ li>
< li> 乒乓球</ li>
</ ul>
< ol>
< li> 篮球</ li>
< li> 足球</ li>
< li> 乒乓球</ li>
</ ol>
< hr />
< h1> ----------------行级(内联)标签----------------</ h1>
< span> 想学相关课程?(span)</ span>
< span> 点击进入(span)</ span>
< a href = " https://lemon.ke.qq.com/" target = " _self" > 柠檬班课程</ a> ,
< span> 超链接的target属性值可以是:_self、_blank、_parent、_top或frame名字,由于比较少使用frame或frame集合,一般只用_self和_blank属性</ span>
< img src = " ./images/lemon.png" alt = " 柠檬班" width = " 40" height = " 40" />
< b> 粗体(b)</ b>
< i> 斜体(i)</ i>
< del> 删除线(del)</ del>
< ins> ins(ins)</ ins>
< sub> 下标(sub)</ sub>
< sup> 上标(sup)</ sup>
base地址图片< img src = " /img/PCtm_d9c8750bed0b3c7d089fa7d55720d6cf.png" alt = " 百度" />
< br />
<img src ="./images/china.png" alt="China" usemap ="#chinamap" />
< map name = " chinamap" >
< area shape = " rect" coords = " 300,10,380,110" alt = " 东北" target = " _blank" href = " http://www.baidu.com/s?wd=东北" />
< area shape = " circle" coords = " 260,250,60" alt = " 南方" target = " _blank" href = " http://www.baidu.com/s?wd=南方" />
< area shape = " poly" coords = " 260,320,350,320,350,340,330,380" alt = " 南海" target = " _blank" href = " http://www.baidu.com/s?wd=南海" />
</ map>
< br />
< a href = " mailto:contact@163.com" > 联系我们</ a>
< a href = " tel:13888888888" > 13888888888</ a>
< h1> ----------------表格标签----------------</ h1>
< table border = " 1" >
< caption> HTML标签常用属性(table,包括的子标签有tr、th、td、caption,常用属性colspan、rowspan)</ caption>
< tr>
< th> 属性</ th>
< th> 值</ th>
< th> 描述</ th>
</ tr>
< tbody style =" color : lightgreen; " >
< tr>
< td> id</ td>
< td>
< i> id(i)</ i>
</ td>
< td> 规定元素的唯一 id</ td>
</ tr>
< tr>
< td> name</ td>
< td>
name
</ td>
< td> 规定元素的名称</ td>
</ tr>
</ tbody>
< tbody style =" color : green; " >
< tr>
< td> style</ td>
< td>
style_definition
</ td>
< td> 规定元素的行内样式(inline style)</ td>
</ tr>
< tr>
< td> class</ td>
< td>
< i> classname</ i>
</ td>
< td> 规定元素的类名(classname)</ td>
</ tr>
< tr>
< td> colspan</ td>
< td colspan = " 2" > 跨列示例</ td>
</ tr>
< tr>
< td rowspan = " 2" > rowspan</ td>
< td> 跨行示例</ td>
< td> </ td>
</ tr>
< tr>
< td> 跨行示例</ td>
< td> </ td>
</ tr>
</ tbody>
< tfoot style =" font-weight : bold; " >
< tr>
< td> 汇总</ td>
< td> </ td>
< td> 35</ td>
</ tr>
</ tfoot>
</ table>
< h1> ----------------iframe简介----------------</ h1>
< p>
常用属性有
< ol>
< li> frameborder:设置边框</ li>
< li> loading:设置加载模式,auto为默认,使用浏览器行为;lazy为滚动条滚动到可视范围才加载;eager则为立即加载</ li>
< li> sandbox:为打开限制,可以不允许弹窗、不允许提交表单等< span style =" color : blue; " > 【扩展】</ span> </ li>
</ ol>
< span> 另外,还有frameSet和frame标签,有需要再学习使用< span style =" color : blue; " > 【扩展】</ span> </ span>
</ p>
< iframe name = " frmSub" frameborder = " 0" loading = " lazy" src = " sub.html" width = " 200" height = " 200" > </ iframe>
< p> < a href = " http://www.baidu.com" target = " frmSub" rel = " noopener noreferrer" > 跳转到百度</ a> </ p>
</ body>
</ html>
<!DOCTYPE html>
< html>
< head>
< title> 员工信息登记</ title>
</ head>
< body>
< form action = " api/employee/save" method = " POST" >
< table>
< caption> < b> 员工信息登记表</ b> </ caption>
< tr>
< td> 姓名</ td>
< td>
< input type = " text" id = " txtName" name = " name" placeholder = " 请输入姓名" />
</ td>
</ tr>
< tr>
< td> 年龄</ td>
< td>
< input id = " txtAge" name = " age" type = " number" min = " 0" value = " 18" />
</ td>
</ tr>
< tr>
< td> 性别</ td>
< td>
< input type = " radio" id = " rdoMale" value = " male" name = " sex" checked /> < label for = " rdoMale" > 男</ label>
< input type = " radio" id = " rdoFeMale" value = " female" name = " sex" /> < label for = " rdoFeMale" > 女</ label>
</ td>
</ tr>
< tr>
< td> 业余爱好</ td>
< td>
< input type = " checkbox" name = " hobby" value = " read" > 读书< br>
< input type = " checkbox" name = " hobby" value = " internet" > 上网< br>
< input type = " checkbox" name = " hobby" value = " movie" > 看电影< br>
< input type = " checkbox" name = " hobby" value = " other" > 其他< br>
</ td>
</ tr>
< tr>
< td> 所在部门</ td>
< td>
< select id = " sltDept" name = " dept" >
<option value ="technology">技术部</ option>
<option value ="finance">财务部</ option>
< option value = " employee" > 人事部</ option>
< option value = " other" > 其他</ option>
</ select>
</ td>
</ tr>
< tr>
< td> 照片</ td>
< td>
< input type = " file" id = " txtImage" name = " image" placeholder = " 请上传照片" />
</ td>
</ tr>
< tr>
< td> 自我评价</ td>
< td>
< textarea rows = " 3" id = " txtDesc" name = " desc" placeholder = " 请输入自我评价,如:我是一个乐观、开朗的人,也是一个脱离低级趣味的人。" > </ textarea>
</ td>
</ tr>
< tr>
< td colspan = " 2" align = " center" >
< input type = " submit" value = " 提交" >
< input type = " button" value = " 普通按钮" onclick = " alert(' hello' );" >
</ td>
</ tr>
</ table>
< h1> ------其他表单元素------</ h1>
< label for = " foods" > 喜欢的食物</ label>
< input type = " text" list = " foods" id = " txtFood" name = " foods" >
< datalist id = " foods" >
< option value = " 米饭" >
< option value = " 饺子" >
< option value = " 面包" >
< option value = " 包子" >
< option value = " 面条" >
</ datalist>
< progress id = " prgFileStatus" name = " fileStatus" max = " 100" value = " 70" > 70% </ progress>
</ form>
</ body>
</ html>
<!DOCTYPE html>
< html>
< head>
< title> 特殊字符的标题</ title>
< meta charset = " utf-8" >
</ head>
< body>
< h1> --特殊字符--</ h1>
代码空格:< span style =" background-color : red; " > </ span> < br />
字符空格:< span style =" background-color : red; " > </ span> < br />
span标签格式是:< span> < span> < /span> </ span> < br />
</ body>
</ html>
<!DOCTYPE html>
< html lang = " en" >
< head>
< title> 示例5的标题</ title>
</ head>
< body style =" text-align : center; " >
< h2> 示例5</ h2>
< div> ----------------canvas借鉴别人的,后续学习了JS可自己偿试-----------------</ div>
< canvas id = " canvas" width = " 200px" height = " 200px" style =" border : 1px solid #000; " > </ canvas>
</ canvas>
< div> ----------------audio----------------------</ div>
< button type = " button" value = " 按钮声音" onclick = " document.getElementById(' myAudio' ).play()" > 按钮声音</ button>
< audio id = " myAudio" src = " button.wav" > </ audio>
< audio id = " bgAudio" loop src = " background.wav" >
</ audio>
< div> ----------------表单元素----------------------</ div>
< form action = " demo" >
你的生日:< input type = " date" name = " bday" > < br />
你的邮箱:< input type = " email" name = " email" > < br />
你的年纪:< input type = " number" name = " quantity" min = " 18" max = " 100" >
你最爱的颜色:< input type = " color" name = " favcolor" >
< input type = " submit" >
</ form>
< script type = " text/javascript" >
function playBackgrounMusic ( ) {
var bgAudio = document. getElementById ( "bgAudio" ) ;
bgAudio. play ( ) ;
}
window. onload = function ( ) {
setInterval ( "playBackgrounMusic()" , 100 ) ;
var can= document. getElementById ( "canvas" ) ;
var cxt= can. getContext ( "2d" ) ;
var ball= {
x: 100 ,
y: 100 ,
vx: 4 ,
vy: 2 ,
radius: 20 ,
color: "blue" ,
draw: function ( ) {
cxt. beginPath ( ) ;
cxt. arc ( this . x, this . y, this . radius, 0 , Math. PI * 2 , true ) ;
cxt. closePath ( ) ;
cxt. fillStyle= this . color;
cxt. fill ( ) ;
}
} ;
var draw = function ( ) {
cxt. clearRect ( 0 , 0 , canvas. width, canvas. height) ;
ball. draw ( ) ;
ball. x+= ball. vx;
ball. y+= ball. vy;
if ( ball. vy+ ball. y> canvas. height- 15 || ball. vy+ ball. y< 15 ) {
ball. vy= - ball. vy;
}
if ( ball. vx+ ball. x> canvas. width- 15 || ball. vx+ ball. x< 15 ) {
ball. vx= - ball. vx;
}
window. requestAnimationFrame ( draw) ;
} ;
draw ( ) ;
} ;
</ script>
</ body>
</ html>