Bootstrap Input Group with Image
I am using bootstrap 3 for creating input groups with normal text as shown in image below

How can I get input group with image and also more than 2 span text.

I am using following code for normal input group
<div class="input-group input-group-lg">
<input type="text" style="background-color: black; color: white" class="form-control" aria-label="You Send">
<div class="input-group-btn">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Action <span class="caret"></span></button>
<ul class="dropdown-menu dropdown-menu-right">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">Separated link</a></li>
</ul>
</div>
<!-- /btn-group -->
</div>
<!-- /input-group -->Edit 1:

html css twitter-bootstrap twitter-bootstrap-3
add a comment |
I am using bootstrap 3 for creating input groups with normal text as shown in image below

How can I get input group with image and also more than 2 span text.

I am using following code for normal input group
<div class="input-group input-group-lg">
<input type="text" style="background-color: black; color: white" class="form-control" aria-label="You Send">
<div class="input-group-btn">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Action <span class="caret"></span></button>
<ul class="dropdown-menu dropdown-menu-right">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">Separated link</a></li>
</ul>
</div>
<!-- /btn-group -->
</div>
<!-- /input-group -->Edit 1:

html css twitter-bootstrap twitter-bootstrap-3
Can you clarify what you mean by two-span text? Are you talking about the dropdown search suggestions?
– Iskandar Reza Razali
Nov 16 '18 at 6:42
add a comment |
I am using bootstrap 3 for creating input groups with normal text as shown in image below

How can I get input group with image and also more than 2 span text.

I am using following code for normal input group
<div class="input-group input-group-lg">
<input type="text" style="background-color: black; color: white" class="form-control" aria-label="You Send">
<div class="input-group-btn">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Action <span class="caret"></span></button>
<ul class="dropdown-menu dropdown-menu-right">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">Separated link</a></li>
</ul>
</div>
<!-- /btn-group -->
</div>
<!-- /input-group -->Edit 1:

html css twitter-bootstrap twitter-bootstrap-3
I am using bootstrap 3 for creating input groups with normal text as shown in image below

How can I get input group with image and also more than 2 span text.

I am using following code for normal input group
<div class="input-group input-group-lg">
<input type="text" style="background-color: black; color: white" class="form-control" aria-label="You Send">
<div class="input-group-btn">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Action <span class="caret"></span></button>
<ul class="dropdown-menu dropdown-menu-right">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">Separated link</a></li>
</ul>
</div>
<!-- /btn-group -->
</div>
<!-- /input-group -->Edit 1:

<div class="input-group input-group-lg">
<input type="text" style="background-color: black; color: white" class="form-control" aria-label="You Send">
<div class="input-group-btn">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Action <span class="caret"></span></button>
<ul class="dropdown-menu dropdown-menu-right">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">Separated link</a></li>
</ul>
</div>
<!-- /btn-group -->
</div>
<!-- /input-group --><div class="input-group input-group-lg">
<input type="text" style="background-color: black; color: white" class="form-control" aria-label="You Send">
<div class="input-group-btn">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Action <span class="caret"></span></button>
<ul class="dropdown-menu dropdown-menu-right">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">Separated link</a></li>
</ul>
</div>
<!-- /btn-group -->
</div>
<!-- /input-group -->html css twitter-bootstrap twitter-bootstrap-3
html css twitter-bootstrap twitter-bootstrap-3
edited Nov 16 '18 at 8:54
Divyam Solanki
asked Nov 16 '18 at 4:40
Divyam SolankiDivyam Solanki
1642216
1642216
Can you clarify what you mean by two-span text? Are you talking about the dropdown search suggestions?
– Iskandar Reza Razali
Nov 16 '18 at 6:42
add a comment |
Can you clarify what you mean by two-span text? Are you talking about the dropdown search suggestions?
– Iskandar Reza Razali
Nov 16 '18 at 6:42
Can you clarify what you mean by two-span text? Are you talking about the dropdown search suggestions?
– Iskandar Reza Razali
Nov 16 '18 at 6:42
Can you clarify what you mean by two-span text? Are you talking about the dropdown search suggestions?
– Iskandar Reza Razali
Nov 16 '18 at 6:42
add a comment |
1 Answer
1
active
oldest
votes
There are many CSS tricks out there to embed images in the input field. Personally for me, if we're gonna be using Bootstrap, let's really use Bootstrap. And perhaps an icon pack like FontAwesome.
.search-icon:before {
font: normal normal normal 14px/1 FontAwesome;
content: "f002";
}<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"/>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text border-right-0 bg-white">
<!-- Stack overflow doesn't allow this, but if it did, I would not need
any custom css, just the following html only this:
<i class="fas fa-search"></i>
Instead I have to use this over here. -->
<span class="search-icon"></span>
</span>
</div>
<input type="text" class="form-control border-left-0" placeholder="Search">
</div>If you want to put your own custom image, you can edit the css like so:
.search-icon:before {
content: url(path/to/your-image.jpg);
}
I'll update my answer once you clarify what you mean by two-span text.
Hi, Please check I added new image, I am looking for such 2 texts type.
– Divyam Solanki
Nov 16 '18 at 8:54
@DivyamSolanki that deserves it's own questions as it's rather complicated. I do however highly recommend typeahead.js for that. It's fairly straightforward and there are enough question and answers on that topic here on stackoverflow. twitter.github.io/typeahead.js/examples
– Iskandar Reza Razali
Nov 16 '18 at 20:56
Thank you. Examples were helpful.
– Divyam Solanki
Nov 19 '18 at 10:56
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53331533%2fbootstrap-input-group-with-image%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
There are many CSS tricks out there to embed images in the input field. Personally for me, if we're gonna be using Bootstrap, let's really use Bootstrap. And perhaps an icon pack like FontAwesome.
.search-icon:before {
font: normal normal normal 14px/1 FontAwesome;
content: "f002";
}<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"/>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text border-right-0 bg-white">
<!-- Stack overflow doesn't allow this, but if it did, I would not need
any custom css, just the following html only this:
<i class="fas fa-search"></i>
Instead I have to use this over here. -->
<span class="search-icon"></span>
</span>
</div>
<input type="text" class="form-control border-left-0" placeholder="Search">
</div>If you want to put your own custom image, you can edit the css like so:
.search-icon:before {
content: url(path/to/your-image.jpg);
}
I'll update my answer once you clarify what you mean by two-span text.
Hi, Please check I added new image, I am looking for such 2 texts type.
– Divyam Solanki
Nov 16 '18 at 8:54
@DivyamSolanki that deserves it's own questions as it's rather complicated. I do however highly recommend typeahead.js for that. It's fairly straightforward and there are enough question and answers on that topic here on stackoverflow. twitter.github.io/typeahead.js/examples
– Iskandar Reza Razali
Nov 16 '18 at 20:56
Thank you. Examples were helpful.
– Divyam Solanki
Nov 19 '18 at 10:56
add a comment |
There are many CSS tricks out there to embed images in the input field. Personally for me, if we're gonna be using Bootstrap, let's really use Bootstrap. And perhaps an icon pack like FontAwesome.
.search-icon:before {
font: normal normal normal 14px/1 FontAwesome;
content: "f002";
}<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"/>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text border-right-0 bg-white">
<!-- Stack overflow doesn't allow this, but if it did, I would not need
any custom css, just the following html only this:
<i class="fas fa-search"></i>
Instead I have to use this over here. -->
<span class="search-icon"></span>
</span>
</div>
<input type="text" class="form-control border-left-0" placeholder="Search">
</div>If you want to put your own custom image, you can edit the css like so:
.search-icon:before {
content: url(path/to/your-image.jpg);
}
I'll update my answer once you clarify what you mean by two-span text.
Hi, Please check I added new image, I am looking for such 2 texts type.
– Divyam Solanki
Nov 16 '18 at 8:54
@DivyamSolanki that deserves it's own questions as it's rather complicated. I do however highly recommend typeahead.js for that. It's fairly straightforward and there are enough question and answers on that topic here on stackoverflow. twitter.github.io/typeahead.js/examples
– Iskandar Reza Razali
Nov 16 '18 at 20:56
Thank you. Examples were helpful.
– Divyam Solanki
Nov 19 '18 at 10:56
add a comment |
There are many CSS tricks out there to embed images in the input field. Personally for me, if we're gonna be using Bootstrap, let's really use Bootstrap. And perhaps an icon pack like FontAwesome.
.search-icon:before {
font: normal normal normal 14px/1 FontAwesome;
content: "f002";
}<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"/>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text border-right-0 bg-white">
<!-- Stack overflow doesn't allow this, but if it did, I would not need
any custom css, just the following html only this:
<i class="fas fa-search"></i>
Instead I have to use this over here. -->
<span class="search-icon"></span>
</span>
</div>
<input type="text" class="form-control border-left-0" placeholder="Search">
</div>If you want to put your own custom image, you can edit the css like so:
.search-icon:before {
content: url(path/to/your-image.jpg);
}
I'll update my answer once you clarify what you mean by two-span text.
There are many CSS tricks out there to embed images in the input field. Personally for me, if we're gonna be using Bootstrap, let's really use Bootstrap. And perhaps an icon pack like FontAwesome.
.search-icon:before {
font: normal normal normal 14px/1 FontAwesome;
content: "f002";
}<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"/>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text border-right-0 bg-white">
<!-- Stack overflow doesn't allow this, but if it did, I would not need
any custom css, just the following html only this:
<i class="fas fa-search"></i>
Instead I have to use this over here. -->
<span class="search-icon"></span>
</span>
</div>
<input type="text" class="form-control border-left-0" placeholder="Search">
</div>If you want to put your own custom image, you can edit the css like so:
.search-icon:before {
content: url(path/to/your-image.jpg);
}
I'll update my answer once you clarify what you mean by two-span text.
.search-icon:before {
font: normal normal normal 14px/1 FontAwesome;
content: "f002";
}<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"/>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text border-right-0 bg-white">
<!-- Stack overflow doesn't allow this, but if it did, I would not need
any custom css, just the following html only this:
<i class="fas fa-search"></i>
Instead I have to use this over here. -->
<span class="search-icon"></span>
</span>
</div>
<input type="text" class="form-control border-left-0" placeholder="Search">
</div>.search-icon:before {
font: normal normal normal 14px/1 FontAwesome;
content: "f002";
}<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"/>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text border-right-0 bg-white">
<!-- Stack overflow doesn't allow this, but if it did, I would not need
any custom css, just the following html only this:
<i class="fas fa-search"></i>
Instead I have to use this over here. -->
<span class="search-icon"></span>
</span>
</div>
<input type="text" class="form-control border-left-0" placeholder="Search">
</div>answered Nov 16 '18 at 7:13
Iskandar Reza RazaliIskandar Reza Razali
5961415
5961415
Hi, Please check I added new image, I am looking for such 2 texts type.
– Divyam Solanki
Nov 16 '18 at 8:54
@DivyamSolanki that deserves it's own questions as it's rather complicated. I do however highly recommend typeahead.js for that. It's fairly straightforward and there are enough question and answers on that topic here on stackoverflow. twitter.github.io/typeahead.js/examples
– Iskandar Reza Razali
Nov 16 '18 at 20:56
Thank you. Examples were helpful.
– Divyam Solanki
Nov 19 '18 at 10:56
add a comment |
Hi, Please check I added new image, I am looking for such 2 texts type.
– Divyam Solanki
Nov 16 '18 at 8:54
@DivyamSolanki that deserves it's own questions as it's rather complicated. I do however highly recommend typeahead.js for that. It's fairly straightforward and there are enough question and answers on that topic here on stackoverflow. twitter.github.io/typeahead.js/examples
– Iskandar Reza Razali
Nov 16 '18 at 20:56
Thank you. Examples were helpful.
– Divyam Solanki
Nov 19 '18 at 10:56
Hi, Please check I added new image, I am looking for such 2 texts type.
– Divyam Solanki
Nov 16 '18 at 8:54
Hi, Please check I added new image, I am looking for such 2 texts type.
– Divyam Solanki
Nov 16 '18 at 8:54
@DivyamSolanki that deserves it's own questions as it's rather complicated. I do however highly recommend typeahead.js for that. It's fairly straightforward and there are enough question and answers on that topic here on stackoverflow. twitter.github.io/typeahead.js/examples
– Iskandar Reza Razali
Nov 16 '18 at 20:56
@DivyamSolanki that deserves it's own questions as it's rather complicated. I do however highly recommend typeahead.js for that. It's fairly straightforward and there are enough question and answers on that topic here on stackoverflow. twitter.github.io/typeahead.js/examples
– Iskandar Reza Razali
Nov 16 '18 at 20:56
Thank you. Examples were helpful.
– Divyam Solanki
Nov 19 '18 at 10:56
Thank you. Examples were helpful.
– Divyam Solanki
Nov 19 '18 at 10:56
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53331533%2fbootstrap-input-group-with-image%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Can you clarify what you mean by two-span text? Are you talking about the dropdown search suggestions?
– Iskandar Reza Razali
Nov 16 '18 at 6:42