html - How to align text to center this image? -


i have sample:

link

code html:

<div class="col-md-4 tab-bottom">                     <div class="tab-bottom-img"><img width="380" height="380" src="http://dg-design.ch/bagel/wp-content/uploads/2016/02/1-380x380.png" class="attachment-news wp-post-image" alt="1"> </div>                         <div class="tab-bottom-content">                             sed perspiciatis                            <p>sed ut perspiciatis unde omnis iste natus error sit<br> voluptatem accusantium doloremque laudantium,<br> totam rem aperiam, eaque ipsa quae ab illo inventore<br> veritatis et quasi architecto beatae vitae dicta sunt<br> explicabo.</p>                         </div>                 </div> 

code css:

.tab-bottom-content {     position: absolute;   text-align:center;     top: 0px; } 

image width , height vary ... should in middle

i tried align text center not working...

text must aligned both horizontally , vertically.

can me solve problem please?

thanks in advance!

try following css:

.tab-bottom-content {     position: absolute;     text-align:left;     margin-top: -240px;     margin-left: 20px;;  } 

before, had top: 0; means show div in 0 pixels main port. if want change bring text in middle of change value top css property. if image , div not first elements on page, suggest use margin instead of top property.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

post - imageshack API cURL -

dataset - MPAndroidchart returning no chart Data available -