Home > Software engineering >  Trying to fix an issue with box shadow and malformed circle on a background image
Trying to fix an issue with box shadow and malformed circle on a background image

Time:08-03

I made a simple logo and when I tried to effect its border radius to make it a circle, however a problem occurred. It's edges became malformed where it didn't form a perfect circle and box shadows began to appear on the bottom and sides despite the fact I didn't implement them. If anyone could help me find a work around I would appreciate it.

Also I didn't include the CSS reset, so the positioning might be a bit off.

   

html {
  font-size: 62.5%;
}
body {

}

/* Fonts */

@font-face {
  font-family: "Apercu";
  src: url(../fonts/Apercu\ Regular.otf) format("opentype");

  font-weight: normal;
}

@font-face {
  font-family: "Aller";
  src: url(../fonts/aller/Aller_Std_Rg.ttf) format("opentype");

  font-weight: normal;
}
/* Navbar */
.navbar {
  display: flex;
  width: 100%;
  height: 8rem;
  background-color: #08b3a1;
  background-size: 13px 10px;
  background-image: linear-gradient(
    45deg,
    transparent 48%,
    #fff5ee 48%,
    #fff5ee 52%,
    transparent 52%
  );
  align-items: center;
}
.logo-title-container {
  display: flex;
  gap: 1rem;
  align-items: center;
  box-shadow: none;
}
.logo {
  margin-left: 2rem;
  width: 4.4rem;
  border-radius: 50%;
  box-shadow: none;
  border: none;
}
.header-left-title {
  font-size: 3rem;
  font-family: "Aller";
  font-weight: normal;
  color: rgb(228, 230, 229);
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="/styles/style.css"></link>
    
    <title>Web Scraper 1.0</title>
</head>
<body>
    <header >
        <div ><i><a href="https://imgbb.com/"><img  src="https://i.ibb.co/T0qwp4v/2-objects.png" alt="2-objects" border="0"></a></i>
      <h1 >Razor</h1>
    </div>
   
   </header>
</body>
</html>

CodePudding user response:

This is because you are using a .png file with transparent borders. Remove the transparent edges and you will have a perfect circle

CodePudding user response:

So I was able to solve the issue, for some reason the Lunacy editor automatically adds a transparent border to an image by default. I had to crop it with a built in VS Code Image editor to fix it.

  • Related