So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By potz
#62970 Hello,
Why is the text no centered into the button?
Code: Select all<button onClick=location.href='./?LED=OFF\'
style='margin:auto;
background-color: #84B1FF;
color: yellow; 
padding: 0px 0px;
border: 0px solid #3F7CFF;
width:85px;
height:45px;
text-align: center;
 '><h1>ok


Of course if you put height à 85 the text is in the center. But I would like a low profile button with the highest text as possible.

What do I wrong?

Thanks
User avatar
By rudy
#62974 I don't know what you did wrong, but maybe this is good enough.

Code: Select all<button onClick=location.href='./?LED=OFF\'
style='   background-color: #4CAF50;
    border: none;
    color: white;
    padding: 0px 16px;
    text-align: center;
    text-decoration: none;
    margin: 4px 2px;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;'
 ><h1>ok
User avatar
By potz
#63081 It works but I would like a button shorter. It's too high.
If you add: height:45px; you don't see correctly the text. But there is enough place to write the text, no ?