Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create space between inline-block buttons?

Tags:

html

css

tumblr

I am very new to this, so sorry for any misuse of vocab. I want to have a space between two buttons, which have an inline-block display. The "margin" property doesn't do what I need it to do.

CSS:

.pagination{
    background:#155484;
    padding:20px;
    border:2px solid #155484;
    border-radius:3px;
    position:absolute;
    left:75%;
    top:75%;
}

.pagination li{
    display:inline-block;
    list-style-type:none;
}

.pagination a{
    color:#fff;
    text-decoration:none;
}

HTML

<div class="pagination">
{block:Pagination}
            {block:PreviousPage}
                <a href="{PreviousPage}">&larr;</a>
            {/block:PreviousPage}
            {block:NextPage}
                <a href="{NextPage}">&rarr;</a>
            {/block:NextPage}
        {/block:Pagination}
</div>

(This is using Tumblr-specific variables.)

Also if there's anything in here that can be changed or omitted, that would be great to know!

like image 363
Helmet Avatar asked Mar 09 '26 07:03

Helmet


1 Answers

Here are 3 examples that will add spaces in this scenario:

  1. Using &nbsp; codes between links

    link # 1 ( a href ...)

    &nbsp; &nbsp; &nbsp; &nbsp;

    link # 2 (a href ...)

2. Using an empty <span class="spacing"></span>

'spacing' can be defined in css as:

.spacing {
    padding-right: 20px;
}

3. Adjusting the padding-right property of <a> tag

.pagination a {
    padding-right: 20px;
    // other attributes
}
like image 183
Gopinath Avatar answered Mar 11 '26 22:03

Gopinath



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!