1、HTML


<!--文档类型声明,html5统一为这样-->
<!DOCTYPE html> 
<html>  <!--所有内容都在html标签内-->
	<!--head一般放置不可见的标签,如标题、css定义、javascript定义(也可放置于尾部)、-->
	<!--meta信息(如页面编码、绽放比例、页面关键字等)-->
	<head>  
		<title>标题</title>
		<meta charset="UTF-8">
		<meta name="keywords" content="html,网页,网页结构">
		<meta name="description" content="这是一个示例">
	</head>
	<!--body里一般放置的都是可见标签-->
	<body> 
		<h1>H1标题</h1>
		<p>段落</p>
	</body>
</html>

<!DOCTYPE html>
<html lang="en">
	<head>
		<title>示例1的标题</title>
		<meta charset="utf-8"> 
		<!--1、这是一段典型的javascript,实现1秒钟修改一次div标签的背景颜色-->
		<script type="text/javascript">
			var colors = ["red","green","blue"];
			var index = 0;
			setInterval(function(){ document.getElementById("dvContent").style.backgroundColor = colors[(index++)%3]; }, 1000);
		</script>
		<!--如果是通用的功能或第三方插件,可通过以下方法引入到页面-->
		<!--<script src="js/thirdpart.js" type="text/javascript"></script>-->
		<!--2、这是一段典型的CSS定义-->
		<!--2.1、标签选择器-->
		<!--2.2、class选择器,需要在HTML标签设置class属性引入-->
		<style type="text/css">
			div{
				border:3px solid yellow
			}
			.content{
				width:200px;
				height:200px;
				margin:0 auto;
			}
		</style>
		<!--如果是通用的样式或第三方插件,可能过以下方法引入到页面-->
		<!--<link href="css/thirdpart.css" rel="stylesheet" type="text/css" />-->
	</head>
	<body style="text-align:center;">
		<h2>示例1</h2>
		<!--2.3、行内样式-->
		<div id="dvContent" class="content" style="background-color:blue;"></div>
	</body>
</html>

<!DOCTYPE html>
<!--文档类型声明,html5统一为这样-->
<html>
  <!--所有内容都在html标签内-->
  <head>
    <!--head常用标签-->
	<!--1.标题-->
    <title>我的第一个网页</title>
	<!--2.基础地址-->
	<!--<base href="http://www.baidu.com" target="_blank" />-->
	<!--3.meta-->
	<meta charset="utf-8"> 
	<meta name="keywords" content="第一个网页,html,HTML,SEO">
	<!--4.css-->
	<style type="text/css">
		.my-style{
		   color:red;
		}
	</style>	
	<link rel="stylesheet" type="text/css" href="xxx.css">
	<!--5.JavaScript-->
	<script type="text/javascript">
		var a =5;
	</script>
	<script type="text/javascript" src="xxx.js"></script>
  </head>
  <body bgColor="lightYellow"><!--还有background可以设置背景图片之类的,也可以使用后续学习的css设置-->
	  <h1>----------------块级标签----------------</h1>
	  <!--html页面内容的主要定义位置-->
	  <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=东北" /><!--x1:300,y1:10,x2:380,y2110的矩形-->
	    <area shape="circle" coords="260,250,60" alt="南方" target="_blank" href="http://www.baidu.com/s?wd=南方" /> <!--x:260,y:250为加以,60为半径的圆-->
	    <area shape="poly" coords="260,320,350,320,350,340,330,380" alt="南海" target="_blank" href="http://www.baidu.com/s?wd=南海" /><!--x1,y1,x2,y2,x3,y3的多边形-->
	  </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;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><br />
		span标签格式是:<span>&lt;span&gt;&lt;/span&gt;</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(){
			    //100秒后播放背景音乐,解决chrome中不能初始加载播放问题
				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);
				   //window.setTimeout(function(){
				   //      draw();
				   //},100);
			   };
			   
			   draw();
			   
			};
		</script>
	</body>
</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值