HTMLãCSS å端é¢è¯é¢æ¶é
HTML
1. HTML5æ°ç¹æ§ï¼è¯ä¹å
- æ ¹æ®å 容çç»æåï¼å 容è¯ä¹åï¼ï¼éæ©åéçæ ç¾ï¼ä»£ç è¯ä¹åï¼
- åå ï¼ä¾¿äºå¼åè é 读åååºæ´ä¼é ç代ç ï¼è®©æµè§å¨çç¬è«åæºå¨å¾å¥½å°è§£æã
- section article aside header footer video audio
2.æµè§å¨çæ å模å¼åæªå¼æ¨¡å¼
- å¨æ å模å¼ä¸ï¼æµè§å¨æç §HTMLä¸CSSæ å对ææ¡£è¿è¡è§£æå渲æï¼
- èå¨æªå¼æ¨¡å¼ä¸ï¼æµè§å¨åæç §æ§æçéæ åçå®ç°æ¹å¼å¯¹ææ¡£è¿è¡è§£æå渲æ
- è¿æ ·çè¯ï¼å¯¹äºæ§æçç½é¡µï¼æµè§å¨å¯å¨æªå¼æ¨¡å¼ï¼å°±è½å¤ä½¿å¾æ§ç½é¡µæ£å¸¸æ¾ç¤ºï¼å¯¹äºæ°çç½é¡µï¼åå¯ä»¥å¯å¨æ å模å¼ï¼ä½¿å¾æ°ç½é¡µè½å¤ä½¿ç¨HTMLä¸CSSçæ åç¹æ§ã
- 对äºæ²¡ææ档类å声æï¼DOCTYPEï¼æè æ档类å声æä¸æ£ç¡®çææ¡£ï¼æµè§å¨å°±ä¼ä½¿ç¨æªå¼æ¨¡å¼è§£æå渲æ该ææ¡£ã
3.ç模åçå¤çå·®å¼ï¼
- æ åCSSç模åç宽度åé«åº¦çäºå 容åºçé«åº¦å宽度ï¼ä¸å å«å è¾¹è·åè¾¹æ¡ï¼
- èIE6ä¹åçæµè§å¨å®ç°çç模åç宽é«è®¡ç®æ¹å¼æ¯å å«å è¾¹è·åè¾¹æ¡çã
- å æ¤ï¼å¯¹äºIEï¼æªå¼æ¨¡å¼åæ å模å¼ä¸çç模å宽é«è®¡ç®æ¹å¼æ¯ä¸ä¸æ ·çï¼
4.è¡å å ç´ çåç´å¯¹é½ï¼
- æ å模å¼ä¸ï¼å¨æ å模å¼ä¸ï¼å¾çä¸ç¶å ç´ çä¸è¾¹æ¡è·ç¦»3pxã
- èæªå¼æ¨¡å¼ä¸ï¼åä¸åå¨è¿ä¸ªé®é¢
5.xhtmlåhtmlçåºå«
- XHTML å ç´ å¿ é¡»è¢«æ£ç¡®å°åµå¥ã
- XHTML å ç´ å¿ é¡»è¢«å ³éã
- æ ç¾åå¿ é¡»ç¨å°ååæ¯ã
- XHTML ææ¡£å¿ é¡»æ¥ææ ¹å ç´ ã
6.使ç¨data-çå¥½å¤ (ç¨äºåå¨é¡µé¢æåºç¨ç¨åºçç§æèªå®ä¹æ°æ®)
- èªå®ä¹å±æ§ï¼å¯ä»¥è¢«jså¾å¥½çæä½
- H5çæ°å±æ§
- éè¿jsçelement.dataset.æjQueryçdata(ââ)æ¿å°ï¼*å¯ä»¥ä¸ºurlçå符
- æ¡æ¶çæ°æ®ç»å®ï¼ä¾å¦data-ng-if=âcs==1â
7.metaæ ç¾
- å®ä¸ä¼æ¾ç¤ºå¨é¡µé¢ä¸ï¼ä½æ¯å¯¹äºæºå¨æ¯å¯è¯»çã
- å¯ç¨äºæµè§å¨ï¼å¦ä½æ¾ç¤ºå 容æéæ°å 载页é¢ï¼ï¼æç´¢å¼æï¼å ³é®è¯ï¼ï¼æå ¶ä» web æå¡ã
- viewport charset
<meta http-equiv="Refresh" content="5;url=http://blog.yangchen123h.cn" />
<meta name="renderer" content="webkit"/>
8.canvas
getContext()
æä¸ä¸ªåºäº JavaScript çç»å¾ APIï¼è SVG å VML 使ç¨ä¸ä¸ª XML ææ¡£æ¥æè¿°ç»å¾ã
9.HTMLåºå¼çæ ç¾
<b>, <u>, <i>, <s>ï¼<font>
<strong>=<b> :å®ä¹éè¦æ§å¼ºè°çæå
<em>=<i> ï¼å®ä¹å¼ºè°çæå
<ins>=<u>ï¼å®ä¹æå
¥çæå
<del>=<s>ï¼å®ä¹å é¤çæå
10.IE6 bugï¼åä¸äºå®ä½åæ³
- ååè¾¹è·bugï¼ä½¿ç¨floatæµ®å¨æ¶,å¨è¯¥å ç´ ä¸å å ¥display:inline æ display:blockï¼
- 3åç´ é®é¢: 使ç¨floatæµ®å¨åï¼å ç´ ä¸ç¸é»çå ç´ ä¹é´ä¼äº§ç3pxçé´éï¼éè¦ä½¿å¸å±å¨åä¸è¡çå ç´ é½å ä¸floatæµ®å¨ï¼
- å¾çé¾æ¥çä¸æ¹æé´éï¼å°imgæ ç¾å®ä¹ä¸ºdisplay:block æå®ä¹vertical-align对åºçå±æ§ãä¹å¯ä»¥ä¸ºimg对åºçæ ·å¼åå ¥font-size:0ï¼
11.css jsæ¾ç½®ä½ç½®ååå
说å°css jsæ¾ç½®ä½ç½®çé®é¢ï¼æ们就æå¿
è¦å
äºè§£ä¸ä¸ç½ç«å è½½çæ´ä¸ªå®æ´è¿ç¨äº
ã
- é¦å æµè§å¨ä»æå¡å¨æ¥æ¶å°html代ç ï¼ç¶åå¼å§è§£æhtml
- æ建DOMæ ï¼æ ¹æ®html代ç èªé¡¶åä¸è¿è¡æ建ï¼ï¼å¹¶ä¸å¨åæ¶æ建渲ææ
- éå°jsæ件å è½½æ§è¡ï¼å°é»å¡DOMæ çæ建ï¼éå°cssæ件ï¼å°é»å¡æ¸²ææ çæ建
- scriptæ ç¾ä¸çdeferå±æ§ï¼æ建DOMæ çè¿ç¨åjsæ件çå è½½å¼æ¥ï¼å¹¶è¡ï¼è¿è¡ï¼ä½æ¯jsæ件æ§è¡éè¦å¨DOMæ æ建å®æä¹å
- scriptæ ç¾ä¸çasyncå±æ§ï¼æ建DOMæ ã渲ææ çè¿ç¨åjsæ件çå è½½åæ§è¡å¼æ¥ï¼å¹¶è¡ï¼è¿è¡
- æ以scriptæ ç¾æ好æ¾å¨æ ç¾çåé¢ï¼å 为æ¾å¨ææbodyä¸çæ ç¾åé¢å°±ä¸ä¼åºç°ç½é¡µå è½½æ¶åºç°ç©ºç½çæ åµï¼å¯ä»¥æç»çç»ç¨æ·æä¾è§è§åé¦ï¼åæ¶å¨æäºæ åµä¸ï¼ä¼éä½é误çåçã
- ècssæ ç¾åºè¯¥æ¾å¨æ ç¾ä¹é´ï¼å 为å¦ææ¾å¨æ ç¾çåé¢ï¼é£ä¹å½DOMæ æ建å®æäºï¼æ¸²ææ ææ建ï¼é£ä¹å½æ¸²ææ æ建å®æï¼æµè§å¨ä¸å¾ä¸åéæ°æ¸²ææ´ä¸ªé¡µé¢ï¼è¿æ ·é æäºèµæºç浪费ãæçä¹ä¸é«ãå¦ææ¾å¨ä¹é´ï¼æµè§å¨è¾¹æ建边渲æï¼æçè¦é«çå¤ãæ»çæ¥è¯´ï¼å°±æ¯æé«æ§è½ï¼æé«ç½é¡µçå¯è¯»æ§ã
12.ä»ä¹æ¯æ¸è¿å¼æ¸²æ
å¨é¦æ¬¡æ¸²æçæ¶åï¼åªå è½½é¦å±çå 容ï¼éçç¨æ·æ»å¨æè 说æ¶é´çæ¨ç§»ï¼æè¿è¡åé¢çå è½½ãè¿æ ·åç好å¤æ¯ï¼æé«ç½é¡µçæ§è½ï¼ä¸ä¼é æèµæºç浪费ï¼æéå è½½ã
13.html模æ¿è¯è¨
模æ¿å å«ï¼HTMLçéæé¨åï¼å¨ææå ¥å 容é¨å
14.meta viewportåç
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
15.éæãåæµ
æµè§å¨çéææçæ¯æ¹åæ¯ä¸ªå
ç´ å¤è§æ¶æ触åçæµè§å¨è¡ä¸ºï¼æ¯å¦é¢è²ï¼èæ¯çæ ·å¼åçäºæ¹åèè¿è¡çéæ°æé æ°å¤è§çè¿ç¨ã
éæä¸ä¼å¼å页é¢çéæ°å¸å±ï¼ä¸ä¸å®ä¼´éçåæµã
åæµæçæ¯æµè§å¨ä¸ºäºéæ°æ¸²æ页é¢çéè¦èè¿è¡çéæ°è®¡ç®å ç´ çå ä½å¤§å°åä½ç½®çï¼ä»çå¼éæ¯é常大çï¼åæµå¯ä»¥ç解为渲ææ éè¦éæ°è¿è¡è®¡ç®ï¼ä¸è¬æ好触åå ç´ çéæï¼é¿å å ç´ çåæµï¼
æ¯å¦éè¿éè¿æ·»å ç±»æ¥æ·»å cssæ ·å¼ï¼èä¸æ¯ç´æ¥å¨DOMä¸è®¾ç½®ï¼å½éè¦æä½æä¸åå ç´ æ¶åï¼æå¥½ä½¿å ¶è±ç¦»ææ¡£æµï¼è¿æ ·å°±ä¸ä¼å¼èµ·åæµäºï¼æ¯å¦è®¾ç½®positionï¼absoluteæè fixedï¼æè displayï¼noneï¼çæä½ç»æåå¨æ¾ç¤ºã
16. å端ä¼åï¼æé«ç½é¡µçå è½½é度ï¼
- 1ã使ç¨css spritesï¼å¯ä»¥ææçåå°http请æ±æ°
- 2ã使ç¨ç¼å
- 3ãå缩jsï¼cssæ件ï¼åå°æ件ä½ç§¯
- 4ã使ç¨cdnï¼åå°æå¡å¨è´æ
- 5ãæå è½½å¾ç
- 6ãé¢å è½½cssï¼jsæ件
- 7ãé¿å domç»æçæ·±å±æ¬¡åµå¥
- 8ãç»DOMå ç´ æ·»å æ ·å¼æ¶ï¼ææ ·å¼æ¾å°ç±»ä¸ï¼ç´æ¥ç»å ç´ æ·»å ç±»ï¼åå°éæï¼åæµ
CSS
17.ç模åï¼box-sizing
- IEçå模ååW3Cçå模åï¼è®¡ç®widthåheightæ¶ï¼IEçå模åå å«paddingåborder, W3Cçå模ååä¸å æ¬ï¼
- box-sizing: content-box; //æå®çå模å为W3C
- box-sizing: border-box; //æå®çå模å为IEçå模å
18.CSS3æ°ç¹æ§ï¼ä¼ªç±»ï¼ä¼ªå ç´ ï¼é伪类
- ååå·(:)ç¨äºCSS3伪类ï¼ååå·(::)ç¨äºCSS3伪å ç´ ã
- CSS伪类ï¼ç¨äºåæäºéæ©å¨æ·»å ç¹æ®çææãï¼:hover :active :visitedï¼
- CSS伪å ç´ ï¼ç¨äºå°ç¹æ®çæææ·»å å°æäºéæ©å¨ã伪å ç´ ä»£è¡¨äºæ个å ç´ çåå ç´ ï¼è¿ä¸ªåå ç´ è½ç¶å¨é»è¾ä¸åå¨ï¼ä½å´å¹¶ä¸å®é åå¨äºææ¡£æ ä¸ãï¼::before ::afterï¼
19.CSSå®ç°éè页é¢çæ¹å¼
opacity: 0;
visibility: hidden;
display: none;
position: absolute;top: -9999px;left: -9999px
20.å¦ä½å®ç°æ°´å¹³å± ä¸ååç´å± ä¸ã
- marginåwidthå®ç°æ°´å¹³å± ä¸ï¼
- inline-block,并ä¸å¨å ç´ çç¶å®¹å¨ä¸è®¾ç½®text-alignçå±æ§ä¸ºâcenterâï¼
- position: absolute; width: 宽度å¼; left: 50%; margin-left: -(宽度å¼/2);
- flex
21.说说positionï¼display
- staticãrelativeãabsoluteãfixed
- noneãinlineãblockãinline-block
22.请解é*{box-sizing:border-box;}çä½ç¨ï¼å¹¶è¯´æ使ç¨å®ç好å¤
设置以åï¼ç¸å½äºä»¥æªå¼æ¨¡å¼è§£æï¼borderåpaddingå ¨ä¼å¨ä½ 设置ç宽度å é¨ã
æ¯å¦ææºç«¯è®¾ç½®ä¸¤è¡å¹¶åçå¸å±ï¼å®½åº¦å为50%,å¦æä¸ç¨è¿ä¸ªå±æ§ï¼è®¾ç½®borderåå³è¾¹çdivä¼ä¸æ¥éä½ï¼è®¾ç½®è¿ä¸ªå±æ§ï¼å®½åº¦è¿æ¯50%èä¸æ¯50%+*px,两è¡å¯ä»¥å¹¶åæ¾ç¤º
23.æµ®å¨å ç´ å¼èµ·çé®é¢å解å³åæ³ï¼ç»å¯¹å®ä½åç¸å¯¹å®ä½ï¼å ç´ æµ®å¨åçdisplayå¼
é®é¢ï¼
- ç±äºæµ®å¨å ç´ å·²è±ç¦»ææ¡£æµï¼æ以ç¶å ç´ æ æ³è¢«æå¼ï¼å½±åä¸ç¶çº§å ç´ å级çå ç´
- ä¸æµ®å¨å ç´ å级çéæµ®å¨å ç´ ï¼å èå ç´ ï¼ä¼è·éå ¶åï¼ä¹æ¯ç±äºæµ®å¨å ç´ è±ç¦»ææ¡£æµï¼ä¸å æ®ææ¡£æµä¸çä½ç½®ã
- å¦æ该浮å¨å ç´ ä¸æ¯å级第ä¸ä¸ªæµ®å¨çå ç´ ï¼åå®ä¹åçå ç´ ä¹åºè¯¥æµ®å¨ï¼å¦å容æå½±å页é¢çç»ææ¾ç¤ºã
解å³æ¹æ³ï¼
clearï¼bothï¼// 解å³2ã3
ç»ç¶å ç´ æ·»å clearfixæ ·å¼ //解å³1
.clearfix:after{
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
overflow为hiddenæè auto
24.linkå@importå¼å ¥cssçåºå«
- linkæ¯XHTMLæ ç¾ï¼é¤äºå è½½CSSå¤ï¼è¿å¯ä»¥å®ä¹RSSçå ¶ä»äºå¡ï¼@importå±äºCSSèç´ï¼åªè½å è½½CSSã
- linkå¼ç¨CSSæ¶ï¼å¨é¡µé¢è½½å ¥æ¶åæ¶å è½½ï¼@importéè¦é¡µé¢ç½é¡µå®å ¨è½½å ¥ä»¥åå è½½ã
- linkæ¯XHTMLæ ç¾ï¼æ å ¼å®¹é®é¢ï¼@importæ¯å¨CSS2.1æåºçï¼ä½çæ¬çæµè§å¨ä¸æ¯æã
- linkæ¯æ使ç¨Javascriptæ§å¶DOMå»æ¹åæ ·å¼ï¼è@importä¸æ¯æã
25.解éä¸ä¸css3çflexboxï¼ä»¥åéç¨åºæ¯
ä¸ä¸ªç¨äºé¡µé¢å¸å±çå ¨æ°CSS3åè½ï¼Flexboxå¯ä»¥æå表æ¾å¨åä¸ä¸ªæ¹åï¼ä»ä¸å°ä¸æåï¼ä»å·¦å°å³ï¼ï¼å¹¶è®©å表è½å»¶ä¼¸å°å ç¨å¯ç¨ç空é´ã
常è§å¸å±æ¯åºäºååå èæµæ¹åï¼èFlexå¸å±æ¯åºäºflex-flowæµå¯ä»¥å¾æ¹ä¾¿çç¨æ¥åå±ä¸ï¼è½å¯¹ä¸åå±å¹å¤§å°èªéåºã
26.åªäºæ¯å级å ç´ é£äºæ¯è¡çº§å ç´ ï¼åæä»ä¹ç¹ç¹
27.gridå¸å±
ç½æ ¼å¸å±
28.tableå¸å±çä½ç¨
ç¨äºæ¾ç¤ºæ¹éçæ°æ®
29.å®ç°ä¸¤æ å¸å±æåªäºæ¹æ³ï¼
- absolute + padding + %
- float + BFC
.left{float: left; width: 200px;}.right{overflow: hidden;} - flex
.container{display: flex;}.left{width: 200px;}.right{flex: 1;}
30.ä½ ç¥éattributeåpropertyçåºå«ä¹
propertyæ¯DOMä¸çå±æ§ï¼æ¯JavaScriptéç对象ï¼
attributeæ¯HTMLæ ç¾ä¸çç¹æ§ï¼å®çå¼åªè½å¤æ¯å符串ï¼
HTMLæ ç¾ä¸å®ä¹çå±æ§åå¼ä¼ä¿å该DOM对象çattributeså±æ§éé¢ï¼
attributeåpropertyä¹é´çæ°æ®ç»å®æ¯ååçï¼attribute->propertyï¼
æ´æ¹propertyåattributeä¸çä»»æå¼ï¼é½ä¼å°æ´æ°åæ å°HTML页é¢ä¸ï¼
31.csså¸å±é®é¢ï¼csså®ç°ä¸åå¸å±æä¹åï¼å¦æä¸é´æ¯èªéåºåæä¹åï¼
flex
32.æµå¼å¸å±å¦ä½å®ç°ï¼ååºå¼å¸å±å¦ä½å®ç°
- æµå¼å¸å±ï¼Liquidï¼çç¹ç¹ï¼ä¹å«"Fluid") æ¯é¡µé¢å ç´ ç宽度æç §å±å¹å辨çè¿è¡éé è°æ´ï¼ä½æ´ä½å¸å±ä¸åã代表ä½æ æ ç³»ç»ï¼ç½æ ¼ç³»ç»ï¼
- 设计æ¹æ³ï¼ä½¿ç¨%ç¾åæ¯å®ä¹å®½åº¦ï¼é«åº¦å¤§é½æ¯ç¨pxæ¥åºå®ä½ï¼å¯ä»¥æ ¹æ®å¯è§åºå (viewport) åç¶å ç´ çå®æ¶å°ºå¯¸è¿è¡è°æ´ï¼å°½å¯è½çéåºåç§å辨çãå¾å¾é å max-width/min-width çå±æ§æ§å¶å°ºå¯¸æµå¨èå´ä»¥å è¿å¤§æè è¿å°å½±åé 读ã
- ååºå¼è®¾è®¡çç®æ æ¯ç¡®ä¿ä¸ä¸ªé¡µé¢å¨ææç»ç«¯ä¸é½è½æ¾ç¤ºåºä»¤äººæ»¡æçææï¼
- 设计æ¹æ³ï¼åªä½æ¥è¯¢+æµå¼å¸å±ãéå¸¸ä½¿ç¨ @media åªä½æ¥è¯¢ åç½æ ¼ç³»ç» (Grid System) é åç¸å¯¹å¸å±åä½è¿è¡å¸å±ï¼å®é ä¸å°±æ¯ç»¼åååºå¼ãæµå¨çä¸è¿°ææ¯éè¿ CSS ç»åä¸ç½é¡µä¸å设å¤è¿åä¸åæ ·å¼çææ¯ç»ç§°ã
33.移å¨ç«¯å¸å±æ¹æ¡
- éæå¸å±
- æµå¼å¸å±
- èªéåºå¸å±
- ååºå¼å¸å±
- å¼¹æ§å¸å±
- emæ¯ç¸å¯¹å ¶ç¶å ç´
- remæ¯å§ç»ç¸å¯¹äºhtml大å°ï¼å³é¡µé¢æ ¹å ç´
34.å®ç°ä¸æ å¸å±ï¼å£æ¯å¸å±ï¼åé£ç¿¼å¸å±ï¼flexå¸å±ï¼
- å£æ¯å¸å±
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>å®ç°ä¸æ æ°´å¹³å¸å±ä¹å£æ¯å¸å±</title>
<style type="text/css">
.container {
padding: 0 300px 0 200px;
}
.left, .main, .right {
position: relative;
min-height: 130px;
float: left;
}
.left {
left: -200px;
margin-left: -100%;
background: green;
width: 200px;
}
.right {
right: -300px;
margin-left: -300px;
background-color: red;
width: 300px;
}
.main {
background-color: blue;
width: 100%;
}
</style>
</head>
<body>
<div class="container">
ãã<div class="main">main</div>
ãã<div class="left">left</div>
ãã<div class="right">right</div>
</div>
</body>
</html>
- åé£ç¿¼å¸å±
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>å®ç°ä¸æ æ°´å¹³å¸å±ä¹åé£ç¿¼å¸å±</title>
<style type="text/css">
.left, .main, .right {
float: left;
min-height: 130px;
text-align: center;
}
.left {
margin-left: -100%;
background: green;
width: 200px;
}
.right {
margin-left: -300px;
background-color: red;
width: 300px;
}
.main {
background-color: blue;
width: 100%;
}
.content{
margin: 0 300px 0 200px;
}
</style>
</head>
<body>
<div class="container">
ãã<div class="main">
ãã<div class="content">main</div>
</div>
ãã<div class="left">left</div>
ãã<div class="right">right</div>
</div>
</body>
</html>
- flexå¸å±
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>å®ç°ä¸æ æ°´å¹³å¸å±ä¹Flexå¸å±</title>
<style type="text/css">
.container{
display: flex;
min-height: 130px;
}
.main{
flex-grow: 1;
background-color: blue;
}
.left{
order: -1;
flex-basis: 200px;
background-color: green;
}
.right{
flex-basis: 300px;
background-color: red;
}
</style>
</head>
<body>
<div class="container">
ãã<div class="main">main</div>
ãã<div class="left">left</div>
ãã<div class="right">right</div>
</div>
</body>
</html>
35.æ¸ é¤æµ®å¨çåç
å½å ç´ è®¾ç½®äºoverflowæ ·å¼ï¼ä¸å¼ä¸ä¸ºvisibleæ¶ï¼è¯¥å ç´ å°±å»ºæäºä¸ä¸ªBFC, BFCçé«åº¦æ¯è¦å æ¬æµ®å¨å ç´ çï¼æ以浮å¨å ç´ çé«åº¦è¢«æèµ·æ¥ï¼è¾¾å°äºæ¸ é¤æµ®å¨å½±åçç®ç
36.overflow:hiddenæä»ä¹ç¼ºç¹ï¼
å½ç¶å ç´ çé«åº¦æ¯é åå ç´ æå¼çæ¶åï¼åå ç´ æµ®å¨æ¶ï¼åå¨ç¶å ç´ ä½¿ç¨overflow: hiddenå¯ä»¥æ¸ é¤æµ®å¨ï¼ä½¿å¾ç¶å ç´ çé«åº¦ä¾æ§æ¯é åå ç´ æå¼ã
å½ç¶å ç´ èªèº«è®¾ç½®äºheightå±æ§å¼ï¼åå¨ç¶å ç´ ä½¿ç¨overflow: hiddenå¯ä»¥ä½¿åå ç´ è¶ åºç¶å ç´ çé£é¨åéèã
37.paddingç¾åæ¯æ¯ç¸å¯¹äºç¶çº§å®½åº¦è¿æ¯èªèº«ç宽度
ç¶çº§å®½åº¦
38.css3å¨ç»ï¼transitionåanimationçåºå«ï¼animationçå±æ§ï¼å é度ï¼éåç模æå®ç°
- transitionç¨äºè®¾ç½®å个è¿æ¸¡å±æ§ï¼å®ä¹äºå¨ç»çå±æ§ãæ¶é´ãé度æ²çº¿ä»¥å延è¿æ¶é´ ï¼é常åhoverçäºä»¶é å使ç¨ï¼ç±äºä»¶è§¦åãtranistion åªè½è®¾å®å¤´å°¾
.one1{
transition: width 3s linear 2s;
}
.one1:hover{
width:300px;
}
- animationç使ç¨å¿ é¡»ç»å@keyframes animation-name使ç¨ï¼å¯ä»¥è®¾å®æ¯ä¸å¸§çæ ·å¼åæ¶é´
@keyframes move{
form{ left:0px;}
to{ left:200px;}
}
- å¨éè¦å¨ç»çå ç´ ä¸é¢æ·»å å¨ç» div{animation:move 5s infinite;}
- animation: name duration timing-function delay iteration-count direction;ï¼å¨ç»å称ï¼å¨ç»æ§è¡æ¶é´ï¼é度æ²çº¿ï¼å¨ç»å»¶è¿æ¶é´ï¼ææ¾æ¬¡æ°ï¼æ¯å¦ååææ¾ï¼
39.CSS 3 å¦ä½å®ç°æ转å¾çï¼transform: rotateï¼
@-webkit-keyframes rotation{
from {-webkit-transform: rotate(0deg);}
to {-webkit-transform: rotate(360deg);}
}
.rotation{
-webkit-transform: rotate(360deg);
animation: rotation 3s linear infinite;
-moz-animation: rotation 3s linear infinite;
-webkit-animation: rotation 3s linear infinite;
-o-animation: rotation 3s linear infinite;
}
40.sass less
Sassæ¯å¯¹CSSï¼å±å æ ·å¼è¡¨ï¼çè¯æ³çä¸ç§æ©å ï¼è¯çäº2007å¹´ï¼ææ©ä¹æ¯ææççä¸æ¬¾CSSé¢å¤çå¨è¯è¨ï¼å® å¯ä»¥ä½¿ç¨åéã常éãåµå¥ãæ·· å ¥ãå½æ°çåè½ï¼å¯ä»¥æ´æææå¼¹æ§çååºCSS
41.对移å¨ç«¯å¼åäºè§£å¤å°ï¼ï¼ååºå¼è®¾è®¡ãZeptoï¼@mediaãviewportãJavaScript æ£å表达å¼å¤æå¹³å°ãï¼
42.ä»ä¹æ¯bfcï¼å¦ä½å建bfcï¼è§£å³ä»ä¹é®é¢ï¼
åçº§æ ¼å¼åä¸ä¸æ;
æµ®å¨å
ç´ ä¼å½¢æBFC
- é«åº¦å¡é·é®é¢;
- divæµ®å¨å å¼é®çé®é¢;
- marginå¡é·é®é¢
43.CSSä¸çé¿åº¦åä½ï¼px,pt,rem,em,ex,vw,vh,vh,vmin,vmaxï¼
44.CSS éæ©å¨çä¼å 级æ¯ææ ·çï¼
!important > è¡å æ ·å¼>IDéæ©å¨ > ç±»éæ©å¨ > æ ç¾ > éé 符 > ç»§æ¿ > æµè§å¨é»è®¤å±æ§
45.åªä½æ¥è¯¢çåçæ¯ä»ä¹ï¼
46.CSS çå è½½æ¯å¼æ¥çåï¼è¡¨ç°å¨ä»ä¹å°æ¹ï¼
47.常éå°çæµè§å¨å ¼å®¹æ§é®é¢æåªäºï¼å¸¸ç¨çhackçæå·§
- margin åpaddingå·®å¼è¾å¤§: éé 符*æ¥è®¾ç½®å个æ ç¾çå å¤è¡¥ä¸æ¯0
- åå±æ§æ ç¾floatåï¼åæ横è¡çmarginæ åµä¸ï¼å¨IE6æ¾ç¤ºmarginæ¯è®¾ç½®ç大: å¨floatçæ ç¾æ ·å¼æ§å¶ä¸å å ¥ display:inline;
- 设置è¾å°é«åº¦æ ç¾ï¼ä¸è¬å°äº10pxï¼ï¼å¨IE6ï¼IE7ï¼é¨æ¸¸ä¸é«åº¦è¶ åºèªå·±è®¾ç½®é«åº¦: ç»è¶ åºé«åº¦çæ ç¾è®¾ç½®overflow:hidden;
- å¾çé»è®¤æé´è·: 使ç¨floatå±æ§ä¸ºimgå¸å±
48.å¤è¾¹è·å并
- 两个æå¤ä¸ªæ¯é»çæ®éæµä¸çåå ç´ åç´æ¹åä¸ç margin ä¼æå
- 解å³æ¹æ³ï¼å¨åçæ¶åå°½éç¨åä¸æ¹åçmarginï¼æ¯å¦é½è®¾ç½®ä¸ºtopæè bottom
49.解éä¸ä¸â::beforeâåâ:afterâä¸çååå·åååå·çåºå«-
- é½æ¯CSS伪å ç´
- ååå·æ¯CSS2ä¸æåºæ¥çï¼æä»¥å ¼å®¹æ§å¯è½å°IE8ï¼
- ååå·æ¯CSS3ä¸çåæ³ï¼ä¸ºäºå°ä¼ªç±»å伪å ç´ åºåå¼ï¼
上一篇: 【前端面试】防抖节流
下一篇: java静态代理、动态代理
推荐阅读
-
DOM【介绍、HTML中的DOM、XML中的DOM】
-
天意商务系统后台管理帐号破解html版
-
移除行块级元素之间的空格(译文)_html/css_WEB-ITnose
-
Javascript获取CSS伪元素属性的实现代码_javascript技巧
-
å¦ä½å¼åææºç½é¡µ_html/css_WEB-ITnose
-
如何把视频url传入播放器_html/css_WEB-ITnose
-
Bootstrap全局CSS样式之表单_html/css_WEB-ITnose
-
$变量 是web开发里的哪种语言_html/css_WEB-ITnose
-
基于CSS3淡入淡出效果的图片轮播_html/css_WEB-ITnose
-
php过滤HTML标签、属性等正则表达式汇总