âï¸ä½è :é¶æ²³ç½å¤´
????ç³»åä¸æ :JavaEE
????âç§ä¸æ£µæ æ好çæ¶é´æ¯åå¹´å,å ¶æ¬¡æ¯ç°å¨â
åè¨
HTML: æè¿°ç½é¡µç骨æ¶ãæ ç¾åçè¯è¨ã
<html>
<head></head>
<body>hello world</body>
</html>
html çæ§è¡æ¯æµè§å¨çå·¥ä½,æµè§å¨ä¼è§£æ html çå 容,æ ¹æ®éé¢çå 容å¾æµè§å¨æ¾ä¸è¥¿ãæµè§å¨çå·¥ä½å½æ ¹ç»åºè¿æ¯ä»¥æ±ç¼çå½¢å¼å¨ CPU ä¸æ§è¡ã
æµè§å¨å°±å JVM ä¸æ ·, Java æ¯æ§è¡å¨ JVM ä¸ç,JVM åæ¯æ§è¡å¨ CPUä¸ç
æµè§å¨å¯¹äº html çè¯æ³æ ¼å¼æ£æ¥æ²¡æå¾ä¸¥æ ¼,å³ä½¿ä½ åç代ç æä¸äºä¸åè§èä¹å¤,æµè§å¨ä¹ä¼å°½å¯è½çå»æ§è¡ã称为"é²æ£æ§"ã
ç´æ¥å¨è®°äºæ¬ç¼å代ç ,ç´æ¥å¨æµè§å¨è¿è¡ä»£ç ã
æµè§å¨çåè½å°±æ¯è§£æè¿è¡ç½é¡µ(HTML, CSS, JS)
å¼å,æ¯å¨ç¨åºåççµèä¸å®æçå代ç çè¿ç¨;è¿è¡,åæ¯å¨ç¨æ·çµèä¸å®æçå ·ä½çç¨åºè·èµ·æ¥çè¿ç¨ã
ä¸æ¬¡å¼å,N 次è¿è¡ã
- ä½¿ç¨ VSCode ç¼å代ç
1.æå¼ç®å½,
2.å建代ç æ件
3.ç¼è¾ä»£ç
- ä¿å代ç
åå®ä»£ç è¦ ctrl + s ä¿åãå¦æ没ä¿å,å³ä¸è§æ个 å®å¿å°åç¹
è¿é off å¯ä»¥æ¹æèªå¨ä¿åã
4.è¿è¡ä»£ç (ä»ç¶æ¯ä½¿ç¨æµè§å¨è¿è¡)
å¨å¼¹åºçæ件èµæºç®¡çå¨ä¸ åå» html æ ææ½å°æµè§å¨ä¸è¿è¡
HTML ç»æ
1.HTML 代ç æ¯éè¿æ ç¾æ¥ç»ç»ç,å½¢å¦ ç¨å°æ¬å·ç»ç»ç,æ对åºç°çè¿ä¸ªå°±æ¯æ ç¾(tag),ä¹å¯ä»¥å«åå ç´ (element).
2.ä¸ä¸ªæ ç¾é常æ¯æ对åºç°ç,å¼å§æ ç¾ç»ææ ç¾,è¿ä¿©ä¹é´æ¯æ ç¾çå 容ã(å°æ°æ ç¾æ¯å¯ä»¥åªæä¸ä¸ªå¼å§æ ç¾ç,åæ ç¾)
3.æ ç¾æ¯å¯ä»¥åµå¥ç,ä¸ä¸ªæ ç¾çå 容å¯ä»¥æ¯å ¶ä»ä¸ä¸ªæè å¤ä¸ªæ ç¾,æ¤æ¶è¿äºæ ç¾ææäºä¸ä¸ª"æ å½¢ç»æ"ã
4.å¯ä»¥å¨å¼å§æ ç¾ä¸ç»æ ç¾èµäºå±æ§(attribute),å±æ§ç¸å½äºé®å¼å¯¹,å¯ä»¥æä¸ä¸ªæè å¤ä¸ªã
XML å HTML çåºå«:
XML ä¹æ¯æ ç¾åçæ ¼å¼,æåªäºæ ç¾,æ ç¾å«ä»ä¹åå?æå¥ä½ç¨?æå¥å±æ§ãé½æ¯ç¨åºåä½ æ ¹æ®ä½ çéæ±åºæ¯èªå®ä¹çã
HTML ä¹æ¯æ ç¾åçæ ¼å¼,è¿éæåªäºæ ç¾?æ ç¾å«å¥åå?æå¥ä½ç¨?æå¥å±æ§?é½æ¯æä¸æ¹å¤§ä½¬ä»¬è§å®å¥½ç,æµè§å¨è·æç §è¿ä»½è§å®æ¥è§£æå®ç°çãHTML ä¸æ¯æèªå®ä¹æ ç¾
html:è¿æ¯ä¸ä¸ª html æ件æ顶å±æ ç¾(æ æ ¹èç¹)ã
head :åæ¾äºè¿ä¸ªé¡µé¢çä¸äºå±æ§(å æ°æ®meta data)
body :åæ¾äºè¿ä¸ªé¡µé¢,å å«åªäºå 容ã
- æä¹ç解å±æ§?
ç°å¨ææ个ææ¬æ件,è¿ä¸ªæ件çå å®¹æ¯ hello world
è¿ä¸ªæ件çå±æ§:æ件ç大å°ãæ件çå建è ãæ件çä¿®æ¹æ¶é´ãæ件çé»è®¤æå¼ç¨åº
å¿«éçæ代ç æ¡æ¶
!(è±æ) + tab, æ¤æ¶è½èªå¨çæ代ç ç主ä½æ¡æ¶.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
</body>
</html>
åªéè¦ç¼è¾ body çå 容å³å¯ã
è¿ä¸ªåè½å«å emmet å¿«æ·é®ã
主æµå¼åå·¥å ·é½æã(WebStorm å idea ä¹æ)
- ç»è解é:
HTML 常è§æ ç¾
注éæ ç¾
<!-- è¿æ¯æ³¨é -->
// /**/ # è¿äºé½ä¸æ¯ htmlä¸åæ³ç注é
注éçå 容æ¯ä¸ä¼å¨é¡µé¢ä¸æ¾ç¤ºçã(ä½æ¯å¦æå³é®,æ¥çç½é¡µæºä»£ç æ¯å¯ä»¥çå°æ³¨éç)
vscode å¯ä»¥ä½¿ç¨ ctrl + / å¿«é注é代ç
webstorm åç
æ é¢æ ç¾: h1-h6
h1 æ大æç²,h6 æå°æç»ã
<body>
<h1>ä¸çº§æ é¢</h1>
<h2>äºçº§æ é¢</h2>
<h3>ä¸çº§æ é¢</h3>
<h4>å级æ é¢</h4>
<h5>äºçº§æ é¢</h5>
<h6>å
级æ é¢</h6>
</body>
HTML ç½é¡µæååªæ¯ç¨æ¥ä»£æ¿ä¼ ç»çåªä½çæ¥çº¸/æå¿,ææ¥çº¸æå¿æ¬å°çµèé
注æå°,è¿éæ¯ä¸ªæ é¢é½æ¯ç¬å ä¸è¡ç,è¿å代ç çç¼å没æå ³ç³»,
<body>
<h1>ä¸çº§æ é¢</h1><h2>äºçº§æ é¢</h2>
<h3>ä¸çº§æ é¢</h3>
<h4>å级æ é¢</h4>
<h5>äºçº§æ é¢</h5>
<h6>å
级æ é¢</h6>
</body>
è¿æ ·å,è¿è¡ææä¸åã
å¨ html éé¢,æ ç¾æ¯å¦æ¢è¡å代ç ç¼åæ å ³,å æ ç¾èªèº«æå ³ã(æçæ ç¾ç¬å ä¸è¡,æçæ ç¾ä¸ç¬å )
å¨ html æºä»£ç ä¸,åç æ¢è¡ä¼è¢«å¿½ç¥ãåçå¤ä¸ªè¿ç»ç©ºæ ¼ä¼è¢«è§ä¸ºä¸ä¸ªã
æ¢è¡å¿«æ·é®:
ctrl + enter
段è½æ ç¾:p
lorem:èªå¨çæä¸æ®µéæºçææ¬,帮æ们è°è¯ææã
æ¯ä¸ªæ®µè½ä¹é´,è¦æ¢è¡,è¿æä¸ä¸ªææ¾ç段è½é´è·ã(è¿ä¸ª é´è· éè¿ css æè½è°)
æ¢è¡æ ç¾:br
æ ¼å¼åæ ç¾
<body>
<strong>åç²!</strong>
<b>åç²!</b>
<em>å¾æ</em>
<i>å¾æ</i>
<del>å é¤çº¿</del>
<s>å é¤çº¿</s>
<ins>ä¸å线</ins>
<u>ä¸å线</u>
</body>
è¿äºæ ç¾é½æ¯ä¸ç¬å ä¸è¡çã
å¾çæ ç¾:img
ç½é¡µä¸æ¯å¯ä»¥æ¾ç¤ºå¾ççã
img æä¸ªæ ¸å¿å±æ§,src(å¿ å¡«é¡¹)
src æè¿°äºè¯¥å¾ççè·¯å¾,è·¯å¾å¯ä»¥æ¯ä¸ä¸ªæ¬å°çç»å¯¹è·¯å¾,ä¹å¯ä»¥æ¯ä¸ä¸ªç¸å¯¹è·¯å¾,è¿å¯ä»¥æ¯ç½ç»è·¯å¾ã
- ç»å¯¹è·¯å¾
ç»å¯¹è·¯å¾åæ³:
<body>
<img src="d:/xiaojiejie.jpg" >
</body>
è¿é src å¡«çæ¯ ç»å¯¹è·¯å¾ã
- ç¸å¯¹è·¯å¾
å¦æå¡«ç¸å¯¹è·¯å¾,ä¸å®è¦æ确工ä½ç®å½æ¯åªä¸ªã
html çå·¥ä½ç®å½å°±æ¯ html æ件æå¨çç®å½ã
ç¸å¯¹è·¯å¾åæ³:
<body>
<img src="./xiaojiejie.jpg" >
</body>
./å¯ä»¥çç¥
<body>
<img src="xiaojiejie.jpg" >
</body>
- ç½ç»å°å
å³é®å¾ç,å¤å¶å¾çå°å,æ¤æ¶å°±å¾å°äºå¾ççç½ç»è·¯å¾,æ¿çè¿ä¸ªç½ç»è·¯å¾å¡«åå°æµè§å¨é,å°±è½ç´æ¥æå¼å¾çã
æè æè¿ä¸ªè·¯å¾åå° img éä¹è½æ¾ç¤ºè¿ä¸ªå¾çã
<body>
<img src="https://img02.sogoucdn.com/app/a/100520093/f9d5c084396d06f6-0c7006bf1d0bb8d5-44cfb308fd53675f90401be304dc572d.jpg" >
</body>
img å«çå±æ§
- alt å±æ§:å¨å¾çæäºçæ¶å,å°±ä¼æ¾ç¤º alt 对åºçææ¬ã
å¦æå¾çå°åæ¯éç,
- title å±æ§
é¼ æ æ¬åå¨ å¾çä¸ä¼ç»åºä¸ä¸ªæ示ã
- width/height
æè¿°å¾çç尺寸
宽度åé«åº¦å¯ä»¥åæ¶è®¾ç½®,ä¹å¯ä»¥åªè®¾ç½®ä¸ä¸ªãå¦æåªè®¾ç½®ä¸ä¸ª,å¦å¤ä¸ä¸ªä¼çæ¯ä¾ç¼©æ¾ã
<body>
<img width="1000px" title="è¿æ¯ä¸ä¸ªå°å§å§" alt="è¿æ¯ä¸ä¸ªæ¼äº®å°å§å§" src="https://img02.sogoucdn.com/app/a/100520093/f9d5c084396d06f6-0c7006bf1d0bb8d5-44cfb308fd53675f90401be304dc572d.jpg" >
</body>
px åç´ ã(å端å¼åä¸å¸¸ç¨åä½)
å ³äºå¾çç尺寸,ä¹å¯ä»¥ä½¿ç¨ css æ¥è®¾ç½®ã
è¶ é¾æ¥ a
é¾æ¥ link(å¿«æ·æ¹å¼)
"è¶ "é¾æ¥è·³è½¬å°ç页é¢æ¯å½åç½ç«ä¹å¤çã
<body>
<a href="https://www.sogou.com">æç</a>
<a href="https://www.baidu.com">ç¾åº¦</a>
</body>
è¿éçååå¯ä»¥æ¢æ ip å°å
è¿æ个å±æ§,target, ä¸è¬é½æ¯åä½ target = â_blankâ,å°±å¯ä»¥æå¼ä¸ä¸ªæ°çæ ç¾é¡µ,èä¸æ¯æ¿æ¢åææ ç¾é¡µã
è¡¨æ ¼æ ç¾
table æ ç¾è¡¨ç¤ºæ´ä¸ªè¡¨æ ¼
tr 表示ä¸è¡
td 表示ä¸ä¸ªåå æ ¼
th 表示表头ä¸çä¸ä¸ªåå æ ¼
<body>
<table>
<tr>
<th>å§å</th>
<th>çµè¯</th>
</tr>
<tr>
<td>å¼ ä¸</td>
<td>110</td>
</tr>
<tr>
<td>æå</td>
<td>120</td>
</tr>
<tr>
<td>çäº</td>
<td>119</td>
</tr>
</table>
</body>
<style>
td{
text-align: center;
}
</style>
</head>
<body>
<table width="500px" height="300px" border="1px" cellspacing="0">
<tr>
<th>å§å</th>
<th>çµè¯</th>
</tr>
<tr>
<td>å¼ ä¸</td>
<td>110</td>
</tr>
<tr>
<td>æå</td>
<td>120</td>
</tr>
<tr>
<td>çäº</td>
<td>119</td>
</tr>
</table>
</body>
è¿ä¸ªæä½å°±æ¯è®©é¡µé¢ä¸ ææç td æ ç¾ä¸çæåé½æ°´å¹³å± ä¸(CSS)
å表æ ç¾
æåºå表 ol :ordered list
æ åºå表 ul :unordered list
å表项 li :list item
<body>
<!-- æåºå表 -->
<h3>å大åè</h3>
<ol>
<li>ä¸å½æ¼ä¹</li>
<li>æ°´æµä¼ </li>
<li>西游记</li>
<li>红楼梦</li>
</ol>
<!-- æ åºå表 -->
<ul>
<li>ä¸å½æ¼ä¹</li>
<li>æ°´æµä¼ </li>
<li>西游记</li>
<li>红楼梦</li>
</ul>
</body>
表åæ ç¾
表åæ¯è®©ç¨æ·è¾å ¥ä¿¡æ¯çéè¦éå¾.
form æ ç¾
ä½¿ç¨ form è¿è¡åå端交äº,æ页é¢ä¸ç¨æ·è¿è¡çæä½/è¾å ¥æ交å°æå¡å¨ä¸(ææ¶ä¸å±å¼,åé¢å¦äºHTTPåè®®å说)
input æ ç¾
1)ææ¬æ¡
<body>
<input type="text">//åè¡ææ¬æ¡
</body>
2)å¯ç æ¡
<body>
<input type="password">//ä¹æ¯åè¡ææ¬æ¡,æ¯ç¨æ¥è¾å
¥å¯ç ç
</body>
3)åéæ¡
<body>
请éæ©æ§å«:
<input type="radio"> ç·
<input type="radio"> 女
</body>
对äºåéæ¡éè¦å 个 name å±æ§,name å±æ§ç¸åçåéæ¡, å¼ä¹é´æ¯äºæ¥çã
<body>
请éæ©æ§å«:
<input type="radio" name="gender"> ç·
<input type="radio" name="gender"> 女
</body>
å å ¥ checked å±æ§,é»è®¤éæ©
<body>
请éæ©æ§å«:
<input type="radio" name="gender"> ç·
<input type="radio" name="gender" checked="checked"> 女
</body>
4)å¤éæ¡
<body>
大å¦çæ¯å¤©é½å¹²å¥
<input type="checkbox"> åé¥
<input type="checkbox"> ç¡è§
<input type="checkbox"> å¦ä¹
</body>
ä¹å¯ä»¥å ä¸é»è®¤é项
<body>
大å¦çæ¯å¤©é½å¹²å¥
<input type="checkbox" checked="checked"> åé¥
<input type="checkbox"> ç¡è§
<input type="checkbox"> å¦ä¹
</body>
5)æé®
<body>
<input type="button" value="ææ¯ä¸ªæé®">
</body>
对äºæé®ç¹å»ä¹åè¦å¹²å¥, éè¦éè¿ JS æ¥é å
<body>
<input type="button" value="ææ¯ä¸ªæé®" onclick="alert('hello')">
</body>
alert æ¯ JS éçä¸ä¸ªå½æ°,ä½ç¨æ¯å¼¹åºä¸ä¸ªå¯¹è¯æ¡,对è¯æ¡çå å®¹å°±æ¯ hello
6)æ交æé®
type="submit"
å¤è¡¨å button å·®ä¸å¤,ä¼è§¦å form åæå¡å¨ç交äºã
7)ä¸ä¼ æ件
<body>
<input type="file">
</body>
select æ ç¾
ä¸æèå
<body>
<select>
<option>å京</option>
<option>ä¸æµ·</option>
<option>广å·</option>
<option>æ·±å³</option>
<option>æå·</option>
</select>
</body>
textarea æ ç¾
å¤è¡ç¼è¾æ¡
<body>
<textarea cols="30" rows="10"></textarea>
</body>
ä¸è¿°è¿äºæ ç¾ä¹å¯ä»¥ç§°ä¸ºæ¯"æ§ä»¶", ææä¸ä¸ªå¾å½¢åçé¢çåºæ¬è¦ç´ ã
æ è¯ä¹æ ç¾: div & span
åé¢çæ ç¾é½æ¯æç¹å®å«ä¹ç,èæ è¯ä¹æ ç¾æ¯æ²¡æç¹å®å«ä¹çãæ è¯ä¹æ ç¾å¯ä»¥ç¨å¨åç§åºæ¯ã
div é»è®¤æ¯ç¬å ä¸è¡çã(å级å ç´ )
span é»è®¤æ¯ä¸ç¬å ä¸è¡çã(è¡å å ç´ )
综åæ¡ä¾:å±ç¤ºç®åä¿¡æ¯
<body>
<div style="border: 3px solid black;">
<h1>xxxçç®å</h1>
<h2>åºæ¬ä¿¡æ¯</h2>
<img src="头å.jpg" alt="" height="200px">
<p>
æ±èæå:软件å¼åå·¥ç¨å¸
</p>
<p>
èç³»æ¹å¼:110
</p>
<p>
é®ç®±:123456@qq.com
</p>
<p>
<a href="https://www.csdn.com">æçå客</a>
</p>
<p>
<a href="https://github.com">æç github</a>
</p>
<h2>æè²èæ¯</h2>
<ol>
<li>
1990-1996 xxxå°å¦
</li>
<li>
1997-2000 xxxåä¸
</li>
<li>
2001-2004 xxxé«ä¸
</li>
<li>
2005-2008 xxx大å¦
</li>
</ol>
<h2>ä¸ä¸æè½</h2>
<ul>
<li>
çç»ææ¡ Java çåºæ¬è¯æ³,çæé¢å对象ç¨åºè®¾è®¡ææ³
</li>
<li>
çç»å¸¸ç¨çæ°æ®ç»æåç®æ³,æ¯å¦é¡ºåºè¡¨,é¾è¡¨,äºåæ ,å ,åå¸è¡¨ç
</li>
<li>
çç»æä½ç³»ç»ä¸çå
¸åæ¦å¿µ,çç»ææ¡å¹¶åç¼ç¨,对äºå¤çº¿ç¨,线ç¨å®å
¨,å éçæä½ææ·±å»ç认è¯
</li>
<li>
çç»ææ¡ç½ç»ç¼ç¨,çæç½ç»éä¿¡åç,çæ TCP/IP åè®®æ ä¸çå
¸åå议工ä½æºå¶
</li>
<li>
çç»ææ¡ SQL,è½å¤è¿è¡åºç¡çå¢å æ¹æ¥, çæ mysql çç´¢å¼åäºå¡çæºå¶
</li>
</ul>
<h2>æç项ç®</h2>
<ol>
<li>
<h3>çè¨å¢</h3>
<p>å¼åæ¶é´: 2008-2011</p>
<div>åè½ä»ç»</div>
<ul>
<li>æ¯æçè¨åå¸</li>
<li>æ¯æå¿åçè¨</li>
</ul>
</li>
<li>
<h3>å¦ä¹ å°å©æ</h3>
<p>å¼åæ¶é´: 2011-2012</p>
<div>åè½ä»ç»</div>
<ul>
<li>æ¯æéé¢æ£ç´¢</li>
<li>æ¯æåå¦æ¢è®¨</li>
</ul>
</li>
</ol>
<h2>个人è¯ä»·</h2>
å¨æ ¡æé´,å¦ä¹ æ绩ä¼å¼, å¤æ¬¡è·å¾å¥å¦é
</div>
</body>
HTML åªæ¯æè¿°äºé¡µé¢ç骨æ¶ç»æ. ä½¿ç¨ CSS å¯ä»¥é对页é¢è¿è¡è¿ä¸æ¥ç¾å.