How do <img> remove parental indents (left and right)? Those. I pull the image to 100% and center

 /*CSS*/ #center {text-align:center} /*HTML*/ <div id="center"><img src="...." width="100%"></div> 

And when viewing the page on the left and right of the image, parental indents appear.

  • @LiveStreet, If you are given a comprehensive answer, mark it as correct (click on the check mark next to the selected answer). - Nicolas Chabanovsky

3 answers 3

http://jsfiddle.net/soledar10/6ow2aLyc/

HTML

 <div> <img src="http://cs618130.vk.me/v618130675/100fb/8TIlaGxPkus.jpg" alt="" /> </div> 

CSS

 *{ padding: 0; margin: 0; } div{ position: relative; max-width: 600px; margin: 0 auto; } div img{ position: absolute; top: 0; left: 0; width: 100%; height: auto; } 

    margin: 0 and padding: 0 ;

      This piece of code will help from all problems with img:

       img { border: 0; vertical-align: middle; max-width: 100%; height: auto; margin: 0; padding: 0; }