How height is calculated without installation

I am trying to become more efficient with creating responsive websites, and since I use Bootstrap (not really important for this case, I think), I was looking for Bootsnipp . I decided to look at the source of the site and noticed one thing that I had never seen before: they did not set the height for any of their containers, except for the whole page wrapper and footer. This puzzles me because everything falls into place with the website and it is super reponse. I understand the elements in which they use Bootstrap classes, such as "col-sm-4" and something else, but someone understands the art of creating a header, content container, etc. Computes heights without specifying in css? Can anyone explain this concept? I tried Google, but not sure if the keywords were correct to find the answers.

Also, if you need to see yourself, here is a link to their CSS.

thank

+4
source share
2 answers

It is important to understand the box model. As the (oversimplified) rule of thumb, you can think of it this way: There are 2 main types of elements: inline ( span, b, strong...) and the block ( div, p, ...).

Tags

Block by default width: 100%. That is, they naturally stretch out to fill their horizontal area.

, . , . , : , . , .

, height, height, . - - , , "".

divs , . http://jsfiddle.net/S3q2C/ , div , .

+4

, (). , - ( ). , , - 50 , - 200 . ( , ). - , , , , , , , , , , .

<div>, , .

http://jsfiddle.net/xrZ73/1/

+1

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


All Articles