A
A
AlShest2019-02-26 18:22:47
css
AlShest, 2019-02-26 18:22:47

Why do custom slider buttons behave differently in different browsers?

I customized the dots buttons of the slick slider: dots in a circle. In Firefox and Edge browsers, everything is displayed as it should, and in Chrome, when the browser window is resized, the dot starts to randomly twitch and move.
Here is the code:

.my-dots {
  display: block;
  width: 100%;
  padding: 0;
  list-style: none;
  text-align: center;
}
.my-dots li {
  position: relative;
  display: inline-block;
  width: 10px;
  height: 10px;
  margin: 0 5px;
  padding: 0;
  cursor: pointer;
}
.my-dots li button {
  display: block;
  width: 10px;
  height: 10px;
  cursor: pointer;
  color: transparent;
  background-color: #eeeeed;
  border: 1px solid @base-red;
  -moz-border-radius: 50%;
  -webkit-border-radius: 50%;
  border-radius: 50%;
  outline: none;
}
.my-dots li button:hover,
.my-dots li button:focus {
  outline: none;
}
.my-dots li.slick-active button:before {
   position: absolute;
      display: block;
      height: 4px;
      width: 4px;
      -moz-border-radius: 50%;
  		-webkit-border-radius: 50%;
      border-radius: 50%;
      background: @base-red;
      content:  '';
      margin: 2px;
}
.slick-dotted.slick-slider {
    margin-bottom: 0;
}

Tried to ask Chrome hack, but it did not help.
How can this be fixed or changed?
5c7559c1365d6278549290.png
upd: codepen renders circles as ovals https://codepen.io/AlShest/pen/xBbLbK

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
galkan, 2019-02-26
@galkan

Chrome adds button padding, you just need to reset them.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question