G
G
Grizmar2014-09-26 11:47:54
css
Grizmar, 2014-09-26 11:47:54

How to remove padding for an image placed in a navigation bar button (bootstrap)?

It is necessary to make the button have an image that occupies the entire height of this button, but bootstrap indents for it, how to remove them?
b5bc2851114645dd9368c69a0a30a1af.png
Here is the html and css:

<nav class="navbar navbar-fixed-top navbar-inverse" role="navigation">
    <section class="container">
        <div class="btn-group navbar-btn">
            <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                <img src="/img/0.jpg" alt="..." class="img-responsive img-logo">
                <span class="caret"></span>
            </button>
            <ul class="dropdown-menu" role="menu">
                <li><a href="#">Действие</a></li>
                <li><a href="#">Другое действие</a></li>
                <li><a href="#">Что-то иное</a></li>
                <li class="divider"></li>
                <li><a href="#">Отдельная ссылка</a></li>
            </ul>
        </div>                
    </section><!-- /.container -->
</nav>
<!-- /navigation -->

.img-logo {
    border: 2px solid black;
    border-radius: 4px;
    height: 100px;
    padding: 0;
    margin: 0;
}

PS
Indents are removed if the margin is negative in the img-logo class, but it seems to me that it is wrong to do this and in this case other content runs over the image.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
Heafy, 2014-09-26
@Grizmar

try changing this class like this:
.navbar-btn {
margin-top: 0;
margin-bottom: 0
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question