css - How to align image to top left of div -
below code :
css
#block { border-width: 2px; border-color: #4682b4; background-color: #e0ffff; width: 200px; text-align: center; }
html
<div id="block"> <h3>test header</h3> <p> <img height="100" style="max-width: 120px;background-position: top left;" src="http://socialmediababe.com/wp-content/uploads/2010/12/administrator.jpg" /> </p> <p> test text </p> </div>
produces :
how can align image top left corner of screen ?
by top left corner mean align point indicated arrow :
i have tried 'background-position: top left;' not make difference.
after trying 'fags' answer receive same result :
like this
css
*{ margin:0; padding:0; } #block { border-width: 2px; border-color: #4682b4; background-color: #e0ffff; width: 200px; text-align: center; line-height:30px; padding:3px 0; }
Comments
Post a Comment