Random CSS Hex Color by PHP
$rnd = Array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'); $rnd_color = "#"; for ($i=0; $i<6; $i++) { $rnd_color .= $rnd[rand(0,15)]; }
Reference: Random Hex Color
CSS 用 border 跟 after 做三角形
利用 box model 與 pseudo selector 做 triangle
.selected::after {
content: "";
position: absolute;
border-top: #66CBF9 10px solid;
border-right: transparent 10px solid;
border-bottom: transparent 10px solid;
border-left: transparent 10px solid;
}
Reference: CSS-triangle-after-implementation
:before, :after CSS Selectors Pseudo-elements
.amount::before {content:"$ ";}
.amount::after {content:" 萬元";}
用在將 .amout 前後加入任意 content
Reference: :before, :after 擬元素指標 (CSS Selectors Pseudo-elements)
.amount::after {content:" 萬元";}
用在將 .amout 前後加入任意 content
Reference: :before, :after 擬元素指標 (CSS Selectors Pseudo-elements)
[CSS] 取消 ul li 的標題項目圓圈底線
ul li { list-style-type: none; }
ul li a { text-decoration: none; }
Reference: Tutorial 4 - getting-rid-of-bullet-points-from-ul, Horizontal lists
ul li a { text-decoration: none; }
Reference: Tutorial 4 - getting-rid-of-bullet-points-from-ul, Horizontal lists
CSS wrap auto width height
.container { overflow: auto; }
Reference: http://webdesignerwall.com/tutorials/css-clearing-floats-with-overflow
Reference: http://webdesignerwall.com/tutorials/css-clearing-floats-with-overflow
CSS Sprite img link
Reference: Foreground <img> Sprites
<h2 class="popular"><img src="img-sprite.png" alt="" />Featured</h2>
<h2 class="featured"><img src="img-sprite.png" alt="" />Popular</h2>
h2 {
overflow: hidden;
position: relative;
height: 50px;
width: 200px;
}
h2 img {
position: relative;
}
h2.popular img {
top: -100px;
}
h2.featured img {
top: -200px;
}
[CSS] make div stay at bottom of div
讓 child div 置底在父 DOM 的 bottom >> Kirupa.com
#parent { position: relative; }
#child { position: absolute; bottom: 0; }
#parent { position: relative; }
#child { position: absolute; bottom: 0; }
使用 CSS+DIV 設計網頁版面
Referencing http://sofree.cc/css-table/
主要的重點就是管理方便,不會這裡加一點 style 那裡也改一點的雜亂問題
還有改版容易,只要換個 style.css 即可
具體作法如下變動,用 div class 取代 html tag
主要的重點就是管理方便,不會這裡加一點 style 那裡也改一點的雜亂問題
還有改版容易,只要換個 style.css 即可
具體作法如下變動,用 div class 取代 html tag
[CSS] fixed background 固定背景圖
如果你有一張背景圖要固定,像 blogger 這樣,可以用CSS做到:
background:url(../image/XXX.jpg) no-repeat fixed;
訂閱:
文章
(
Atom
)