国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發(fā) > CSS > 正文

div css布局解決瀏覽器兼容及優(yōu)化等實用技巧

2024-07-11 08:33:40
字體:
供稿:網(wǎng)友

DIV 上下居中用 line-height
Html代碼


<style type=”text/css”>
div.v-align {line-height: 200px;height: 200px;border: 1px solid red;}
</style>
<div class=”v-align”>垂直居中</div>

清除瀏覽器默認(rèn)樣式
1.用其他有名的庫來清除(如:YUI)
2.自已清除 如:
* {padding: 0;margin:0;}

讓A支持所有瀏覽器
Html代碼


<style type=”text/css”>
a.agideo:link, a.agideo:visited {font-weight: bold;text-decoration: none;color: green;}
a.agideo:hover, a.agideo:active {font-weight: bold;text-decoration: none;color: red;}
</style>
<a href=”http://www.agideo.com” class=”agideo”>捷道數(shù)碼</a>
<style type=”text/css”>
a.google:hover, a.google:active {font-weight: bold;text-decoration: none;color: red;}
a.google:link, a.google:visited {font-weight: bold;text-decoration: none;color: green;}
</style>
<a href=”http://www.google.com” class=”google”>Google</a>

A 偽類定義順序記憶法
LoVe:HAte(愛恨)
IMG vertical-align
vertical-align : auto | baseline | sub | super | top | text-top | middle | bottom | text-bottom | length
baseline :默認(rèn)值。將支持 valign 特性的對象的內(nèi)容與基線對齊
sub 垂直對齊文本的下標(biāo)
super 垂直對齊文本的上標(biāo)
top : 將支持 valign 特性的對象的內(nèi)容對象頂端對齊
text-top : 將支持 valign 特性的對象的文本與對象頂端對齊
middle : 將支持 valign 特性的對象的內(nèi)容與對象中部對齊
bottom : 將支持 valign 特性的對象的內(nèi)容與對象底端對齊
text-bottom : 將支持 valign 特性的對象的文本與對象頂端對齊
length : 由浮點數(shù)字和單位標(biāo)識符組成的長度值 | 百分?jǐn)?shù)。可為負(fù)數(shù)。定義由基線算起的偏移量。基線對于數(shù)值來說為0,對于百分?jǐn)?shù)來說就是0%。請參閱 長度單位。目前IE尚未實現(xiàn)此參數(shù)
Html代碼 


<style type=”text/css”>
div.v-align {border: 1px solid red;line-height: 40px;float: left;font-size: 11px;height: 40px;}
div.v-align img.only-img {float:left;}
div.v-align.has-img {padding-top: 10px;height: 30px;}
div.v-align.has-img-and-text img.has-text {
vertical-align: -4px !important;vertical-align: middle;margin-top: -3px !important;margin-top: 0px;}
div.v-align.has-img-and-text {
padding-top: 0px !important;padding-top: 10px;height: 40px !important;height: 30px;}
</style>
<div class=”v-align”>正常</div>
<div class=”v-align has-img”><img src=”http://huoche.7234.cn/images/jb51/no3svwg4l1x.png” class=”only-img” /></div>

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 读书| 高尔夫| 怀远县| 达尔| 壶关县| 文水县| 黄大仙区| 崇文区| 鄂尔多斯市| 泰宁县| 桂林市| 宁武县| 镇沅| 华容县| 翼城县| 邛崃市| 九龙城区| 贵港市| 湄潭县| 衡水市| 海宁市| 岗巴县| 平谷区| 桂林市| 兖州市| 班玛县| 谷城县| 富裕县| 荥经县| 新巴尔虎左旗| 崇信县| 宣汉县| 咸丰县| 左权县| 定日县| 丹东市| 沈阳市| 曲沃县| 景谷| 桐乡市| 灵石县|