0
I have an image carousel. Each image is a svg logo of fixed height and variable width. I need to place a point below each selected image, so I used the following code:
CSS:
footer .selecionado::before {
position: absolute;
content: '';
background-color: #009CE0;
border-radius: 50%;
width: 10px;
height: 10px;
pointer-events: none;
transform: translateY(50px);
}
HTML:
<div class="produto-logo selecionado">
<img src="imagens/logos/erp.svg"/>
</div>
Upshot:
But this way the dot is aligned with the left side of the image. how can I make it be centered below each image?
the
translate
before it was not working, thewidth: auto; position: relative
solved the problem– Pilati
@Pilati some things in CSS work in cascade Father/son, so the father with relative and the son with Absolute. Other times when we reference some value in the child it is necessary that the father also has some value. This is not absolute rule, but in some cases without it is not certain... Good luck there tmj
– hugocsl