0
How do I make the internal images of ASIDE
adjust its height and width automatically according to browser resizing?
CSS
aside{
background-color: #222;
margin-top: 10px;
margin-left: 10px;
width: 100%;
max-width: 1200px;
margin-bottom: 10px;
box-sizing: border-box;
}
aside figure{
float: left;
margin-bottom: 20px;
margin-right: 10px;
}
aside figure img{ /* redimensionar imagem */
max-width: 300px;
width: 100%;
}
HTML
<aside>
<figure>
<a href="#">
<img src="./imagens/praias.png" width="300" height="400">
</a>
</figure>
<figure>
<a href="#">
<img src="./imagens/praias.png" width="300" height="400">
</a>
</figure>
<figure>
<a href="#">
<img src="./imagens/praias.png" width="300" height="400">
</a>
</figure>
<figure>
<a href="#">
<img src="./imagens/praias.png" width="300" height="400">
</a>
</figure>
</aside>
Why do images have
width
andheight
defined if the dimension is controlled by CSS? These properties have higher priority than CSS and will never be overwritten.– Woss
@Andersoncarloswoss how can I make adjustments to html and css? Can you help me?
– Gladison
Start by removing these attributes.
– Woss
@Andersoncarloswoss could rewrite this code for me?
– Gladison
Try it first, you’ll learn more.
– Woss
@Andersoncarloswoss removed the attributes
– Gladison
Let’s go continue this discussion in chat.
– Gladison