Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

padding-top for display:table-cell

Tags:

css

Here is the live link: http://whiterootmedia.com/test/test8/

I need to move the menu content down in the "content" div. Here's the opening tag with inline css:

<div id="content" style="padding-top:43px; border:solid yellow 1px;  display:table-cell; min-width:945px; height:100%;">

If I increase the padding it moves down the content in the "right_column" div.

like image 430
Dusty Arlia Avatar asked Nov 28 '22 11:11

Dusty Arlia


1 Answers

The reason is that the two div elements are (in CSS sense) cells of the same row. When you increase the height of one cell, the height of the other cell increases, too. Its contents falls down, because the default vertical-align in table cells is middle.

To fix this, add the following:

#right_column {
  padding-top: 43px;
  vertical-align: top;
}
like image 146
Jukka K. Korpela Avatar answered Dec 08 '22 21:12

Jukka K. Korpela