hacer redonda una imagen con css in javascript

Assuming you have an image with class my-image, you can make it round with CSS using border-radius property:

.my-image {
  border-radius: 50%;
}
36 chars
4 lines

To set this CSS property using JavaScript, you can access the element using document.querySelector and set its style property as follows:

index.tsx
const myImage = document.querySelector('.my-image');
myImage.style.borderRadius = '50%';
89 chars
3 lines

This will make the image appear round.

related categories

gistlibby LogSnag