Timeline for answer to How can I vertically align elements in a div? by dimarzionist
Current License: CC BY-SA 3.0
Post Revisions
9 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Aug 11, 2014 at 16:50 | comment | added | adax2000 | on certain occasions there may one extra outer div required with style display:table | |
| Mar 21, 2014 at 16:47 | review | Low quality answers | |||
| Mar 21, 2014 at 16:53 | |||||
| Jan 9, 2013 at 9:42 | comment | added | Pma | Ok, maybe i was too quick with my conclusions... Adding display:table-cell breakes div margin and additionaly border is displayed outside div, border combined with border-radius displays rounded corners inside of the div istead of outside | |
| Jan 8, 2013 at 0:22 | comment | added | Pma | yes, as far as i know this is the least intrusive way to center anything verticaly in a div. +1 | |
| Dec 17, 2012 at 4:55 | comment | added | SwiftMango | This one works. It changes the display to table-cell which takes the vertical-align property. No idea why people vote this down. | |
| Jun 24, 2012 at 17:56 | comment | added | MSpreij |
Apparently the display was updated to table-cell, which makes vertical-align: middle; work. Even better, it works without needing a nested wrapper/buffer div, and it works for both text and images (or both), and you don't need to change the position properties.
|
|
| May 4, 2012 at 20:53 | history | edited | Joe | CC BY-SA 3.0 |
added 129 characters in body
|
| Mar 12, 2010 at 12:38 | comment | added | Quentin | The vertical-align property does not apply since the div is display: block by default and nothing appears to have been done to change it. | |
| Sep 17, 2008 at 3:01 | history | answered | dimarzionist | CC BY-SA 2.5 |