HTML学习
16lz
2022-03-21
HTML学习
1.表单学习
例子
代码
<form action="get">
<div class="name">
<div>
<label for="username">用户名:</label>
<input type="text" id="username" name="username" autofocus required />
</div>
<div>
<label for="psw">密码:</label>
<input type="password" id="psw" name="password" required />
</div>
<div>
<label for="my-email">邮箱:</label>
<input type="email" id="my-email" name="email" required />
</div>
<div>
<label for="male">性别:</label>
<input type="radio" name="gender" id="male" checked />
<label for="male">男 </label>
<input type="radio" name="gender" id="female" />
<label for="female">女</label>
</div>
<div>
<label for="male">爱好:</label>
<input type="checkbox" name="hobbies[]" id="game" />
<label for="game">游戏</label>
<input type="checkbox" name="hobbies[]" id="programmer" checked />
<label for="programmer">编程</label>
<input type="checkbox" name="hobbies[]" id="shoot" />
<label for="shoot">摄影</label>
<input type="checkbox" name="hobbies[]" id="swim" />
<label for="swim">游泳</label>
</div>
<div>
<label for="vip">会员:</label>
<select name="vip" id="vip">
<option value="1">金牌会员</option>
<option value="2">银牌会员</option>
<option value="3" selected>铜牌会员</option>
<option value="4">普通会员</option>
</select>
</div>
<label for="introduction">个人简介:</label>
<div>
<textarea name="introduction" id="my-introduction" cols="30" rows="10"></textarea>
</div>
<div>
<button>提交</button>
</div>
</form>
2.表单学习
例子
代码
<div class="header">
<h1>管理后台</h1>
<div>
<span>admin</span>
<a href="">退出</a>
</div>
</div>
<!-- 左侧导航 -->
<ul class="nav">
<li><h3><a href="系统管理.html" target="content">系统管理</a></h3></li>
<li><h3><a href="人员管理.html" target="content">人员管理</a></h3></li>
<li><h3><a href="考勤管理.html" target="content">考勤管理</a></h3></li>
<li><h3><a href="内容管理.html" target="content">内容管理</a></h3></li>
<li><h3><a href="网站首页.html" target="content">网站首页</a></h3></li>
<li><h3><a href="修改密码.html" target="content">修改密码</a></h3></li>
</ul>
<!-- 右侧内容区 -->
<iframe src="https://map.baidu.com/@13280886.83,2990092.74,12z" frameborder="2" name="content"></iframe>
3.引入样式和优先级
3.1 行内样式
例子
代码
<h1 style="color:red;font-size: 30px;">h1段落通过行内样式引入CSS样式</h1>
3.2 内部样式
例子
代码
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>内部样式表</title>
<!--内部样式表-->
<style type="text/css">
div{
color: green;
}
</style>
</head>
<body>
<div>DIV,通过内部样式表引入样式</div>
</body>
3.3 引入外部样式
例子
代码
<head>
<meta charset="UTF-8">
<title>外部样式表</title>
<!--引入外部样式表-->
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div>DIV,通过外部样式表引入样式</div>
</body>
3.3 行内样式和内部样式表优先级的对比
例子
代码
<head>
<meta charset="UTF-8">
<title>行内样式和内部样式表优先级比较</title>
<!--内部样式表-->
<style type="text/css">
h1{
color: blue;
}
</style>
</head>
<body>
<!--行内样式-->
<h1 style="color:red;">行内样式>内部样式</h1>
</body>
3.3 内部样式和外部样式的比较
例子
)
代码
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>内部样式表</title>
<!--内部样式表-->
<style type="text/css">
div{
color: green;
}
</style>
</head>
<body>
<div>内部样式表>外部样式表</div>
</body>
3.4 总结
- 行内样式>内部样式表>外部样式表
更多相关文章
- 表单,后台,元素样式的实例演示
- 登录表单+iframe后台架构+css优先级
- 1. 写一个登录表单,要求有邮箱,密码,登录按钮 2. 写一个简单后台
- 一个简单的登陆表单、后台框架及实例演示元素样式来源和优先级
- form表单提交、使用iframe编写后台简单布局、css样式分类与优先
- 实例演示元素来源与优先级
- 表单、内联框架以及CSS基础学习小结
- Android的TextView/EditText使用CharacterStyle&SpannableString
- Unity调用Android语音合成