{"id":566,"date":"2012-05-24T16:20:08","date_gmt":"2012-05-24T16:20:08","guid":{"rendered":"https:\/\/theextremewebdesigns.com\/blog\/?p=566"},"modified":"2012-05-24T16:20:08","modified_gmt":"2012-05-24T16:20:08","slug":"vertically-align-text-with-image-using-css","status":"publish","type":"post","link":"https:\/\/theextremewebdesigns.com\/blog\/vertically-align-text-with-image-using-css\/","title":{"rendered":"Vertically align text with image using CSS"},"content":{"rendered":"<p>When working with web design, some times it might be desirable to maintain an even proportion, be it layout or be it placement of elements in the page. In such a context, it would be helpful to vertically align text. So here&#8217;s a neat trick to <strong>vertically align text with image using CSS<\/strong>.<!--more--><\/p>\n<h2>Example to Vertically align text with image using CSS<\/h2>\n<div class=\"make_demo\">\r\n\r\n\t<form action=\"https:\/\/theextremewebdesigns.com\/blog\/wp-content\/themes\/ewd_blog_2017\/try_demo.php?post_id=566\" method=\"post\" name=\"form1\" target=\"_blank\" id=\"form1\">\r\n\r\n\r\n\t<input type=\"hidden\" name=\"shortcode_content\" id=\"shortcode_content\" value=\"\" \/>\r\n\r\n        <div class=\"try_demo_btn_container\">\r\n\r\n\r\n            <button type=\"submit\" name=\"sbt_make_demo\" id=\"sbt_make_demo\" class=\"btn-primary btn-try-demo\">\r\n                Try Demo\r\n            <\/button>\r\n\r\n\r\n        <\/div><!-- .try_demo_btn_container -->\r\n\r\n    <\/form>\r\n    <\/div>\r\n    \n<p>Let&#8217;s assume that we have a div and it contains an image and some text. We would now like to vertically align the text with this image. We can do this in the following way:<\/p>\n<pre class=\"lang:xhtml decode:true\" title=\"Vertically align Image With Text using CSS\">&lt;div&gt;\n&lt;img style=\"width:50px;height:300px;vertical-align:middle;\"&gt;\n&lt;span style=\"text\"&gt;Hello World!&lt;\/span&gt;\n&lt;\/div&gt;<\/pre>\n<h5><div class=\"make_demo\">\r\n\r\n\t<form action=\"https:\/\/theextremewebdesigns.com\/blog\/wp-content\/themes\/ewd_blog_2017\/try_demo.php?post_id=566\" method=\"post\" name=\"form1\" target=\"_blank\" id=\"form1\">\r\n\r\n\r\n\t<input type=\"hidden\" name=\"shortcode_content\" id=\"shortcode_content\" value=\"\" \/>\r\n\r\n        <div class=\"try_demo_btn_container\">\r\n\r\n\r\n            <button type=\"submit\" name=\"sbt_make_demo\" id=\"sbt_make_demo\" class=\"btn-primary btn-try-demo\">\r\n                Try Demo\r\n            <\/button>\r\n\r\n\r\n        <\/div><!-- .try_demo_btn_container -->\r\n\r\n    <\/form>\r\n    <\/div>\r\n    <\/h5>\n<h5>Your Turn!<\/h5>\n<p>Do you know of any other ways to <strong><em>use CSS to\u00a0vertically align text with image<\/em>?<\/strong> Feel free to share by commenting below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When working with web design, some times it might be desirable to maintain an even proportion, be it layout or be it placement of elements in the page. In such a context, it would be helpful to vertically align text. So here&#8217;s a neat trick to vertically align text with image using CSS.<\/p>\n","protected":false},"author":1,"featured_media":276,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[18,13],"tags":[52],"class_list":["post-566","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-css-tips-and-tricks","category-tips-and-tricks","tag-css-tips"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/paBnQX-98","jetpack_sharing_enabled":true,"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/posts\/566","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/comments?post=566"}],"version-history":[{"count":0,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/posts\/566\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/media?parent=566"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/categories?post=566"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/tags?post=566"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}