HTML是Hyper Text Markup Language(超文本标记语言)的缩写。 HTML不是一种编程语言,而是标记语言。javascript
<!DOCTYPE html>
————文件为html文件 <html lang="en">
————语言类型:英语 <head></head>
————头 <body></body>
————主体 </html>
css
<head> <title>浏览器标题</title> </head>
<head> <title>标题与段落</title> </head> <body> <h1>一级标题h1</h1> <h2>二级标题h2</h2> <h3>三级标题h3</h3> <h4>四级标题h4</h4> <h5>五级标题h5</h5> <h6>六级标题h6</h6> <p>段落标签p</p> </body>
<hr/> <br/>
空格: 大于号:> 小于号:<
<a href="//www.baidu.com">点击我,本窗口访问百度</a> <a href="//www.baidu.com" target="_blank">点击我,新窗口访问百度</a>
<img src="1.png" alt="若是图片加载失败,显示的文字">
<!-- table标签: border 边框 width 宽度 tr 行 th 表头 th 普通列 --> <table border="1px" width="300px"> <tr> <th>表头th</th> <th>表头th</th> </tr> <tr> <td>普通列td</td> <td>普通列td</td> </tr> </table>
<ul> <li>无序列表项1</li> <li>无序列表项2</li> </ul> <ol> <li>有序列表项1</li> <li>有序列表项2</li> </ol>
<!-- div 占用整行 span 不占用整行,长度取决于内部元素的长度 --> <div>div标签</div> <span>span标签</span>
表单一:html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>10.表单1</title> </head> <body> <!-- form标签 action 提交地址 method 请求方式(get或post,默认get) get 提交的数据参数在url中,不安全 post 提交的数据被加密,url中没法看到,在action中 enctype="multipart/form-data" 若是提交文件,须要添加这个参数 --> <form action="#" method="post" enctype="multipart/form-data"> </form> </body> </html>
表单二:java
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>10.表单2</title> </head> <body> <!-- input标签 1.文本框 type="text" 2.密码框 type="password" 3.单选框 type="radio" 4.复选框 type="checkbox" 5.文件框 type="file" 6.按钮 type="button" 7.提交 type="submit" 8.重置 type="reset" --> <form action="#" method="post" enctype="multipart/form-data"> 1.用户名(文本框text): <input type="text" name="username"> <hr/> 2.密码(密码框password):<input type="password" name="password" value=""> <hr/> 3.性别(单选框radio): 男<input type="radio" name="gender" value="0"> 女<input type="radio" name="gender" value="1"> <hr/> 4.爱好(复选框checkbox): 学Web<input type="checkbox" name="hobby" value="web"> 学爬虫<input type="checkbox" name="hobby" value="spider"> <hr/> 5.上传头像(文件框file): <input type="file" name="img"> <hr/> 6.按钮(button): <input type="button" value="空按钮"> <hr/> 7.提交(submit): <input type="submit" value="提交按钮"> <hr/> 8.重置(reset): <input type="reset" value="重置按钮"> <hr/> </form> </body> </html>
表单三:jquery
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>10.表单3</title> </head> <body> <!-- 下拉框:select和option 大文本:textarea cols 列数 rows 行数 --> <form action="#" method="post" enctype="multipart/form-data"> <select name="year"> <option value="2019">2019</option> <option value="2018">2018</option> </select> <textarea name="comment" cols="30" rows="10"></textarea> </form> </body> </html>
CSS是Cascading Style Sheets(层叠样式表)的缩写。 CSS不只能够静态地修饰网页,还能够配合各类脚本语言动态地对网页各元素进行格式化。web
格式: 属性:属性值;
例如: 设置背景颜色为蓝色: background-color:blue;
编程
<div style="background-color: blue"></div>
<style type="text/css"> /* css代码 */ </style>
<link rel="stylesheet" type="text/css" href="css文件地址">
<style type="text/css"> /* 标签选择器:【标签名】 {}; ID选择器:#【ID值】{}; 类选择器:.【类名】{}; */ body{ /*background-color: grey;*/ background-image: url("1.png"); background-repeat: no-repeat; } #div_id1{ background-color: red; font-size: 72px; font-weight: lighter; } .div_class1{ background-color: green; border:solid 1px yellow; } </style>
JavaScript一种直译式脚本语言,是一种动态类型、弱类型、基于原型的语言,内置支持类型。它的解释器被称为JavaScript引擎,为浏览器的一部分,普遍用于客户端的脚本语言,最先是在HTML网页上使用,用来给HTML网页增长动态功能。浏览器
<script type="text/javascript"> /* js代码 */ // alert(【对话框内容】); alert('你好,JavaScript'); </script>
<script type="text/javascript" src="myjs.js"></script>
从官方网站下载JQuery,而后引入:安全
<head> <script type="text/javascript" src="【本地JQuery地址】"></script> </head>
$div = $("div");
jsObject = $jqueryObject[0]; jsObject = $jqueryObject.get(0);
$jqueryObject = $(jsObject);
<body> <input type="button" value="按钮" id="button_id"> <script type="text/javascript"> //1.获得按钮对象 $buttonElement = $('#button_id'); //2.绑定点击事件 // $buttonElement.click(function(){ // alert('按钮被点击了') // }); $buttonElement.click(function(){ alert('按钮被点击了'); }); </script> </body>
<body> <input type="button" value="隐藏" id="button_hide"> <input type="button" value="显示" id="button_show"> <ul id="ul_id"> <li>Python</li> <li>Java</li> </ul> <script type="text/javascript"> // 1.获得两个按钮对象 $button_hide = $('#button_hide'); $button_show = $('#button_show'); // 2.获得ul对象 $ul = $('#ul_id'); // 隐藏 $button_hide.click(function(){ $ul.hide("slow"); }); // 显示 $button_show.click(function(){ $ul.show("slow"); }); </script> </body>
注意:speed:slow、normal、fast
编程语言
<br>
为我心爱的女孩~~
<br>
原文出处:https://www.cnblogs.com/WoLykos/p/12069947.html