来源于从网页搭建入门Java Web
好多基础的东西都忘记了,补起来!!
HTML基础
1 2
| <a href="#aaa"></a> <div id="aaa"></div>
|
1 2
| <a href="javascript:;"></a> <a href="javascript:void(0);"></a>
|
1
| <blockquote></blockquote>
|
相关的几个标签记熟了呀,用库都用忘了 table
, thead
, tbody
, th
, tr
, td
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
| <!DOCTYPE html> <html lang="en">
<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>Document</title> <style> body { margin: 0; } table { margin: 0; width: 100vw; } table, tr, th, td { border: 1px solid #0e0000; border-collapse: collapse; padding: 5px; } </style> </head>
<body> <div> <table> <thead> <tr> <th>省份</th> <th>城市</th> <th>温度</th> </tr> </thead> <tbody> <tr> <td>北京</td> <td>北京</td> <td>6</td> </tr> <tr> <td rowspan="2">河北</td> <td>石家庄</td> <td>10</td> </tr> <tr> <td>保定</td> <td>7</td> </tr> <tr> <td rowspan=2>福建</td> <td>福州</td> <td>18</td> </tr> <tr> <td>厦门</td> <td>22</td> </tr> </tbody> </table> </div> </body> </html>
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| <!DOCTYPE html> <html lang="en">
<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>Document</title> <style> select { width: 200px; height: 100px; }
option { padding: 10px; text-align: center; font-size: 1.2em; background: #f0f0f0; border: 1px solid #555; }
</style> </head>
<body> <select name="city" size="2" multiple> <option value="aa">aa</option> <option value="bb">bb</option> <option value="cc">cc</option> <option value="cc">dd</option> <option value="cc">ee</option> <option value="cc">ff</option> <option value="cc">gg</option> </select> </body>
</html>
|
CSS基础
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| <!DOCTYPE html> <html lang="en"> <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>Document</title> <style> q::before { content: "<<"; color: black; } q::after { content: ">>"; color: black; } </style> </head> <body> <q>海底两万里</q> <q>上下五千年</q> </body> </html>
|
1 2 3 4 5 6
| @front-face { font-family: ...; src: url() format(); font-weight: ...; font-style: ...; }
|
p标签的字体大小设置的值是1.5em,它的字体大小是其父元素div的1.5倍,是30px;
span标签的字体大小设置的值是150%,是它的父元素p标签的1.5倍,那么就是45px
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
| <!DOCTYPE html> <html lang="en">
<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>Document</title> <style> html, body { margin: 0; }
header { width: 100%; height: 100px; background-color: beige; }
#container { width: 100%; height: 300px; background-color: cadetblue; }
nav { width: 100px; height: 100%; background-color: aliceblue; float: left; }
aside { width: 300px; height: 100%; background-color: brown; float: right; }
</style> </head>
<body> <header></header> <div id="container"> <nav></nav> <aside></aside> <article>aaaaaaaa</article> </div> </body>
</html>
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
| <!DOCTYPE html> <html lang="en">
<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>Document</title> <style> html, body { margin: 0; }
header { width: 100%; height: 50px; background-color: antiquewhite; } #container { width: 100%; height: 400px; background-color: blue; } footer { width: 100%; height: 100px; background-color: bisque; } nav { width: 100px; height: 100%; float: left; background-color: cornflowerblue; } article { margin-left: 100px; height: 100%; background-color: aqua; } </style> </head>
<body> <header></header> <div id="container"> <nav></nav> <article></article> </div> <footer></footer> </body>
</html>
|