前端的東西學了有一陣子了,感受都是比較零碎的東西,屬於一學就會,一放下就忘的類型。因此就回看了視頻作了筆記,對零碎的點作了梳理,方便往後本身須要的時候回看。javascript
1. HTML - headcss
2. HTML - bodyhtml
1 <label for="user"></label> 2 <input id="user">
1 <form action="https://www.baidu.com" method="get"> 2 <input name="username"> 3 <input name="password"> 4 </form>
<textarea> 多行文本默認信息 </textarea>
1 <select name="city"> 2 <option value="1">濟南</option> 3 <option value="2">青島</option> 4 </select>
1 <select name="city"> 2 <optgroup label="山東省"> 3 <option>濟南</option> 4 <option>青島</option> 5 </optgroup> 6 </select>
<a href="http://www.baidu.com" target="_blank">百度</a> <a href="#demo">鉚點,跳轉到 id=「demo」 的標籤處 </a>
<img src="圖片出處" title="鼠標懸浮文字" alt="加載失敗時顯示的文字">
1 <table> 2 <thead> /*表頭*/ 3 <th>id</th> 4 <th>請求方式</th> 5 </thead> 6 <tbody> /*表體*/ 7 <tr> /*行*/ 8 <td> 1 </td> 9 <td> get </td> 10 </tr> 11 </tbody> 12 </table>
1 <ul> //無序列表 2 <li> 獅子座♌️ </li> 3 <li> 白羊座♈️ </li> 4 </ul> 5 6 <ol> //有序列表 7 <li> 獅子座♌️ </li> 8 <li> 白羊座♈️ </li> 9 </ol> 10 11 <dl> //縮進格式 12 <dt> 獅子座♌️ </dt> 13 <dd> 白羊座♈️ </dd> 14 </dl>
3. CSS前端
<body> <div id="id1"></div> <div class="class1"></div> <div> <span></span> </div> <div id="id2"> <span>今天</span> </div> <div id="id3" class="..." april="april"></div> </body>
#id1{
width: 100px;
background: blue;
}
.class1{
width: 100%;
height: 100px;
}
div{
width: 100%;
height: 100px;
}
div span{
width: 100%;
height: 100px;
}
div[april="april"]{
width: 100%;
height: 100px;
}
.c1{
font-size: larger;
font-weight: bolder;
}
display: inline; //塊轉行
display: block; //行轉塊
display: inline-bllock; //既是行內也是塊,由於行內標籤不支持使用寬高屬性
display: none; //隱藏屬性
margin-top: 10px; //外邊框的意思顯而易見,很少作解釋。margin: 10px 表示四周的邊距,支持各個方向的邊距
padding-top: 10px; //內邊距是指,以邊框爲準,向自身內側擴充
<style> .c1{ height: 48px; width: 100%; color: blue; } .temp{ color: red; margin-top: 48px; } .c2{ position: fixed; top: 0; right: 0; left: 0; } </style> <body> <div class="c1 c2"></div> <div class="temp"></div> </body>
1 <style> 2 .c1{ 3 postion: relative; 4 border: 1px red solid; 5 height: 500px; 6 width: 500px; 7 } 8 .c2{ 9 height: 80px; 10 width: 80px; 11 color: blue; 12 position: absolute; 13 } 14 </style> 15 <body> 16 <div class="c1"> //外邊框,如下四個方塊 17 <div class="c2"></div> //默認在左上 18 <div class="c2" style="right:0;top:0; color:green"></div> 19 <div class="c2" style="right:0;bottom:0; color:red"></div> 20 <div class="c2" style="left:0;bottom:0; color:yellow"></div> 21 </div> 22 </body>
<input type="button" value="Login" style="cursor:pointer">
<style> .c1{ height: 100px; width: 100px; border: 1px red solid; overflow: auto; //自適應,超出邊框大小時有 scoll // overfllow: scoll; (無論是否超出邊框都展現 scoll) // overflow: hidden; (裁剪) } .c2: hover{ background-color:blue; //鼠標懸浮變色 } </style> <body> <div class="c1"> <img src="..."> </div> <div class="c2"> //懸浮變色 </div> </body>
1 <style> 2 .c3{ 3 width: 100px; 4 height: 100px; 5 background-img: url("..."); 6 background-repeat: repeat-x; //橫向堆疊 7 // repeat-y (豎向堆疊) 8 // repeat:none(不堆疊) 9 } 10 </style> 11 <body> 12 <div class="c3"></div> 13 </body>
background-repeat: repeat; //平鋪java
1 <style> 2 .c1{ 3 width:100px; 4 height: 100px; 5 background-img: url("..."); 6 background-position: 0 0; // 0 0 分別表明 xy 軸 7 } 8 </style> 9 <body> 10 <div class="c1"></div> 11 </body>
此種方式的處理方式:減小網絡 IO後端
1. css文件的引用方式爲 <link href="/static/css/pagination.css" rel="stylesheet">網絡