Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

234
Views
How do I remove this graphical error for this button?

I am new to web development and I have a bug that I cannot seem to fix. Basically, I have a button that highlights when its hovered and it works but there is a small outline of the original color when hovered. I'm pretty sure this is not because of an outline or a border. The bug is displayed in the picture provided. Here is the code:

body {
    background-color: #2d2f31;
}

.start{
    width: 200px;
    height: 75px;
    border: none;
    color:black;
    background-color: beige;
    border-radius: 50px;
    box-shadow: inset 0 0 0 0 rgb(36, 36, 37);
    font-size: 15px;
    outline: 0;
    transition: 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
}

.start:hover{
    box-shadow: inset 200px 0 0 0 rgb(36, 36, 37);
    color: white;
}
<div class=buttondiv>
        <button onclick="coming('maintext', '#F0F');" class='start' >button</button>
 </div>

enter image description here

EDIT: I'm using Google Chrome and Windows 11 (idk if OS is important)

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

The box shadow is slightly transparent around those corners, allowing you to see the beige background color underneath. Changing the background color of the button on hover to the same color as the box shadow fixes this. The effect is ever so slightly different, but I can't really tell just from looking at it.

Also, on chrome, this box shadow transition blinks. I messed around with it and changed the 4th number to 1px and it stopped blinking. I couldn't tell you why, but there you go.

.start:hover{
    background: rgb(36, 36, 37);
    box-shadow: inset 200px 0 0 1px rgb(36, 36, 37);
    color: white;
}

body {
    background-color: #2d2f31;
}

.start{
    width: 200px;
    height: 75px;
    border: none;
    color:black;
    background-color: beige;
    border-radius: 50px;
    box-shadow: inset 0 0 0 0 rgb(36, 36, 37);
    font-size: 15px;
    outline: 0;
    transition: 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
    overflow: hidden;
}

.start:hover{
    background: rgb(36, 36, 37);
    box-shadow: inset 200px 0 0 1px rgb(36, 36, 37);
    color: white;
}
<div class=buttondiv>
        <button onclick="coming('maintext', '#F0F');" class='start' >button</button>
 </div>

about 4 years ago · Juan Pablo Isaza Report

0

I just got why it's like that. It's cause of your "beige" background. When I change it to "red" look how it is

red background button

Fix: Let's give background when :hover state is used

So your code will be like

.start:hover{
    box-shadow: inset 200px 0 0 0 rgb(36, 36, 37);
    color: white;
    background: rgb(36,36,37);
    }

Let me know how it is

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!