Spacing on the image with HTML5

2

When I put an image it comes automatically with a space above and below the image of approximately 5px, I would like to know how to remove this spacing already tried to put border: 0px and margin: 0px and did not solve.

<figure>
  <figcaption>Curso HTML5</figcaption>
    <img src="imagens/html5.png" alt="Imagem do html5" title="Curso html5"> 
</figure>
    
asked by anonymous 25.10.2015 / 14:26

1 answer

2

These margins are added by the browser, depending on the browser. For example Google Chrome adds:

figure {
    display: block;
    -webkit-margin-before: 1em;
    -webkit-margin-after: 1em;
    -webkit-margin-start: 40px;
    -webkit-margin-end: 40px;
}

To remove this margin, simply add:

figure {
    margin: 0;
}
  

See the examples below, with and without the margin removed:
link
link

    
25.10.2015 / 14:37