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 :

enter image description here

how can align image top left corner of screen ?

by top left corner mean align point indicated arrow :

enter image description here

i have tried 'background-position: top left;' not make difference.

after trying 'fags' answer receive same result :

enter image description here

like this

demo

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; } 

demo1


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -