首頁 › Plurk2:花水木版圓角作法&原始檔
Plurk2:花水木版圓角作法&原始檔
這個貼紙的圓角邊框作法是參考這個網站製作的。
http://www.schillmania.com/content/projects/even-more-rounded-corners/
他的好處是
- 沒有javascript,速度快
- 只需要一張圖就可以有圓角邊框
- 區塊寬和高都可以隨意設定
- 透明的背景,很漂亮
他的壞處是
- 內容如果太複雜有時會跑版
- XHTML/CSS code不算簡潔
- 圖檔不算小(15~20K)
不過對我來說好處大於壞處,所以還是使用了。背景圖檔他有給原始檔,可以去那邊下載,本文最下面的下載是Plurk2貼紙的背景。有PLURKPlug字樣。
作法
在HTML的地方輸入
<div class="dialog"> <div class="content"> <div class="t"></div> 這裡放你的內容 </div> <div class="b"><div></div></div> </div>
在CSS的地方輸入
/* -- Even more rounded corners with CSS: Base stylesheet -- */ .dialog { position:relative; margin:0px auto; min-width:8em; max-width:760px; /* based on image dimensions - not quite consistent with drip styles yet */ color:#fff; z-index:1; margin-left:12px; /* default, width of left corner */ margin-bottom:0.5em; /* spacing under dialog */ } .dialog .content, .dialog .t, .dialog .b, .dialog .b div { background:transparent url(dialog2-blue-800x1600.png) no-repeat top right; _background-image:url(dialog2-blue.gif); } .dialog .content { position:relative; zoom:1; _overflow-y:hidden; padding:0px 12px 0px 0px; } .dialog .t { /* top+left vertical slice */ position:absolute; left:0px; top:0px; width:12px; /* top slice width */ margin-left:-12px; height:100%; _height:1600px; /* arbitrary long height, IE 6 */ background-position:top left; } .dialog .b { /* bottom */ position:relative; width:100%; } .dialog .b, .dialog .b div { height:30px; /* height of bottom cap/shade */ font-size:1px; } .dialog .b { background-position:bottom right; } .dialog .b div { position:relative; width:12px; /* bottom corner width */ margin-left:-12px; background-position:bottom left; } .dialog .hd, .dialog .bd, .dialog .ft { position:relative; } .dialog .wrapper { /* extra content protector - preventing vertical overflow (past background) */ position:static; max-height:1000px; overflow:auto; /* note that overflow:auto causes a rather annoying redraw "lag" in Firefox 2, and may degrade performance. Might be worth trying without if you aren't worried about height/overflow issues. */ } .dialog h1 .dialog p { margin:0px; /* margins will blow out backgrounds, leaving whitespace. */ padding:0.5em 0px 0.5em 0px; } .dialog h1 { padding-bottom:0px; }
事實上他的CSS寫得很細,但不代表完全不需要微調,我甚至還改了許多選擇器(Selector)的名稱,所以其實我的code現在很亂,應該要來整理一下了。
- 人氣(5205)
最新回應
- 我工作的公司在找能協助維護一個用Drupal
12 小時 55 秒前 - lol ,花水木粉絲萬歲~
1 周 14 小時前 - 其實在下原本就是花水木的fans啦…只是一直都不敢回文
5 周 1 天前 - 请问,可否发一个license呢
xiang.leau@g
6 周 5 天前 - 直接用 “display:none;”
6 周 6 天前 - 我用過Webwait,不錯,大家都用用吧!
7 周 12 小時前 - 講到Drupal的滿意度那麼高,界面漂亮,功能強,我也要用
7 周 1 天前 - 真是AJAX吗?
7 周 5 天前 - joomla很好,我就一直使用,但是mootools会使网
8 周 6 天前 - Very good post, thanks a lot.
9 周 1 天前
熱門內容
- Plurk2:噗浪插頭的貼紙美化 (10,506)
- [Module] AJAX Comments (6,115)
- Plurk2:花水木版圓角作法&原始檔 (5,205)
- [網站易用性] 下拉式選單的迷思 (4,718)
- Drupal開發用版型 (4,178)
找我聊聊
敲我MSN吧!
若我MSN下班,搞不好在這
或是在這













回應
真想試試看~XD
但是好像又很麻煩
感覺不錯~真想試試看~
但是感覺也很麻煩~又很懶
終於找到你了,就是這個......圓角,謝謝花水妹姊姊!XD
發表新回應