Formatting images in CSS figure.class [closed]

-2

(Solved) It seems that the .css file was corrupted, I created a new one and rewrote the same code on it, after that the code started working normally.

I have a problem to put the attributes in an image in CSS, I save the file and it does not modify my image at all, and the other attributes (body and p) are working normally. NOTE: The image is appearing, however the attribute (border) does not work.

Follow the CSS and HTML code respectively.

@charset "UTF-8";
body {
  background-color: gray;
  color: rgba(0, 0, 0, 0.7);
}

p {
  text-align: justify;
  text-indent: 50px;
}


/*formatação imagens*/

figure.foto-legenda {
  border: 8px solid red;
}
<figure class="foto-legenda">
  <img src="glass-quadro-homem-mulher.jpg">
  <figcaption>
    <h3>Google Glass</h3>
    <p>Uma nova maneira de ver o mundo></p>
  </figcaption>
</figure>
    
asked by anonymous 02.10.2018 / 20:14

1 answer

0

Hierarchy issue: .photo-caption is above img

@charset "UTF-8";
body {
  background-color: gray;
  color: rgba(0, 0, 0, 0.7);
}
p {
  text-align: justify;
  text-indent: 50px;
}
/*formatação imagens*/
.foto-legenda > img {
  border: 8px solid red;
}
<figure class="foto-legenda">
  <img src="glass-quadro-homem-mulher.jpg">
  <figcaption>
    <h3>Google Glass</h3>
    <p>Uma nova maneira de ver o mundo></p>
  </figcaption>
</figure>

Is this code what you are looking for?

    
03.10.2018 / 05:13