Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

781
Vistas
Why doesn't border-radius work on the image?

The image

I have tried everything and the border radius doesn't work on this image. It just doesn't react to it. I have tried both % and px. Image reacts to any other CSS value that you can see or the properties that I am passing in the img tag in the component. Everything, except for border-radius. I am out of ideas.

Here is the component:

import React from "react";
import {
  UserContainer,
  User,
  UserProfilePicture,
  UserProfileName,
  UserChevronIcon,
} from "./User.style";
import Logo from "../../../images/ProfileFace.jpg";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faChevronDown } from "@fortawesome/free-solid-svg-icons";

function UserProfile() {
  return (
    <UserContainer>
      <User>
        <UserProfilePicture>
          <img src={Logo} height="50" width="50" border-radius="50px" />      -----> both px and % don't work
        </UserProfilePicture>
        <UserProfileName>Olivia Wilde</UserProfileName>
        <UserChevronIcon>
          <FontAwesomeIcon icon={faChevronDown} color="#7a7e7e" />
        </UserChevronIcon>
      </User>
    </UserContainer>
  );
}

export default UserProfile;

Here is the styled component:

import styled from "styled-components";

export const UserContainer = styled.div`
  height: 90%;
  width: 30%;
  margin: 0px;
  padding: 0px;
  background-color: inherit;
  color: white;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
`;

export const User = styled.div`
  height: 70%;
  width: 100%;
  background-color: inherit;
  display: flex;
  text-align: end;
  justify-content: space-around;
`;

export const UserProfilePicture = styled.image`
  height: 50%;
  width: 50%;
  border-radius: 100px;      -----> both px and % don't work
  display: flex;
  justify-content: center;
  align-items: center;
`;

export const UserProfileName = styled.div`
  height: 40%;
  width: 40%;
  color: #7a7e7e;
  font-size: 17px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: flex-start;
`;

export const UserChevronIcon = styled.div`
  height: 50%;
  width: 10%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
`;
over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

You can style it the following way:

   <img src={Logo} height="50" width="50" style={{borderRadius: '50%'}}/>
over 4 years ago · Santiago Trujillo Denunciar

0

I assume you'd like to make that image round. Adding a 100px border-radius to a 50px image won't work. Use percentage instead. For example, to make a square image look round use the following style:

border-radius: 50%;

If it doesn't work, likely another style is overwriting it, so try with the important tag:

border-radius: 50% !important;

If that also fails (could be overwritten by another !important tag somewhere in your css) try to style it inline:

<img src={Logo} height="50" width="50" style="border-radius: 50%" />
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda