code that is needed
for linking JSFiddle
links
I don't understand why I need
this.
An image of the two divs, their the gray boxes.
如何让这两个div的高度相同?我不想做填充底部:px;和margin-bottom:-px;这似乎真的像作弊,只是操纵。
答案 0 :(得分:1)
您可以使用display:table
和display:table-cell
:
#who-is {
width: auto;
display: table;
}
#left {
width: 40%;
padding: 5%;
text-align: center;
background: #CCC;
display: table-cell;
}
#left h1 {
font-size: 72px;
text-transform: uppercase;
}
#right {
width: 40%;
padding: 5%;
background: #eee;
display: table-cell;
}
#right p {
font-size: 16px;
}