Having tried some solutions related to vertical alignment, I seem to be unable to solve this. Not sure if anyone can help me with this. All I want to do is position the alternate text in the middle of a blank image.
This is the html code:
<div class="viewport"> <a href="#"> <img src="http://yahoo.com/" alt="no image" /> </a> <div>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> </div>
And this is the css code:
.viewport { background: #bbb; width: 350px; height: 300px; padding: 5px; } .viewport img { float: left; margin: 5px; width: 100px; height: 100px; background: #000; text-align: center; } .viewport div { margin-left: 20px; }
Thanks for taking the time to read.
source share