Skip to content

Zeroplex 生活隨筆

軟體開發、伺服器和生活瑣事

小 縮小字型大小。 中 重設字型大小。 大 放大字型大小。

月份: 2010 年 2 月

CSS 圓角矩形

Posted on 2010 年 2 月 15 日2021 年 3 月 12 日 By 日落 在〈CSS 圓角矩形〉中有 1 則留言

在 LESS 看到的:

.rounded_corners {
  -moz-border-radius: 10px;
  -webkit-border-radius: 10px;
  border-radius: 10px;
}
Tags:網頁設計

LESS make less code to CSS

Posted on 2010 年 2 月 15 日2021 年 3 月 12 日 By 日落 在〈LESS make less code to CSS〉中尚無留言

LESS 是一個用 Ruby 寫成的 CSS 產生器,可以讓習慣寫成是的人將 CSS 程式、模組化,在交由 LESS 轉成正式的 CSS 發佈。

例如事先定義:

@my_color: #f00;

之後可以在各個 class 用到:

.top {
   ...
   font-color: @my_color;
}

.main {
   background-color: @my_color;
}

感謝 Jefflen 推薦。

LESS – leaner CSS
http://lesscss.org/

Tags:網頁設計

CSS width in box module

Posted on 2010 年 2 月 14 日2021 年 3 月 12 日 By 日落 在〈CSS width in box module〉中有 3 則留言

今天遇到的鳥問題:CSS 中真正的 width 要等於 margin + border + padding + 設定的 width。

假設原本的 DIV 設定如下:

.box {
   width: 800px;
}

若要讓原本的區塊寬度不變但要加上 20px 的 padding 必須這樣設定:

.box-padding {
   padding-left: 20px;
   padding-right: 20px;
   width: 760px; /* 800 - 20 - 20 = 760 */
}
Tags:網頁設計

新年快樂

Posted on 2010 年 2 月 13 日2021 年 3 月 12 日 By 日落 在〈新年快樂〉中尚無留言

祝大家新年快樂 && 情人節快樂!!!

ps. 這篇好短啊 … 囧

scanf 讀取包含空白的字串

Posted on 2010 年 2 月 1 日2021 年 3 月 12 日 By 日落 在〈scanf 讀取包含空白的字串〉中有 2 則留言

一般來說 scanf 遇到空白、t、n 就會自動中斷:

scanf("%s",str);  // 輸入「hello world」
printf("%s",str);  // 輸出「hello」

剛剛發現 scanf 可以自定欲接收的字元,改一下就可以接收空白等字元:

scanf("%[^n]",str);  // 接收除了 n 以外的所有字元
printf("%s",str);  // 輸出完整的「hello world」

參考資料:C Gossip: printf() 與 scanf()
http://caterpillar.onlyfun.net/Gossip/CGossip/PrintfScanf.html

文章分頁

上一頁 1 2

其他

關於我  (About me)

小額贊助

  文章 RSS Feed

  留言 RSS Feed

Apache AWS Bash C/C++ Docker FreeBSD GCP Git Google Java JavaScript Laravel Linux Microsoft MSSQL MySQL Nginx PHP PHPUnit PostgreSQL Python Qt Ubuntu Unix Vim Web Windows WordPress XD 作業系統 分享 好站推薦 專題 攝影 新奇搞笑 新聞 旅遊 生活雜記 程式設計 網路架站 網頁設計 資訊學習 資訊安全 遊戲 音樂


創用 CC 授權條款
本著作係採用創用 CC 姓名標示-相同方式分享 4.0 國際 授權條款授權.