Becky Becky - 1 year ago 62
CSS Question

Span around button causing issues

I have a span around a button and for some reason the text/button I made is not extending the full width of the container so that it is all on one line. I have tried setting the width to 100% the

as well as the link itself. Nothing seems to work. It works in the snippet, but not on my actual page. Any ideas why not?

#like-links a {
font-size: 1.2em;
text-decoration: none;
width: 100%;
#like-links-button {
padding: 15px 20px;
border: 2px solid #000;
-webkit-transition: ease-in-out .5s;
transition: ease-in-out .5s;
color: #000;

<div id="like-links"><a href="discuss-project"><span id="like-links-button">DISCUSS DESIGN PROJECT</span></a></div>

Answer Source

adding display: inline-block to your span makes it look correct for me.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download