Reputation: 10771
Ok so I have a an anchor element within a div with a fixed width, the anchor element needs to remain inline because the text that it holds is dynamic and it has a background because it is a button. I want the background of the button to only be the size of the length of text too. Is there a way to do so?
<div class="wrap">
<a class="button>Start »</a>
</div>
.wrap{
width:900px;
background:white;
}
a{
display:inline;
background:black;
}
Upvotes: 0
Views: 104
Reputation: 19062
I think
.wrap{
width:900px;
text-align: center;
}
will do the trick
See
Upvotes: 1