CSS記錄

圖片大小限制
.pic img {

vertical-align: middle; max-width: 125px; max-height: 125px; 

width: expression(this.width >125 && this.height < this.width ? 125: true); 

height: expression(this.height > 125 ? 125: true); 

}

文字兩端對齊
text-align:justify;text-justify:inter-ideograph;

最小高度(IE/FF)
min-height: 300px;height: auto !important;height:300px;

限制單行文字,溢出用...代替
overflow: hidden;white-space: nowrap;text-overflow:ellipsis;

li隱藏點
list-style:none;

線條table
.form_table {
border-collapse:collapse;
border:solid #C2DEF3;
border-width:1px 0 0 1px;
}
.form_table caption {font-size:14px;font-weight:bolder;}
.form_table th,table td {
border:solid #C2DEF3;border-width:0 1px 1px 0;
padding:5px;line-height: 25px;
}
.form_table th {text-align:right;background-color: #e9f1fc;font-weight:normal;}

IE8用IE7效果

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

避免表格table被撐開變形(IE)
table {
  table-layout: fixed;
  word-wrap:break-word;
}


文字過多時自動換行
white-space:normal;word-wrap:break-word;
連續的英文字符和阿拉伯數字,使用word-wrap:break-word;或者word-break:break-all;實現強制斷行,而Firefox沒解決這個問題,可以加上overflow:auto/hidden;來控制字符溢出時出現滾動條或者隱藏。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章