When I add
overflow:hidden
to any of the buttons on my page, it creates 13px of margin at the bottom of the button. When I remove the above CSS, the margin disappears, however some content inside the button overflows.
How can I remove the margin at the bottom, while keeping the
overflow:hidden
CSS style?
WITH overflow:hidden
WITHOUT overflow:hidden
, however, the Facebook logo overflows into the next button (it is a custom font)
CURRENT BUTTON CSS:
.btn {
background-color: #FF6347;
border: 1px solid #CC4F39;
color: #FFFFFF;
text-decoration: none;
padding: 7px 15px;
cursor: pointer;
font-size: 1em;
text-shadow: 0 1px 2px #000000;
display: inline-block;
overflow: hidden;
}
CURRENT BUTTON HTML:
<a class="btn btn-fb btn-xl" id="login_fb"><span class="icon-socialfacebookvariant"></span>Log In</a>
CURRENT FACEBOOK LOGO CSS:
[class^="icon-"], [class*=" icon-"] {
overflow:hidden;
}
[class^="icon-"]:before, [class*=" icon-"]:before {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
font-size:2em;
line-height:0;
font-family: 'icomoon';
position:relative;
top:-1px;
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
vertical-align:middle;
}
// Facebook logo from a font
.icon-socialfacebookvariant:before {
content: "\e9e3";
}
Thanks Jaunt for the help.
Although your idea is the most logical, it's not very nice when editing!
Luckily I happened to come across a simple fix to my problem!
All I had to do was add vertical-align:top
to my button CSS, and wham! it works!
Thanks for your help :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With