常用CSS

初始化所有margin/padding影響的寬,會影響fancybox的寬
{
box-sizing:border-box;
-moz-box-sizing:border-box; /* Firefox */
-webkit-box-sizing:border-box; /* Safari */
}

map 的 area 点击在IE下出现虚框
white-space: nowrap;

上標字
vertical-align: super;

下標字
vertical-align: sub;

強制不換行
white-space: nowrap;

最前及最後
:first-child
:last-child

CSS :after 伪元素
:after {content:url(/i/w3school_logo_white.gif)}

隱藏li連結文字
text-indent:-9999px;

文字平均齊尾
text-align:justify;

輸入框沒有外光暈
outline: none;

命令物件出現手指游標
cursor:pointer;

消除影像地圖按下後產生的連結虛線框
<img src="http://img.minwt.com/img/Content/noimg.jpg" hidefocus="true"/>

iframe透明背景
iframe.htm
<iframe src="SourcePage.htm" allowtransparency="true"></iframe>
SourcePage.htm 加在<body …..之後
style="background-color:transparent"

清除div結尾之前物件浮動
div/class name:after{visibility: hidden; display: block; font-size: 0; content: " "; clear: both; height: 0; }

list-style-type 属性
cjk-ideographic 中文一二三
decimal 數字
decimal-leading-zero 0開頭數字
disc 實心圓
circle 空心圓
square 方塊
lower-alpha 小寫英文
upper-alpha 大寫英文

隱藏所有捲軸
<body scroll="no">

隱藏橫軸
body{ overflow-x:hidden;

隱藏縱軸
body{ overflow-y:hidden;

捲軸置於左邊 
<html dir="rtl">

物件外面包框(顏色/粗細/樣式)
border:#ccc 2px solid;





留言