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