CKTIS / CSS
height — CSS свойство
`height` задава физическата височина на кутията.
Версия: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Синтаксис
auto | <length-percentage [0,∞]> | min-content | max-content | fit-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | <anchor-size()>height задава физическата височина на кутията.
Примерът измерва граничната кутия след стойността и показва физическата или логическата ос, не само поддръжката на парсера.
Приетата граматика е auto | <length-percentage [0,∞]> | min-content | max-content | fit-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | <anchor-size()>; глобалните стойности остават част от каскадата.
box-sizing променя какво включва размерът, а логическите свойства следват writing-mode.
Примери
<!doctype html>
<html lang="en"><meta charset="utf-8"><title>CKTIS CSS reference example</title>
<body><div class="probe">probe</div><pre id="result"></pre><script>
const x=document.querySelector(".probe");x.style.cssText="box-sizing:border-box;height:48px;width:20px";document.querySelector("#result").textContent="box-height="+Math.round(x.getBoundingClientRect().height)+"; computed="+getComputedStyle(x).height;
</script></body></html>Резултат
box-height=48; computed=48px
Примерът е изпълнен локално в изолирана Chrome сесия без мрежа; резултатът идва от CSS API на браузъра.