{"id":162,"date":"2011-07-23T10:38:00","date_gmt":"2011-07-23T02:38:00","guid":{"rendered":"http:\/\/gaigaiming.com\/?p=162"},"modified":"2011-07-23T10:38:00","modified_gmt":"2011-07-23T02:38:00","slug":"css%e5%9c%86%e8%a7%92","status":"publish","type":"post","link":"https:\/\/www.gaigaiming.com\/index.php\/2011\/07\/23\/css%e5%9c%86%e8%a7%92\/","title":{"rendered":"css\u5706\u89d2"},"content":{"rendered":"<div>\n<p>\u3010\u8f6c\u8f7d\u3011uecss.com<\/p>\n<p>css3\u548chtml5 \u5728\u5927\u5bb6\u7684\u773c\u4e2d\u5df2\u7ecf\u4e0d\u662f\u4ec0\u4e48\u65b0\u9c9c\u7684\u4e8b\u4e86\uff0c\u4f46\u662f\u80fd\u517c\u5bb9\u5b83\u7684\u6d4f\u89c8\u5668\u5374\u4e0d\u662f\u5168\u90e8\uff0c\u800c\u6211\u53ea\u662f\u7b80\u5355\u7684\u770b\u4e86\u5b83\u4eec\u7684\u4e00\u4e9b\u5c5e\u6027\uff0c\u7b80\u5355\u7684\u6027\u7684\u4e86\u89e3\u4e86\u4e00\u4e0b\u3002\u524d\u4e9b\u65f6\u95f4\u4e00\u4e2a\u540c\u4e8b\u8ba9\u6211\u5199\u4e00\u4e2a\u5706\u89d2\u7684div\uff0c\u8981\u6c42\u662f\u5c3d\u91cf\u5c11\u653e\u56fe\u7247\uff0c\u6211\u60f3\u5230\u4e86css3\u4e2d\u6709\u8fd9\u4e2a\u5c5e\u6027<br \/>\u5728\u7f51\u4e0a\u67e5\u4e86\u67e5\u53d1\u73b0\u5199\u5706\u89d2\u7684\u65b9\u6cd5\u8fd8\u662f\u6709\u5f88\u591a\u7684\u3002\u5927\u6982\u7684\u603b\u7ed3\u4e86\u4ee5\u4e0b\u51e0\u70b9\uff1a<\/p>\n<p><strong>1.\u7075\u6d3b\u7684\u5706\u89d2<\/strong><\/p>\n<p>\u4e3a\u4e86\u80fd\u8ba9\u5706\u89d2\u66f4\u52a0\u7075\u6d3b\uff0c\u6211\u4eec\u53ef\u4ee5\u628a\u5bb9\u5668\u91cc\u7684\u6bcf\u4e2a\u5706\u89d2\u90fd\u505a\u6210\u4e00\u4e2a\u72ec\u7acb\u7684\u5143\u7d20\uff0c\u901a\u8fc7CSS\u5f3a\u884c\u5b9a\u4f4d\u5230\u7236\u5bb9\u5668\u7684\u56db\u4e2a\u89d2\u4e0a\u3002\u5728\u8fd9\u4e2a\u65b9\u6cd5\u91cc\uff0c\u6211\u4eec\u53ea\u9700\u8981\u7528\u5230\u4e0b\u8fb9\u8fd9\u4e2a\u56fe\u7247\u3002<\/p>\n<p><a href=\"http:\/\/uecss.com\/wp-content\/uploads\/2010\/04\/crnr-sprite.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/album\/pic\/item\/dfadb200c3049cb0267fb5cc.jpg\" width=\"40\" height=\"40\" \/><\/a><\/p>\n<p><strong>HTML:<\/strong><\/p>\n<\/p>\n<p>&lt;div class=&quot;box&quot;&gt;&nbsp;&nbsp;<\/p>\n<p>&nbsp;&lt;span class=&quot;crnr tl&quot;&gt;&lt;\/span&gt;&nbsp; &lt;span class=&quot;crnr tr&quot;&gt;&lt;\/span&gt;&nbsp;<\/p>\n<\/p>\n<\/p>\n<\/p>\n<p>&nbsp;&lt;h3&gt;This is a heading&lt;\/h3&gt;&nbsp;<\/p>\n<p>&nbsp;&lt;p&gt;Lorem ipsum dolor sit amet,consectetur adipiscing elit. Sed vehicula ligula eu diam tincidunt fermentum. Curabitur facilisis enim non libero cursus eu varius enim suscipit. Ut venenatis vehicula lorem ut hendrerit. Ut adipiscing augue sed ante volutpat eget ornare erat facilisis. In hac habitasse platea dictumst.&lt;\/p&gt;&nbsp;<\/p>\n<p>&nbsp;&lt;span class=&quot;crnr bl&quot;&gt;&lt;\/span&gt; &lt;span class=&quot;crnr br&quot;&gt;&lt;\/span&gt;&nbsp;<\/p>\n<p>&lt;\/div&gt;<\/p>\n<\/p>\n<p><strong>CSS<\/strong><\/p>\n<p>.box{<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;position:relative;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;width:200px;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;height:300px;}<\/p>\n<p>.crnr{<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;position:absolute;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;background:url(&quot;http:\/\/uecss.com\/wp-content\/uploads\/2010\/04\/crnr-sprite.jpg&quot;)no-repeat;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;width:20px;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;height:20px;<\/p>\n<\/p>\n<p>&nbsp;}<\/p>\n<\/p>\n<p>.tl{<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; left:0;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; top:0;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; background-position:00;<\/p>\n<p>}<\/p>\n<p>.tr{ &nbsp;&nbsp;right:0;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;top:0;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; background-position:-20px0;<\/p>\n<p>}<\/p>\n<p>.bl{ &nbsp;&nbsp;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; left:0;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bottom:0;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; background-position:0-20px;<\/p>\n<p>}<\/p>\n<p>.br{right:0;bottom:0;background-position:-20px-20px;}<\/p>\n<p>\u4f18\u70b9\uff1a\u80fd\u81ea\u52a8\u9002\u5e94\u7236\u5bb9\u5668\u7684\u5927\u5c0f\uff0c\u6d4f\u89c8\u5668\u517c\u5bb9\u6027\u975e\u5e38\u5f3a\u3002<\/p>\n<p>\u7f3a\u70b9\uff1a\u4e3a\u4e86\u5b9e\u73b0\u5706\u89d2\uff0c\u6dfb\u52a0\u4e86\u4e00\u4e9b\u6ca1\u6709\u610f\u4e49\u7684\u6807\u8bb0\u3002<\/p>\n<p><strong>2.Border radius\uff08\u8fb9\u754c\u534a\u5f84\uff09<\/strong><\/p>\n<p>css3\u4e2d\u4e3aboder\u589e\u52a0\u7684\u4e00\u4e2a\u5c5e\u6027border-radius\uff0c\u76ee\u524d\u8fd9\u4e2a\u5c5e\u6027\u5df2\u7ecf\u88abFirefox\u548cSafari 3(Chrome)\u652f\u6301\uff0c\u6bd4\u8f83\u9057\u61be\u7684\u662fIE\u4e0d\u652f\u6301\u6b64\u5c5e\u6027\u3002<\/p>\n<p>HTML:<\/p>\n<p>&lt;div class=&quot;box&quot;&gt;&nbsp;<\/p>\n<p>&nbsp;&lt;h3&gt;This is a heading&lt;\/h3&gt;&nbsp;<\/p>\n<p>&nbsp;&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vehicula ligula eu diam tincidunt fermentum. Curabitur facilisis enim non libero cursus eu varius enim suscipit. Ut venenatis vehicula lorem ut hendrerit. Ut adipiscing augue sed ante volutpat eget ornare erat facilisis. In hac habitasse platea dictumst.&lt;\/p&gt;&nbsp;<\/p>\n<p>&lt;\/div&gt;<\/p>\n<p>CSS:<\/p>\n<p>.box{width:200px;height:200px;background-color:#EE2E24;-moz-border-radius:20px;-webkit-border-radius:20px;border-radius:20px;}<\/p>\n<p>\u4f18\u70b9\uff1a\u8fd9\u79cd\u65b9\u6cd5\u4e0d\u9700\u8981\u6dfb\u52a0\u4efb\u4f55\u591a\u4f59\u7684\u6807\u8bb0\uff0c\u800c\u4e14\u53ef\u4ee5\u975e\u5e38\u65b9\u4fbf\u7747\u4fee\u6539\u5706\u89d2\u7684\u534a\u5f84\uff0c\u662f\u6700\u6613\u4e0a\u624b\u7684\u65b9\u6cd5\u3002<\/p>\n<p>\u7f3a\u70b9\uff1a\u867d\u7136\u7b26\u5408W3C\u7684\u6807\u51c6\uff0c\u4f46\u7f3a\u4e4f\u6d4f\u89c8\u5668\u652f\u6301\u3002<\/p>\n<p><strong>3.\u591a\u4e2a\u80cc\u666f\u56fe\u7247<\/strong><\/p>\n<p>CSS3\u5bf9background\u5c5e\u6027\u505a\u51fa\u4e86\u4e00\u4e9b\u91cd\u5927\u6539\u8fdb\uff0c\u5728CSS3\u6807\u51c6\u91cc\uff0c\u6211\u4eec\u53ef\u4ee5\u628a\u591a\u4e2a\u80cc\u666f\u56fe\u7247\u5e94\u7528\u5230\u540c\u4e00\u4e2a\u5143\u7d20\u91cc\u3002\u6211\u4eec\u5229\u7528\u8fd9\u4e2a\u7279\u6027\u4e3a\u5bb9\u5668\u52a0 \u4e0a\u5706\u89d2\u6548\u679c\u3002HTML\u4ee3\u7801\u4e0e\u4e0a\u4f8b\u4fdd\u6301\u4e00\u81f4\uff0c\u5728CSS\u4e2d\u9700\u8981\u5148\u628a\u56db\u4e2a\u5706\u89d2\u7684\u56fe\u7247\u5206\u522b\u505a\u597d<\/p>\n<p>CSS:<\/p>\n<p>.box{<\/p>\n<p>background:url(top-left.gif)topleftno-repeat,<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;url(top-right.jpg)toprightno-repeat,<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; url(bottom-left.gif)bottomleftno-repeat,<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;url(bottom-right.gif)bottomrightrepeat-y;<\/p>\n<p>}<\/p>\n<p>\u4f18\u70b9\uff1a\u6ca1\u6709\u591a\u4f59\u7684\u6807\u8bb0\uff0c\u53ef\u4ee5\u5206\u522b\u8bbe\u7f6e\u6bcf\u4e2a\u5706\u89d2\u7684\u534a\u5f84\u3002<\/p>\n<p>\u7f3a\u70b9\uff1a\u4f7f\u7528\u4e86W3C\u672a\u660e\u786e\u5b9a\u4e49\u7684\u65b9\u6cd5\uff0c\u6d4f\u89c8\u5668\u517c\u5bb9\u6027\u5f88\u5dee\uff0c\u76ee\u524d\u53ea\u6709Safari\u548cChrome\u5bf9\u6b64\u65b9\u6cd5\u652f\u6301\u826f\u597d\u3002<\/p>\n<p><strong>4.\u7ed3\u5408CSS3\u548cJavaScript,\u517c\u5bb9\u6240\u6709\u6d4f\u89c8\u5668<\/strong><\/p>\n<p>\u8fd9\u662f\u4e00\u79cd\u5f88\u4e0d\u9519\u7684\u5b9e\u73b0\u8de8\u6d4f\u89c8\u5668\u5706\u89d2\u7684\u89e3\u51b3\u65b9\u6848\uff0c\u7ed3\u5408CSS3\u548cJavaScript\u3002CurvyCorners\u662f\u4e00\u4e2a\u4e3aHTML\u5143\u7d20\u521b\u5efa\u6f02\u4eae\u7684\u5706\u89d2\u7684\u514d\u8d39J\u8be5\u811a\u672c\u7684\u6700\u5927\u4f18\u52bf\u662f\u53ef\u4ee5\u5728Safari\/Chrome\/Firefox\u4e2d<br \/>\u4f7f\u7528\u539f\u751f\u7684CSS3\u5c5e\u6027(\u901a\u8fc7-webkit-border-radius\u548c-moz-border-radius\u79c1\u6709\u5c5e\u6027\u5206\u522b\u652f\u6301)\u800c\u5728IE\u548cOpera\u4e2d\u4f7f\u7528JavaScript\u3002<\/p>\n<p>\u4f60\u6240\u9700\u8981\u505a\u7684\u5c31\u662f\u5728\u9875\u9762\u4e2d\u5f15\u5165curvycorners.js:avaScript\u5e93\u3002<\/p>\n<p><a href=\"http:\/\/cid-8127d59343265667.skydrive.live.com\/self.aspx\/NamipanPublic\/curvycorners.js\">\u4e0b\u8f7d\u8fd9\u4e2ajs<\/a><\/p>\n<p>\u7136\u540e\u5f15\u7528<\/p>\n<p>&lt;script type=&quot;text\/javascript&quot;src=&quot;curvycorners.js&quot;&gt;&lt;\/script&gt;<\/p>\n<p>\u7136\u540e\u5b9a\u4e49\u4ee5\u4e0b\u6837\u5f0f\uff1a<\/p>\n<p>.box{<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; width:220px;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; padding:10px;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;background-color:#DDEEF6;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; border:1pxsolid#DDEEF6;\/* Do rounding (native in Safari, Firefox and Chrome) *\/-webkit-border-radius:6px;-moz-border-radius:6px;}<\/p>\n<p>\u7136\u540e\u5728\u4e0a\u9762\u7684\u6837\u5f0f\u540e\u9762\u5b9a\u4e49\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/p>\n<p>&lt;script type=&quot;text\/JavaScript&quot;&gt;addEvent(window,&#8217;load&#8217;,initCorners);<\/p>\n<p>functioninitCorners(){varsetting={tl:{radius:6},tr:{radius:6},bl:{radius:6},br:{radius:6},antiAlias:true}curvyCorners(setting,&quot;.roundedCorners&quot;);}&lt;\/script&gt;<\/p>\n<p>tl, tr, bl, br\u5206\u522b\u662f:\u5de6\u4e0a\u89d2(top-left)\u3001\u53f3\u4e0a\u89d2(top-right)\u3001\u5de6\u4e0b\u89d2(bottom-left)\u3001\u53f3\u4e0b\u89d2(bottom-right)\u3002<\/p>\n<\/p>\n<p>\u5982\u679c\u4f60\u6709\u4e0d\u540c\u7684CSS\u7c7b(\u4f8b\u5982roundedCorners\u3001roundedCorners_1\u3001roundedCorners_2\u7b49) \u4f60\u53ef\u4ee5\u50cf\u8fd9\u6837\u5728\u524d\u9762\u7684\u4ee3\u7801\u4e2d\u5b9a\u4e49:<\/p>\n<p>&#8230;curvyCorners(setting,&quot;.roundedCorners&quot;);<\/p>\n<p>curvyCorners(setting,&quot;.roundedCorners_1&quot;);<\/p>\n<p>curvyCorners(setting,&quot;.roundedCorners_2&quot;);&#8230;<\/p>\n<p>HTML\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<p>&lt;div class=&quot;box&quot;&gt; &lt;\/div&gt;<\/p>\n<p>\u8fd9\u6837\u5706\u89d2\u7684\u6548\u679c\u5c31\u51fa\u73b0\u4e86\uff01<\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u3010\u8f6c\u8f7d\u3011uecss.com css3\u548chtml5 \u5728\u5927\u5bb6\u7684\u773c\u4e2d\u5df2\u7ecf\u4e0d\u662f\u4ec0\u4e48\u65b0\u9c9c\u7684\u4e8b\u4e86\uff0c\u4f46\u662f\u80fd\u517c\u5bb9\u5b83\u7684\u6d4f\u89c8\u5668\u5374\u4e0d [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-162","post","type-post","status-publish","format-standard","hentry","category-4"],"_links":{"self":[{"href":"https:\/\/www.gaigaiming.com\/index.php\/wp-json\/wp\/v2\/posts\/162","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gaigaiming.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gaigaiming.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gaigaiming.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gaigaiming.com\/index.php\/wp-json\/wp\/v2\/comments?post=162"}],"version-history":[{"count":0,"href":"https:\/\/www.gaigaiming.com\/index.php\/wp-json\/wp\/v2\/posts\/162\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.gaigaiming.com\/index.php\/wp-json\/wp\/v2\/media?parent=162"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gaigaiming.com\/index.php\/wp-json\/wp\/v2\/categories?post=162"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gaigaiming.com\/index.php\/wp-json\/wp\/v2\/tags?post=162"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}