Comments on: height https://css-tricks.com Tips, Tricks, and Techniques on using Cascading Style Sheets. Wed, 23 Feb 2022 11:15:15 +0000 hourly 1 https://wordpress.org/?v=6.2.2 By: Andrew Millar https://css-tricks.com/almanac/properties/h/height/#comment-1794163 Wed, 23 Feb 2022 11:15:15 +0000 http://css-tricks.com/?page_id=14057#comment-1794163

If the height of the containing block is not specified explicitly

But then you don’t go on an say what happens if the height of the containing box IS defined. What happens then to the height of the element when it is set to 100%?

]]>
By: Dan Allen https://css-tricks.com/almanac/properties/h/height/#comment-1713247 Wed, 05 Jun 2019 19:57:04 +0000 http://css-tricks.com/?page_id=14057#comment-1713247 Sometimes, the height of an element is no where near the height of the content inside it.

A div containing two floating divs, each of height 100px, the height of the div container is 0. A good explanation with a demo is available at this link: https://devserver-002.info/floating_div_scam//floatdemo/

]]>
By: Colin Q Bang https://css-tricks.com/almanac/properties/h/height/#comment-1623778 Fri, 20 Apr 2018 19:38:21 +0000 http://css-tricks.com/?page_id=14057#comment-1623778 In reply to Mikeouwen.

That sentence in the article is obviously a mistake. No one has time to proof-read (or look at comments on years-old articles), and it already got our click-through…

See https://www.w3.org/TR/CSS21/box.html#box-dimensions
And a better referencefor “content height” than the url the article links to would be https://www.w3.org/TR/CSS21/visudet.html#the-height-property

The existence of ‘box-sizing: border-box’ means we can’t unqualifiedly say “content area is defined by (or as) width and height properties…” And anyway “defined as” is not the same as “defined by”. But for the default (equiv to box-sizing: content-box) that’s about good enough. Especially since “content area” doesn’t seem to be defined precisely in the spec., so best to stick with things that are, like height, width, and padding. I don’t know what the author exactly meant to write, but a conceptual definition of “content area” could be “the area inside the padding”.

:q!

]]>
By: Archit https://css-tricks.com/almanac/properties/h/height/#comment-1606793 Thu, 16 Feb 2017 13:41:58 +0000 http://css-tricks.com/?page_id=14057#comment-1606793 And how is the height calculated if the height of the containing block is specified and the containing block is absolutely positioned?

]]>
By: mike https://css-tricks.com/almanac/properties/h/height/#comment-1605513 Fri, 09 Dec 2016 22:29:59 +0000 http://css-tricks.com/?page_id=14057#comment-1605513 depends on your box-sizing settings in css.

]]>
By: Appu https://css-tricks.com/almanac/properties/h/height/#comment-1602193 Tue, 14 Jun 2016 17:17:06 +0000 http://css-tricks.com/?page_id=14057#comment-1602193 In reply to Mikeouwen.

Yup, I am also confused by that statement. I think that wrong or needs to be phrased better.

]]>
By: Mikeouwen https://css-tricks.com/almanac/properties/h/height/#comment-1594984 Sun, 31 May 2015 09:14:08 +0000 http://css-tricks.com/?page_id=14057#comment-1594984 ‘The “content” area is defined as the padding, border and margin of an element’ Is this right?
I think the content area is defined by width and height properties of an element.

]]>