I'd like to align a caret with a dotted bottom border.
I managed to achieve it using this code but it works only in Chromium.
HTML:
<h2 id="a11y-291">
More <div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle h2Title" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="dashedUnderline">albums</span>
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li>
artists
</li>
<li class="active">
albums
</li>
</ul>
</div>
</h2>
and css:
.noMarginTop {
margin-top: 0;
}
.h2Title {
border: none;
font-size: 30px;
padding: 0;
line-height: 1em;
}
.h2Title:active,
.h2Title:hover,
.h2Title:focus {
background-color: transparent;
}
.caret {
display: inline-block;
margin-top: 1em; // Not aligned in FF
}
.h2Title .caret {
margin-left: 3px;
}
.dashedUnderline {
border-bottom: 1px dotted black;
}
.dropdown-menu {
left: 0;
right: 0;
min-width: 0;
}
It works as expected in Chromium:
But there is a slight offset in Firefox:
Has anyone a more reliable way to achieve this? I cannot figure out what differs between Firefox and Chromium resulting in an offset.
Thanks
.noMarginTop {
margin-top: 0;
}
.h2Title {
border: none;
font-size: 30px;
padding: 0;
line-height: 1em;
}
.h2Title:active,
.h2Title:hover,
.h2Title:focus {
background-color: transparent;
}
.h2Title .caret {
margin-left: 3px;
}
/* you must add display:inline-block to.dashedUnderline and .caret */
.dashedUnderline, .caret {
display:inline-block;
float:left;
}
.caret {
margin-top: 29px;
}
.dashedUnderline {
border-bottom: 1px dotted black;
}
.dropdown-menu {
left: 0;
right: 0;
min-width: 0;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://code.jquery.com/jquery-3.0.0.min.js" integrity="sha256-JmvOoLtYsmqlsWxa7mDSLMwa6dZ9rrIdtrrVYRnDRH0="
crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div class="btn-group">
<h2 id="a11y-291">
More
<button type="button" class="btn btn-default dropdown-toggle h2Title" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="dashedUnderline">albums</span>
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li>
artists
</li>
<li class="active">
albums
</li>
</ul>
</h2>
</div>
Related
I would like to create a simple two drop down buttons horizontal in bootstrap,
so far here is what I have done:
label{
font-size: 0.875rem;
color: #666666;
text-transform: uppercase;
line-height: 1;
margin-bottom: .5rem;
display: block;
display: flex;
position: absolute;
}
.dropdown-select{
width: 500px;
border-bottom-color: deepskyblue;
background-color: white;
border-top: 0px;
border-left: 0px;
border-right: 0px;
margin-right: 30px;
}
.dropdown-list{
margin-top: 50px;
}
.btn-group>.btn-group:not(:first-child)>.btn, .btn-group>.btn:not(:first-child)
{
border: none;
color: green;
background-color: white;
margin-left: -22px;
position: absolute;
left: 532px
}
<div class="container>
<div class="row">
<div class="btn-group dropdown-list">
<label class="label-status">Test1</label>
<button class="dropdown-select" type="button"
aria-haspopup="true" aria-expanded="false" data-toggle="dropdown">
<input type="hidden" > demo
</button>
<button [disabled]="disabled" type="button" class="btn btn-lg btn-secondary dropdown-toggle dropdown-toggle-split"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="sr-only">Toggle Dropdown</span>
</button>
<div class="dropdown-menu">
<button class="dropdown-item" type="button">Action</button>
</div>
<label class="label-serv">Test1</label>
<button class="dropdown-select" type="button"
aria-haspopup="true" aria-expanded="false" data-toggle="dropdown">
<input type="hidden" > demo
</button>
<button [disabled]="disabled" type="button" class="btn btn-lg btn-secondary dropdown-toggle dropdown-toggle-split"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="sr-only">Toggle Dropdown</span>
</button>
<div class="dropdown-menu">
<button class="dropdown-item" type="button">Action</button>
</div>
</div>
</div>
the code above gives me something like this:
wrong view
I tried different way I could not figure it out,
The actual result should look like this one below or similar:
actual view
any similar example , tutorials or help will be appreciated .
Thanks
Here is my example, maybe you can use some parts of that.
I prepared design as in your "actual view"
.content{
margin: 0;
width: 100%;
}
span{
font-size: 14px;
color: #ccc;
}
.dropbtn {
color: #333;
padding: 5px 5px 5px 0px;
font-size: 16px;
cursor: pointer;
}
.dropbtn span{
color: #62c2ea;
float: right;
transform: rotate(-90deg);
}
.dropdown {
position: relative;
display: inline-block;
border-bottom: 2px solid #62c2ea;
width: 40%;
margin-right: 30px;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #fff;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
width: 100%;
margin-top: 2px;
}
.dropdown-content a {
color: black;
padding: 16px 16px;
text-decoration: none;
display: block;
}
.dropdown-content a:hover {background-color: #f1f1f1}
.dropdown:hover .dropdown-content {
display: block;
}
<div class="content">
<div class="dropdown">
<span>Specjalista</span>
<div class="dropbtn">Dropdown 1 <span>❮</span></div>
<div class="dropdown-content">
Link 1
Link 2
Link 3
</div>
</div>
<div class="dropdown">
<span>Status</span>
<div class="dropbtn">Dropdown 2 <span>❮</span></div>
<div class="dropdown-content">
Link 4
Link 5
Link 6
</div>
</div>
</div>
I'm having trouble with centering Bootstrap button in panel. Margin right and left auto doesn't work.
Is there a way to properly center the button? The Button needs to be centered because of the mobile scale.
Code:
<div class="n_monitor">
<div class="panel panel-default">
<div class="panel-body">
<div class="btn-group">
<button type="button" class="btn btn-default">Server 1</button>
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu">
<li>Action</li>
</ul>
</div>
</div>
</div>
</div>
CSS:
.n_monitor .panel {
width: 628px;
border: solid 1px #ebebeb;
border-top-left-radius: 0px;
border-top-right-radius: 0px;
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
height: 94px;
box-shadow: none;
margin: 0;
background-color: #f4f4f4;
margin-left: auto;
margin-right: auto;
}
.n_monitor .btn {
width: 126px;
height: 54px;
background-color: #3baed8;
border: none;
color: #fff;
font-size: 14px;
border-radius: 3px;
}
Add Bootstrap's Alignment Class text-center to .panel-body.
#import url('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css');
.n_monitor .panel {
width: 100%;
border: solid 1px #ebebeb;
border-top-left-radius: 0px;
border-top-right-radius: 0px;
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
height: 94px;
box-shadow: none;
margin: 0;
background-color: #f4f4f4;
margin-left: auto;
margin-right: auto;
}
.n_monitor .btn {
width: 126px;
height: 54px;
background-color: #3baed8;
border: none;
color: #fff;
font-size: 14px;
border-radius: 3px;
}
<div class="n_monitor">
<div class="panel panel-default">
<div class="panel-body text-center">
<div class="btn-group">
<button type="button" class="btn btn-default">Server 1</button>
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu">
<li>Action</li>
</ul>
</div>
</div>
</div>
</div>
You can simply add "center-block" class to the button.
e.g.
<button class = "center-block">Test</button>
This always works the best for me. Particularity when using Bootstrap it works perfectly.
#button{
display: table; margin: 0 auto;
}
Center the text on the button's parent (.n_monitor .panel-body)
.n_monitor .panel-body
{
text-align: center;
}
I have a simple input that I am having trouble with trying to remove the hover/active styling on.
In the image below, I am trying to remove the grey background/slight border that it is adding when it is clicked. I just want it to be white, nothing should change when it is click or hovered over.
Here is a fiddle: https://jsfiddle.net/carlhussey/tfrpncu7/6/
<div class="input-group-btn">
<button aria-expanded="false" aria-haspopup="true" data-toggle="dropdown" class="btn btn-default btn-lg dropdown-toggle filterOptions" type="button"> <span class="caret"></span> <span class="sr-only">Toggle Dropdown</span>
</button>
.dropdown-menu>li>a:focus,
.dropdown-menu>li>a:hover {
background-color: transparent; /* Fix for dropdown-menu item hover background-color */
}
.filterOptions:hover,
.filterOptions:active{
background-color: white;
border-color: #ccc;
}
If you open DevTools and execute the dropdown button you'll see an event fire as far as .open being added to the input-group-btn class that you can the over ride as needed.
Working Example:
.div-cntr {
margin-top: 100px;
text-align: center;
max-width: 700px;
/*for example only*/
background: red;
min-height: 300px;
/*for example only*/
}
.form .open>.dropdown-toggle.filterOptions.focus,
.form .open>.dropdown-toggle.filterOptions:focus,
.form .open>.dropdown-toggle.filterOptions:hover .input-group-lg>.form-control,
.form .input-group.input-group-lg>.input-group-btn>.filterOptions {
border: 1px solid #ccc;
border-left: 0;
outline: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
border-radius: 0;
background: #fff;
}
.form .dropdown-menu.dropdown-menu-search {
top: 60px;
right: 110px;
border-radius: 0;
border: 0;
background: #fff;
}
.form .dropdown-menu.dropdown-menu-search:after {
top: -15px;
right: 10px;
position: absolute;
content: '';
border-width: 0px 15px 15px 15px;
border-style: solid;
border-color: #fff transparent;
height: 0;
width: 0;
}
.form .form-control.toolSearch,
.form .form-control.toolSearch:focus {
outline: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
border-radius: 0;
border: 1px solid #ccc;
border-right: 0;
}
.form .input-group-btn .btn.btn-search,
.form .input-group-btn .btn.btn-search.active {
border-radius: 0;
border: 1px solid #ccc;
border-left: 0;
}
.form .input-group-btn .btn.btn-search:hover,
.form .input-group-btn .btn-search:focus {
outline: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
border: 1px solid #ccc;
border-left: 0;
border-radius: 0;
background: #fff;
}
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<div class="container div-cntr">
<div class="form-group form">
<div class="input-group input-group-lg">
<input type="text" class="form-control toolSearch" id="toolSearch" name="toolSearch" placeholder="What are you looking for?">
<div class="input-group-btn">
<button aria-expanded="false" aria-haspopup="true" data-toggle="dropdown" class="btn btn-default btn-lg dropdown-toggle filterOptions" type="button"> <span class="caret"></span> <span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu dropdown-menu-right dropdown-menu-search">
<li>
<a href="#" class="small" data-value="option1" tabIndex="-1">
<input type="checkbox" /> Option 1</a>
</li>
<li>
<a href="#" class="small" data-value="option2" tabIndex="-1">
<input type="checkbox" /> Option 2</a>
</li>
<li>
<a href="#" class="small" data-value="option3" tabIndex="-1">
<input type="checkbox" /> Option 3</a>
</li>
<li>
<a href="#" class="small" data-value="option4" tabIndex="-1">
<input type="checkbox" /> Option 4</a>
</li>
<li>
<a href="#" class="small" data-value="option5" tabIndex="-1">
<input type="checkbox" /> Option 5</a>
</li>
<li>
<a href="#" class="small" data-value="option6" tabIndex="-1">
<input type="checkbox" /> Option 6</a>
</li>
</ul>
<button role="button" class="btn btn-lg btn-default btn-search"><span class="glyphicon glyphicon-search"></span> Search</button>
</div>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
Try:
.input-group .dropdown-toggle.filterOptions {
background: #fff!important;
}
.btn-default.active.focus, .btn-default.active:focus, .btn-default.active:hover, .open>.dropdown-toggle.btn-default:hover{
background-color: transparent;
}
Try above code
here is the fiddle
https://jsfiddle.net/6qbteca6/
.dropdown-menu {
right: 0;
left: auto;
}
.input-group .dropdown-toggle.filterOptions {
border-left: 0;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
z-index: 5; /* Fix for 2 input-group-btns and this one not being the last-child */
}
.input-group .dropdown-toggle.filterOptions{
background:none !important;
border-color:#ccc !important;
}
.filterOptions:hover,
.filterOptions:active{
background-color: white;
border-color: #ccc;
}
Try by adding this css
.filterOptions:active, .open > .dropdown-toggle.btn-default {
background-color: transparent !important;
border-color: #ccc !important;
}
I have a navbar dropdown with the 'bell' icon that will hopefully show some notifications.
When for example, I add more text lines to any list item, the sentence extends horizontally and does not break on a new line, thus the dropdown box just keeps exceeding in width.
I have added this image to show what I mean:
How do I stop this? I dont want to give it a fixed width because the list item just breaks free out of the dropdown box and goes on extending.
here is my code:
body {
padding-top: 102px;
background-color: #4d4d4d;
font-family: 'Lato', verdana, sans-serif;
}
.container {
width: 1530px;
margin-top: 0;
}
.navbar-fixed-top {
background-color: #fff;
}
.navbar-header {
min-height: 80px;
}
.hamburger-icon {
margin-top: 20px;
}
.navbar-default .navbar-brand {
line-height: 45px;
font-size: 45px;
color: #010101;
text-transform: uppercase;
}
.navbar-default .navbar-brand span {
font-style: normal;
color: #ff5500;
}
.search .input-group {
padding-top: 15px;
font-family: 'Lato', sans-serif;
}
.search .input-group input.search-field {
border-radius: 0;
border: 0;
box-shadow: none;
background-color: #fff;
font-size: 18px;
font-weight: 100;
}
.search .input-group input.search-field:hover {
background-color: transparent;
}
.search .input-group-btn button {
padding: 2px;
border: 0;
box-shadow: none;
background-color: transparent;
border-radius: 0;
}
.search .input-group-btn button:hover {
background-color: #f8f8f8;
color: #ff5500;
}
.search .input-group-btn .glyphicon-search {
font-size: 22px;
}
.dropdown-toggle.inbox {
padding-top: 15px;
margin-bottom: 5px;
}
.dropdown-menu li {
width: 400px;
}
.dropdown-menu.bell {
background-color: #f8f8f8;
border-radius: 0;
box-shadow: 0;
}
.dropdown-menu.bell h4 {
padding: 10px 0;
color: #010101;
text-align: center;
display: block;
}
.dropdown-menu.bell li a {
padding-top: 5px;
padding-bottom: 5px;
}
.nav>li.dropdown.bell>a:hover,
.nav>li.dropdown.bell>a:focus {
background-color: transparent;
}
.dropdown-menu.bell li.divider {
padding: 0;
margin: 0 20px;
}
.dropdown-menu.bell .label {
background-color: transparent;
color: #ff5500;
font-weight: 100;
}
.badge-notify {
background: #ff5500;
margin-top: -24px;
margin-left: -20px;
height: 1.7em;
}
/* caret for notification dropdown */
.dropdown-menu.bell:before {
position: absolute;
top: -10px;
right: 10%;
display: inline-block;
border-right: 10px solid transparent;
border-bottom: 10px solid #ccc;
border-left: 10px solid transparent;
border-bottom-color: rgba(0, 0, 0, 0.2);
content: '';
}
.dropdown-menu.bell:after {
position: absolute;
top: -9px;
right: 10%;
display: inline-block;
border-right: 9px solid transparent;
border-bottom: 9px solid #f8f8f8;
border-left: 9px solid transparent;
content: '';
}
.user span.fullname {
font-size: 14px;
color: #010101;
font-weight: 400;
}
.user span:last-child {
padding-right: 10px;
}
.user span:first-child {
padding-right: 30px;
padding-left: 10px;
}
.user .dropdown-menu.user-list {
width: 100%;
border-radius: 0;
border: 0;
background-color: #f8f8f8
}
.user .dropdown-menu.user-list li a {
margin: 5px 0px;
color: #010101;
}
.user .dropdown-menu.user-list li a:hover {
background-color: transparent;
color: #ff5500;
}
.user .dropdown-menu.user-list li.divider {
padding: 0;
margin: 0 20px;
}
/* Large desktop */
#media (max-width: 1590px) {
.container {
width: auto;
}
}
/* Portrait tablet to landscape and desktop */
#media (max-width: 979px) {}
/* Landscape phone to portrait tablet */
#media (max-width: 768px) {
.container {
width: auto;
}
.navbar-default .navbar-brand {
font-size: 40px;
}
.dropdown.bell .inbox {
width: 100% !important;
}
.dropdown-menu.bell h4 {
margin: 0 0;
}
.dropdown-menu.bell:before,
.dropdown-menu.bell:after {
display: none;
}
.bell,
.user {
text-align: center;
}
}
/* Landscape phones and down */
#media (max-width: 480px) {
.navbar-default .navbar-brand {
font-size: 30px;
}
}
<link href='https://fonts.googleapis.com/css?family=Lato' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.2/js/bootstrap.min.js"></script>
<div class="container">
<div class="navbar navbar-default navbar-fixed-top navbar-md" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle hamburger-icon" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
BRAND<span>LOGO</span>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<!-- search bar -->
<li class="dropdown search">
<form class="navbar-form" role="search">
<div class="input-group">
<input type="text" class="form-control search-field" placeholder="Search name or keyword" name="q">
<div class="input-group-btn">
<button class="btn btn-default" type="submit">
<img src="https://cdn2.iconfinder.com/data/icons/ios-7-icons/50/search-128.png" height="30" width="30" class=" avatar-img img-square">
</button>
</div>
</div>
</form>
</li>
<!-- notification bell -->
<li class="dropdown bell">
<a href="#" class="dropdown-toggle inbox" data-toggle="dropdown">
<img src="https://cdn4.iconfinder.com/data/icons/ionicons/512/icon-ios7-bell-outline-128.png" height="45" width="45" class=" avatar-img img-square">
<span class="badge badge-notify">1</span>
</a>
<ul class="dropdown-menu bell" role="menu">
<li>
<h4 class="menu-title">Notifications</h4>
</li>
<li><span class="label label-default">4:00 AM</span>Favourites Snippet
</li>
<li class="divider"></li>
<li><span class="label label-warning">4:30 AM</span>Email marketing
</li>
<li class="divider"></li>
<li><a href="#"><span class="label label-warning">5:00 AM</span>Subscriber focused email blaaaa
blaaaddddddddddddddddddddddddddddddddddddddddddddddddblaaadddddddddddddddddddddddddddddddddddddddddddddddd
design</a>
</li>
<li class="divider"></li>
<li>View All
</li>
</ul>
</li>
<!-- user login information -->
<li class="dropdown user">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<span><img src="https://cdn2.iconfinder.com/data/icons/ios-7-icons/50/user_male2-128.png" height="50" width="50" ></span>
<span class="fullname">Jacky Smith</span>
<span><img src="https://cdn0.iconfinder.com/data/icons/slim-square-icons-basics/100/basics-08-128.png" height="20" width="20" ></span>
</a>
<ul class="dropdown-menu user-list" role="menu">
<li>Action
</li>
<li class="divider"></li>
<li>Another action
</li>
<li class="divider"></li>
<li>Something else here
</li>
<li class="divider"></li>
<li>Separated link
</li>
<li class="divider"></li>
<li>One more separated link
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-12">
<p>dfsjfhskfs</p>
<!-- <div class="chevron right">
</div>
<div style="height: 1em;">
</div> -->
</div>
</div>
</div>
</div>
If you don't want to give a fixed width, then you may use max-width.
It will not set any fixed width but when the text will exceed the given max-width, it will automatically break down to a new line.
This works. You have to stick a DIV to all content and occupying 12 cells text, and do not overflow. In the text I have also gotten a span, texts can not go empty label, everything should always be labeled
<li>
<div class="col-xs-12">
<a href="#">
<span class="label label-warning">5:00 AM</span>
<span>iber focused email bla Subscriber focused email bla Subscriber focused email bla Subscriber focused email bla Subscriber focused email bla Subscriber focused email bla Subscriber focused email bla Subscriber focused email bla Subscriber focused email bla Subscriber focused email bla</span>
</a>
</div>
</li>
you should use a (max-width) for your div.
Property white-space: normal helps to wrap words on new line, when it necessary, but if you have too long words, property word-break: break-word helps you to break word on new line
.dropdown-menu.bell li a {
...
white-space: normal;
word-break: break-word;
}
JSFiddle-example
I finally got my solution working, with the help from the stackoverflow community!.
I included the following on my .dropdown-menu.bell > li > a:
white-space: normal;
width: 350px;
In the demonstration below, clicking the arrow in the small blue box opens a menu. But only clicking directly on the arrow itself will trigger the menu. How can I make a click anywhere in the small blue box open the menu?
I tried putting the <a> tag first, but the menu disappeared.
body {
margin-top: 50px;
}
ul.dropdown-menuoption {
top: auto;
background: #337ab7;
border-width: 0;
}
.prSemTA {
background: #337ab7;
border-radius: 3px;
font-size: 15px;
padding: 3px 5px 3px 4px
}
.prSemTA a {
color: #FFF;
text-decoration: none;
}
.prSemTA a:hover {
color: #333;
text-decoration: none;
}
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" />
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css" rel="stylesheet"/>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<div style="float:left;padding-left:5px;">
<div class="pull-left prSemTA">
<a href="" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<i class="glyphicon glyphicon-chevron-down"></i>
</a>
<ul class="dropdown-menu dropdown-menuoption">
<li> <i class="glyphicon glyphicon-comment"></i> xxx</li>
<li><i class="glyphicon glyphicon-heart"></i> xxx</li>
<li><i class="glyphicon glyphicon-edit"></i> xxx</li>
<li><i class="glyphicon glyphicon-remove"></i> xxxx</li>
</ul>
</div>
</div>
View on JSFiddle
You can try below code:
.prSemTA {
background: #337ab7;
border-radius:3px;
font-size:15px;
}
.prSemTA a {
color: #FFF;
text-decoration: none;
display:block;
padding:3px 5px 3px 4px
}
Working Demo