yuicompressor+ant »ìÏýѹËõ¶à¸öjsºÍcssÎļþ·½·¨
1¡¢ÏÂÔØ yuicompressor °ü
Ê×Ïȵ½¹Ù·½ÍøÕ¾ http://yuilibrary.com/downloads/#yuicompressor ÉÏÏÂÔØ yuicompressor-2.4.2.zip ×ÊÔ´°ü¡£½âѹºó yuicompressor-2.4.2.jar ÔÚ yuicompressor-2.4.2\build Ŀ¼Ï¡£
2¡¢´´½¨build-yui.xml Îļþ
È»ºó´´½¨ant ÔËÐеÄÎļþ£¬ÄÚÈÝÈçÏ£º
<?xml version="1.0" encoding="UTF-8"?>
<project name="MyTask" basedir="." default="compress-css">
<property name="src.dir" value="./src"/>
<target name="compress-js">
<apply executable="java" parallel="false" failonerror="true"
dest="${src.dir}/dest"
append="false" force="true">
<fileset
dir="${src.dir}"
includes="js/**.js" />
<arg line="-jar" />
<arg path="yuicompressor-2.4.2.jar" />
<arg line="--charset utf-8" />
<srcfile />
<arg line="-o" />
<mapper type="glob" from="*.js" to="*.js" />
<targetfile />
<arg line="--nomunge" /><!--ֻѹËõÈ¥µô¿Õ¸ñ£¬²»»ìÏý-->
</apply>
</target>
<target name="compress-css">
<apply executable="java" parallel="false" failonerror="true"
 
Ïà¹ØÎĵµ£º
Í·£ºheader
¡¡¡¡ÄÚÈÝ£ºcontent/container
¡¡¡¡Î²£ºfooter
¡¡¡¡µ¼º½£ºnav
¡¡¡¡²àÀ¸£ºsidebar
¡¡¡¡À¸Ä¿£ºcolumn
¡¡¡¡Ò³ÃæÍâΧ¿ØÖÆÕûÌå²¼¾Ö¿í¶È£ºwrapper
¡¡¡¡×óÓÒÖУºleft right center
¡¡¡¡µÇ¼Ìõ£ºloginbar
¡¡¡¡±êÖ¾£ºlogo
¡¡¡¡¹ã¸æ£ºbanner
¡¡¡¡Ò³ÃæÖ÷Ì壺main
¡¡¡¡Èȵ㣺hot
¡¡¡¡ÐÂÎÅ£ºnews
¡¡¡¡ÏÂÔØ£ºdown ......
CSS HackËÙ¼Ç: *html , IE +html , IE _html , IE6 *+html , IE7 height/*\**/,IE8 ±ØÐë±£Ö¤HTML¶¥²¿ÓÐÈçÏÂÉùÃ÷:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> ʾÀý height:100px;¡¾FF¡¿ ......
Ëæ×Å×îÐÂCSSµÄ²»¶ÏÍêÉÆ£¬Ô½À´Ô½¶àµÄÍøÕ¾²ÉÓÃDIV+CSS²¼¾Ö¡£¶øÔÀ´Ê¹ÓÃtableÌ×tableµÄÍøÒ³²¼¾ÖģʽҲÖð½¥Ó¦¸ÃÌÔÌÁË¡£ÓÉÓÚÄ¿Ç°IE6²»ÄÜÖ§³ÖÓÐЩ±ê×¼µÄCSS£¬ÐèÒªÓÃ΢ÈíÌØÓеÄCSSÀ´ÐÞ¸´ÕâЩBUG.¶øÇÒÏÖÔÚËæ×Åä¯ÀÀÆ÷²ã³ö²»ÇҪÊÇÒ³ÃæÄܹ»ÊÊÓ¦¾¡Á¿¶àµÄä¯ÀÀÆ÷³ÉΪһ¸ö¿ÎÌâ¡£ µ«ÊÇËæ×ÅCSS±ê×¼µÄ½øÒ»²½ÍêÉÆ£¬ä¯ÀÀÆ÷½«×îÖÕ¶¼»á×ñÑÕ⸠......