![]() removed the stuff that made it work in Internet Explorer 7 and 6). Andy Howard - How to vertically and horizontally center text in an unordered list or divĪs I didn't care much for Internet Explorer 7/6 for the last project I worked on, I used a slightly stripped down version (i.e. ![]() There are two special stylesheets (one for Internet Explorer 7 and another for Internet Explorer 6) to help them along due to their CSS limitations which modern browsers don't have. This works on all major browsers including Internet Explorer 9, Internet Explorer 8, Internet Explorer 7, Internet Explorer 6, Firefox, Chrome, Opera and Safari. However, I need the divs style.top and style.left to be overwritten later by some javascript, to make it move. No matter how much text you have you won't have to apply any special classes to specific lists or divs (the code is the same for each). Ive seen here and on other sites, that in order to do vertical centering, the best way would be by using display: table on the parent element and display: table-cell combined with vertical-align: middle on the child. How to vertically and horizontally center text in both an unordered list and a div without resorting to JavaScript or CSS line heights. ![]() Even more text that demonstrates how lines can span multiple linesĪ simple and cross-browser approach, useful as links in the marked answer are slightly outdated.
0 Comments
Leave a Reply. |