Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glyphicon in input-prepend off by 1 pixel #11633

Closed
Scowen opened this issue Nov 27, 2013 · 2 comments
Closed

Glyphicon in input-prepend off by 1 pixel #11633

Scowen opened this issue Nov 27, 2013 · 2 comments

Comments

@Scowen
Copy link

Scowen commented Nov 27, 2013

When using a glyphicon in the input prepend, like a search icon for a search bar, the prepended CSS is off by one pixel. Here is the code I used to test:

<div class="input-group input-group-lg">
    <span class="input-group-addon glyphicon glyphicon-search"></span>
    <input class="form-control" type="text" name="input">
</div>

By adding 'style="top: 0px;" ' to the span, this was fixed, example:

<span class="input-group-addon glyphicon glyphicon-search" style="top: 0px;"></span>

I have only tested this in Chrome.

@cvrebert
Copy link
Collaborator

You should put the glyphicon classes on a nested span within the add-on, not on the add-on span itself.

@Arcrammer
Copy link

Thanks!
Here's a demonstration of what cvrebert said:
<span class="input-group-addon"><span class="glyphicon glyphicon-search"></span></span> as opposed to <span class="input-group-addon glyphicon glyphicon-search"></span>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants