?
This document uses PHP Chinese website manual Release
語法:
max-height:<length> | <percentage> | none
默認值:none
適用于:除非置換內(nèi)聯(lián)元素,table-row, table-row-group之外的所有元素
繼承性:無
動畫性:當值為<length> | <percentage>時
計算值:指定的值
取值:
none:
無最小高度限制
<length>:用長度值來定義最大高度。不允許負值
<percentage>:用百分比來定義最大高度。不允許負值
說明:
檢索或設(shè)置對象的最大高度。
如果max-height屬性的值小于min-height屬性的值,max-height將會自動以min-height的值作為自己的值。
IE6尚不支持此屬性
對應(yīng)的腳本特性為maxHeight。
兼容性:
Values | IE | Firefox | Chrome | Safari | Opera | iOS Safari | Android Browser | Android Chrome |
---|---|---|---|---|---|---|---|---|
Basic Support | 6.0 | 2.0+ | 4.0+ | 3.1+ | 4.0+ | 3.2+ | 2.1+ | 18.0+ |
7.0+ |
<!DOCTYPE html> <html lang="zh-cmn-Hans"> <head> <meta charset="utf-8" /> <title>max-height_CSS參考手冊_web前端開發(fā)參考手冊系列</title> <meta name="author" content="Joy Du(飄零霧雨), dooyoe@gmail.com, www.doyoe.com" /> <style> .test { max-height: 30px; background: #eee; } </style> </head> <body> <div class="test"> <p>我的最大高度為30</p> <p>灰色背景區(qū)域以外不是我的領(lǐng)土</p> </div> </body> </html>
點擊 "運行實例" 按鈕查看在線實例