CSS - Move border closer to text

I have a link that I need a border, but I cannot get the border to get closer to the text. Below is the css for the element;

.signup{
    border: 1px solid;
    border-radius: 10px;}

      

which displays the border as;

image

If I add height: 1.2em

it will decrease the spacing of the bottom level, but not the top;

image 2

how to decrease the spacing above the text?

I am using a self-adapting theme http://bootswatch.com/flatly/ an element where I want the border to be "WrapBootstrap" in the upper right corner of the navbar.

+3


source to share


1 answer


You have to give the style border

yourself <span>

.

span{
 border: 1px solid black;
 border-radius: 10px;
 padding: 5px 10px;
}

      



Editing padding

will allow you to move the border out of the text.

In your case, position

<span>

and .margin

may cause a discrepancy. As @dfsq pointed out, there could be other factors as well.

+1


source







All Articles