建站知識

Welcome to Beijing RuiHeng TianLong Technology Co., Ltd.

網站建設div+CSS在IE6和火狐margin和padding的問題_北京網站制作

時間:  來源:網站建設公司  作者:網站制作公司  點擊量:
在學習用div+css 制作網站版面的時候,越來約關注的問題就是,兼容問題,這是個很頭疼的問題,那么怎么解決這些問題呢?

     在學習用div+css 制作網站版面的時候,越來約關注的問題就是,兼容問題,這是個很頭疼的問題,那么怎么解決這些問題呢?

要解決瀏覽器兼容等問題,必須要了解當中的技巧和原理,我們也在網上收集了相關信息,并對其進行整理,對于web2.0的過渡,請盡量使用xhtml的格式去寫代碼,而且受doctype影響的css去處理,如果是作為w3c 標準的網頁,切記一定要加doctype去聲明一下。

下面介紹一些css 兼容技巧

 

      1、div的垂直居中問題 vertical-align:middle; 將行距增加到和整個DIV一樣高 line-height:200px; 然后插入文字,就垂直居中了。缺點是要控制內容不要換行 

      2、 margin加倍的問題     設置為float的div在ie下設置的margin會加倍。這是一個ie6都存在的bug。解決方案是在這個div里面加上display:inline;    例如:    <#div id=”imfloat”>    相應的css為    #IamFloat{    float:left;    margin:5px;/*IE下理解為10px*/    display:inline;/*IE下再理解為5px*


div+css 兼容技巧,你學會了嗎?


 

CSS tricks
 
       1.div vertical centering problem vertical-align: middle; increase the line spacing and the entire DIV as high line-height: 200px; Then insert text, it vertically centered. Disadvantage is not wrap to control content
 
       2. Margin doubling problem in a div set to float under ie set margin will be doubled. This is an ie6 are present bug. The solution is in this div inside with display: inline; example: <# div id = "imfloat"> corresponding css as # IamFloat {float: left; margin: 5px ;/ * IE next understood as 10px * / display: inline ;/ * IE down again understood as 5px *
本文TAG標簽: 北京網頁制作 北京網站設計 北京網站建設
返回關閉本頁
上一篇:北京網站建設-怎樣判斷瀏覽器分辨率?自適應網頁寬度怎么做?    下一篇:網站制作中Photoshop蒙板怎么用?如何使用?
推薦閱讀

Copyright © 2010-2021 北京瑞恒天龍科技有限公司  All Rights Reserved  |  北京網站建設知名服務商  |  北京網站制作 | 京ICP備11004170號-1   京公網安備110107000463號
地址:北京市海淀區永定路長銀大廈B座  非工作時間:15810379666  服務熱線:400-809-6709  版權所有 盜版必究!

在線咨詢
關閉
電話咨詢
網站制作電話
400-809-6709
精品久久久久久无码中文字幕一_国产成人A∨激情视频厨房_精品视频在线观看自拍_欧美大战久久久久