1

I have a 'Download' button on my HTML webpage and I have set some attributes for it.

Whenever I refresh my page, the button appears like this, very rarely:

Text Outside the Button

But then, it will look like this and this is the normal-looking button:

Normal Button

.navbar-download-btn {
  position: absolute;
  right: 4%;
  top: 5.7%;
  color: white;
  background-color: blue;
  border: 2.2px solid white;
  padding: 0.8%;
  border-radius: 3.5px;
  outline: none;
  cursor: pointer;
  font-weight: bolder;
  font-family: Noto Sans KR, sans-serif;
  letter-spacing: 0.7px;
  transition: 0.7s;
}
<a href="#Download"><button class="navbar-download-btn nonindex">Download</button></a>
TylerH
  • 20,799
  • 66
  • 75
  • 101
  • Please provide a [mre] so we can help you. – D. Pardal Oct 05 '20 at 13:42
  • Welcome to Stack Overflow! Please visit the [help], take the [tour] to see what and [ask]. Do some research, search for related topics on SO; if you get stuck, post a [mcve] of your attempt, noting input and expected output using the `[<>]` snippet editor. Post CODSE, not just pictures. "I have set some attributes" - we cannot guess what you did there – mplungjan Oct 05 '20 at 13:43
  • I added the code. –  Oct 05 '20 at 13:45
  • Your class is `navbar-download-btn-nonindex` but your CSS does `navbar-download-btn` – mplungjan Oct 05 '20 at 13:46
  • I have 2 'Download' buttons but the problem is with the CSS. –  Oct 05 '20 at 13:47
  • Please fix the snippet I made you to show the actual issue. Transparent and white does not show here. I made it blue – mplungjan Oct 05 '20 at 13:52
  • Add a width rule `width:8rem`, should be it. – NVRM Oct 05 '20 at 14:13

2 Answers2

0

I think there might be a problem in the padding of the download button, Increase the padding from the right and also try running this code in other browsers, this had been a problem for me too earlier but sometimes it could just be your browser...

Harsh
  • 100
  • 1
  • 10
-1
text-align: center;
margin-right: 
SK-the-Learner
  • 523
  • 5
  • 18
kelvinoff
  • 46
  • 4