Skip to content

Web Developer Blog

Align text vertically center in div

<div><span>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</span></div>

div {
width: 200px;
height: 100px;
line-height: 100px;
text-align: center;
}

span {
display: inline-block;
vertical-align: middle;
line-height: normal;
}

Reference: http://stackoverflow.com/questions/8865458/how-to-align-text-vertically-center-in-div-with-css

Author adminPosted on September 7, 2014September 7, 2014Categories CSS

Post navigation

Previous Previous post: Change MySQL Timezone on Amazon RDS
Next Next post: Can’t connect to MySQL server on ‘…’ (99)

Categories

  • Amazon EC2
  • Apache
  • Apple
  • Bootstrap
  • Browser
  • Campaign Monitor
  • CDN
  • CentOS
  • Chrome
  • Composer
  • Concrete5
  • cPanel
  • CSS
  • Debian Linux
  • DNS
  • Drupal
  • eDM
  • Facebook
  • FirePHP
  • Flash
  • git
  • Gmail
  • Google Apps
  • Google Map
  • Horde
  • Hosting
  • HTML
  • HTML 5
  • Image Optimization
  • iPad
  • Java
  • Javascript
  • jQuery
  • Linux
  • Mac
  • Magento
  • Materials
  • MetaWeblog
  • MODx
  • MySQL
  • Nginx
  • Node.js
  • Payment Gateway
  • Paypal
  • Perl
  • Photoshop
  • PHP
  • Plesk
  • Programming
  • Push Message
  • Putty
  • React Native
  • Security
  • SEO
  • Shopify
  • SSH
  • SSL
  • Sublime Text
  • Tumblr
  • Uncategorized
  • WampServer
  • Web
  • Web Design
  • Windows
  • Wordpress
  • XenServer












Web Developer Blog Proudly powered by WordPress