-1
I’m trying to put an edge on an image, but the result is that the margin extends across the horizontal of the page, as shown in the print.
The idea is that the margin is around the image and its legend...
In HTML:
<figure class = 'foto-legenda'>
<img src = '_imagens/glass-quadro-homem-mulher.jpg'>
<figcaption>
<h3>Google Glass</h3>
<p>Uma nova maneira de ver o mundo.</p>
</figcaption>
</figure>
In the CSS:
figure.foto-legenda {
border: 8px solid white;
box-shadow: 1px 1px 4px black;
}
The teacher also instructed to include the following section in order to prevent the margin from "misaligning" the image by resizing the browser window:
figure.foto-legenda img {
width: 100%;
height: 100%;
}
In doing so, apparently the edge fits right, but the image becomes gigantic...
Q. S.: I already tried to remove the caption text, but the result was the same.
Important you [Dit] your question and explain objectively and punctually the difficulty found, accompanied by a [mcve] of the problem and attempt to solve. To better enjoy the site, understand and avoid closures and negativities worth reading the Stack Overflow Survival Guide in English.
– Bacco