Is there an easy way to determine what factors contribute to the size of an HTML element?

For example, I have a situation where I have something like this (far-fetched) example:

<div id="outer" style="margin: auto>
    <div id="inner1" style="float: left">content</div>
    <div id="inner2" style="float: left">content</div>
    <div id="inner3" style="float: left">content</div>
    <br style="clear: both"/>
</div>

where there are no width values for all elements, and I want to #inner1, #inner2and #inner3there were a number of horizontally with each other inside #outer, but what happens is that #inner1, and #inner2appear next to each other, and then #inner3on the next line.

On the actual page where it occurs, there is a lot more, but I am very carefully checked all the elements with Firebug and do not understand why the item #inner3is not displayed on the same line as that #inner1and #inner2that will lead to an increase in width #outer.

So my question is: is there a way to determine why the size of the browser is: #outer, as it is, or why it selects wrap #inner3, although there is a lot of room to put it on the previous "line"? Elimination of specific solutions to this problem, what tips or methods do you make to the hardcore guys from HTML / CSS / web interface for a weak developer who is in the foreground?

+3
source share
4 answers

, , , - , ( box/float IE6, float, ). , .

HTML Firebug , . Firebug , . , , , , , , (, ).

, , CSS- . .

, - W3C CSS2 , float , . , " " . - , .

, IE6, , float, .

+4

- Firefox. , . , Firefox.

+2

CSS Firebug , . .

, - # inner3 , #outer , .

0

, - DOM div, /, .

But the point is, how can you easily debug this problem? What would be ideal in this case, for example, there would be something in Firebug that when you hover over the size of an element in the layout panel, a tooltip will appear that says something like "width limited by external element X, height limited by style Z on element Q "or" the width provided by the internal elements A, B and C ".

I'm sorry that I did not have time to write something like this, although I suspect that it would be difficult (if not impossible) to get this information from the Firefox rendering engine.

0
source

Source: https://habr.com/ru/post/1696690/


All Articles