Css樣式中遇到的小問題

來源:互聯網
上載者:User

css樣式一直是我的弱項,連最基本的樣式都不會調,試著學一下表格、線條的設計,將遇到的問題和解決方案貼出來,備用!

1、td 的邊框和table 的邊框重疊

.table { border-left:1px solid #dedede; border-top:1px solid #dedede;}

.td { border-right:1px solid #dedede; border-bottom:1px solid #dedede;}

table 只用左邊框和上邊框,每個td只有右邊框和下邊框,效果就是整個表格左、上邊框是連續實線,右、下邊框是延續td的邊框所以是斷斷續續的

解決方案:

.table {border:1px solid #dedede; border-collapse:collapse;}

.td {border:1px solid #dedede; }  橘色字型是關鍵,邊框設定也不用分上下左右了,重疊的話會一個覆蓋另一個

firefox中:td的border覆蓋table 的,IE中table 的border覆蓋td的,我這裡border顏色一樣,無所謂了

表格線常見問題:

1.表格邊框與表格儲存格線的重疊。[採用border-collapse:collapse解決]

2.巢狀表格格與被巢狀表格格邊線重疊問題。[採用border-top|left|right|bottom解決]

3.巢狀表格格與被巢狀表格格對不齊的問題。[採用table-layout: fixed;解決]

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.