Hello. There is a certain fixed width DIV . There are more DIV elements in it, which can be any number. The width and height of the internal elements is fixed. Question: How can I make positioning inside the head DIV as in the picture?

PS
It is very important that the head DIV in height be 50 pixels larger than the space occupied by the internal elements in height (as in the picture). And yet, the use of JavaScript not applicable in my situation.

alt text

    1 answer 1

    Like that:

     .main_div { padding: 5px 0 50px 5px } .my_div { display:inline-block; margin-right: 10px } 
    • Thank. It worked! Only not to the end. How to make the internal elements aligned in the center, while the bottom line will be the same as in the picture. - Anton Mukhin
    • try internal divs to add the property float: left - DemoS
    • Not. Did not help - Anton Mukhin
    • In principle, I did not guess right away. It is necessary to place in the center, it was just to calculate how much one line of internal objects takes, to subtract from the width of the head DIV, to divide it into two and set this value for padding left and right. @DemoS, thanks, the idea really helped. - Anton Mukhin
    • I myself, to be honest, I am not particularly friendly with the positioning. But your option, as it seems to me, is a rare perversion :) Surely there is a simpler way. Unfortunately I can not tell. - DemoS