Plurk2:花水木版圓角作法&原始檔

XHTML+CSS

這個貼紙的圓角邊框作法是參考這個網站製作的。
http://www.schillmania.com/content/projects/even-more-rounded-corners/

他的好處是

  1. 沒有javascript,速度快
  2. 只需要一張圖就可以有圓角邊框
  3. 區塊寬和高都可以隨意設定
  4. 透明的背景,很漂亮

他的壞處是

  1. 內容如果太複雜有時會跑版
  2. XHTML/CSS code不算簡潔
  3. 圖檔不算小(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現在很亂,應該要來整理一下了。

回應

真想試試看~XD
但是好像又很麻煩

感覺不錯~真想試試看~
但是感覺也很麻煩~又很懶

終於找到你了,就是這個......圓角,謝謝花水妹姊姊!XD

發表新回應

這個欄位的內容會保密,不會公開顯示。 If you have a Gravatar account, used to display your avatar.
  • 自動將網址與電子郵件位址轉變為連結。
  • 可使用的 HTML 標籤:<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • 自動斷行和分段。

更多關於格式選項的資訊