HTML基础

一、标签

1、单标签

		<meta  charset = "utf-8"><input />

2、双标签

		<html>   </html><body>  </body>    //头部为文档控制信息
		
		<title>  </title><head>   <head><h1>  <h1>
	
		<p>   <p>

3、结构

<html>

				<head>
					
                    	<title>标题</title>
                    	<meta charset ="utf-8">
                    
                </head><body><h1>    一级标题 </h1><p>段落</p></body></html>			

4、水平线标签


							<hr  />

5、换行标签

<br />

6、文字字体和大小设置

span字体设置

//行内元素
<span  style ="color:red;  font-size:30px; background-color:yellow">  字体设置 </span>
Div字体设置
//块元素
<div  style ="color:red; background-color:yellow">Div字体设置</div>

7、超链接标签

百度首页

one网页

			<a  href="www.baidu.com " target="_blank"> 百度首页 </a>
					<!--  href后面为绝对路径  target的作用为在新的标签中打开  -->

			<a  href="./one.html" target="_blank">one网页</a>
					<!--  href后面为相对路径为本地的文件路径   target作用在新窗口打开 -->

8、图片标签

在这里插入图片描述

图片来源于网络,如果侵权请联系及时删除

		<img src="E:\壁纸\324321.jpg" style="zoom: 25%;" ></img>
			
			<!-- style="zoom:25%;"表示缩放比例为25%-->

9、HTML字体实体

在这里插入图片描述

10、HTML表格

<table></table>  <!-- 定义表格--><tr></tr> <!--定义行--><td></td><!--定义列-->

​		rowspan="2"  <!--跨两行-->

实例:
在这里插入图片描述

	<html>
	
	<head>
		<meta charset="utf-8">
		<h1>Grade Table<h1>
	</head>
		<body>
		<table  border="1">   <!--  设置表格边框宽度 border值任意,如果不写是看不见的  -->
            <tr>
		    <td rowspan="2">MONKEY</td>  <!--为两行大小-->
            <td>语文</td>
            <td>99</td>
            </tr>
            <tr>
            <td>数学</td>
            <td>110</td>
            </tr>
		</table>
    </body>
</html>

二、HTML表单

1、表单介绍

<form></form>
	<!-- action 数据提交到服务器的URL,如果为空提交当前页面,可以是相对路径也可以是绝对路径
		
		 method 提交方法
				get 
					url 中有显示
					URL 长度有限制
				post
					上传文件
					file文件域可以上传文件
					hidden 隐藏内容
		enctype
				application/x-www-form-urlencoded  默认值
				multipart/form-data 上传文件时的值
		-->

2、实例介绍(包含文本框、单选按钮、单选框、下拉菜单、文本域、文件上传、隐藏项)

在这里插入图片描述

<html>

	<head>
		
		<title> 表单</title>
		<meta charset="utf-8">
		
	</head>

	<body>
		
		<h1>用户注册页面<h1>
		<form  action="#"  method="post" enctype="multipart/form-data">
		
		用户名:<input name="user"  type="text" />  <br/>
		<!-- text 明文模式 -->
		密码:<input name ="password"  type = "password" /> <br/>
		确认密码:<input  name ="passwordSure" type = "password" /> <br/>
		<!-- password 密码模式 -->
		性别:<input name = "sex" value = "1" type = "radio" > 男
				<!-- radio 单选按钮-->
			  <input name = "sex"  value = "0" type = "radio">女 <br/>
		<!-- value为传送的服务器的变量值 sex = 1/0 -->
		<!-- 爱好 -->
			<!-- checkbox选项框,可以多选 -->
		爱好:<input name = "hobby1" value = "eat" type = "checkbox"> 吃饭
			<input name = "hobby2" value = "sleep" type = "checkbox"> 睡觉
			<input name = "hobby3" value = "Game" type = "checkbox"> 游戏 <br/>
		出生年月日:
					<!--Year-->       <!--设置下拉菜单-->
					<select name = "year" >
						<option value = "0" selected = "selected">选择年份
						<option value = "1" >2020</option>
						<option value = "2" >2021</option>
					</select>
					<!--Month-->
					<select name = "month" >
						<option value = "0" selected = "selected">选择月份
						<option value = "1" >1</option>
						<option value = "2" >2</option>
					</select>
					<!--Days-->
					<input type = "text" name="day" size ="2" > 日<br/>
			文件上传:
				<input type ="file" /><br/>
			附件内容:
				<!-- 文本域 -->
				<textarea name="other" > </textarea> <br/>
			<!-- 隐藏项 -->
			<input name="token" type ="hidden" value="jsdlkfjl"><br/>
			<!--重置与提交-->
			<input type="reset">
			<input type="submit" name = "submit" value = "提交" >
			
		</form>
	</body>
</html>

三、HTML CSS

1、CSS介绍

  ①、元素内容的颜色 color

​  ②、元素内容的背景色 background-color

​  ③、字体大小 font-size

2、CSS与HTML结合的方式

1)内联样式

内联样式字体
	<span style = "color:red ; background-color:yellow; font-size:20px;">内联样式字体</span>

2)内部样式

在这里插入图片描述

在 《stytle》里面不能写注释

<html>
	
	<head>
	<meta charset="UTF-8">
	<!-- 设置内部字体样式 -->
	<style  type = "text/css">
	
		.cla {
			color:black;
			background-color:red;
			font-size:40px;
		}
		#good {
			color:red;
			background-color:green;
			font-size:40px;	
		}
		span {
			background-color:pink;
			font-size:30px;
		}
		
	</style>
	
	</head>
	
	<body>
		
		<span> 事实胜于<span id="good">雄辩</span>,实战<span class="cla">战胜</span>一切。</span>
		<span>没有实战,就没有<span class="cla">能力</span></span><br/>
		<h1 class="cla">Hellow</h1>
		<!-- 类标签 class -->
	</body>
</html>

3)外部样式

在这里插入图片描述

在单独的CSS文件里

		.cla {
			color:black;
			background-color:red;
			font-size:40px;
		}
		#good {
			color:red;
			background-color:green;
			font-size:40px;	
		}
		span {
			background-color:pink;
			font-size:30px;
		}


​  HTML的具体

<html>
<head>
<meta charset="utf-8"> 
<title>CssTest</title> 
<link rel="stylesheet"  type = "text/css" href = "./css.css">         <!---href 为Css文件的位置,要带扩展名-->
</head>

<body>

		<span> 事实胜于<span id="good">雄辩</span>,实战<span class="cla">战胜</span>一切。</span>
		<span>没有实战,就没有<span class="cla">能力</span></span><br/>
		<h1 class="cla">Hellow</h1>
		
</body>
</html>

四、HTML的嵌套iframe

1、iframe参数介绍

属性作用举例含义
src在iframe中显示的文档或网站的URLsrc=“http://www.baidu.com”引用的URL为“www.baidu.com”
heightiframe的高度height=“300”iframe高度为236px
widthiframe宽度width=“400”iframe宽度为400px
frameborder是否显示框架的边框frameborder=“1”显示边框
frameborder=“0”不显示边框
name框架标识名name=“mainFrame”框架标识名
scrolling是否显示滚动条scrolling = “no”不显示滚动条
scrolling =“yes”显示滚动条
scrolling=“auto”根据内容确定是否显示滚动条

2、单个嵌套

在这里插入图片描述

//嵌入百度
<html>
	
	<head>
		<title> TestIframe </title>
		<meta   charset = "utf-8" >
	</head>
	
	<body>
		<iframe src = "http://www.baidu.com" width="100%" height="100%">
		</iframe>
	</body>
</html>

//嵌入本地页面
<html>
	
	<head>
		<title> TestIframe </title>
		<meta   charset = "utf-8" >
	</head>
	
	<body>
		<iframe src = "./insideCss.html" width="100%" height="100%">
		</iframe>
	</body>
</html>

3、做页面导航

在这里插入图片描述

<html>
	
	<head>
		<title> TestIframe </title>
		<meta   charset = "utf-8" >
	</head>
	
	<body>
		<a href = "http://www.baidu.com" target ="MyFrame">baidu</a>
		<a href = "http://www.qq.com" target ="MyFrame">QQ</a>
		<a href = "http://www.sohu.com" target ="MyFrame">搜狐</a>
		<iframe name= "MyFrame" width="100%" height="100%">
		</iframe>
	</body>
</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

风云小虾米

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值