Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Removing empty white bar in HTML

I’m just coding an "exit" button for a game client I’m making in electron, and after writing the code for the button it shows up with a huge white bar beside it. I was also wondering how to move it up and into the top middle of the page with translateX(percentage) and couldn’t figure it out. =

White bar bug

.ExitButton {
  color: red;
  font-size: 25px;
  max-width: 55px;
  length: 30px;
  border-color: black;
  transition-duration: 0.4s;
  cursor: pointer;
  text-align: center;
}

.ExitButton:hover {
  background-color: black;
}

.Exitbutton {
  background-color: transparent;
}
<webview src="https://bapbap.gg"></webview>

<button class="ExitButton" onclick="alert('Are you sure you want to exit BapClient?')">Exit</button>
</button>

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

I assume that this occurs because your body tag has white background-color, try changing it with the background color of the page, or you can also do something like this:

.ExitButton {
/* ... */
position: absolute;
/* make the button 0 pixels away from bottom of the page */
bottom:0;
/* you can use top, left or right just like this way 
to put the button on anywhere on the page you want */
}

This would essentially give an absolute position to your button and enable you to put it anywhere you want. Use z-index if it overlaps with some elements.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading