Iqbal hossain
Iqbal hossain

Reputation: 1816

Set close icon on right side of Bootstrap Modal

I am using the Twitter-Bootstrap Modal currently, and I need to close an icon on the right-hand side of the header. I tried to use CSS to set it, but it didn't work.

The code:

<div class="modal-content json-modal-body" id="full-width" ng-controller="projectdetailsController" close="CloseModal()">
    <div class="modal-header modal-header-confirm">
        <h4 class="modal-title ng-binding">
            <span class="glyphicon glyphicon-indent-left"></span>{{modalOptions.headerText}}
            <a title="Close"><i ng-click="CloseModal()" class="glyphicon glyphicon-remove icon-arrow-right"></i></a> 
        </h4>
    </div>
    <div class="modal-body"> 
         <pre class="Modal-pre" ng-bind-html="modalOptions.bodyText"></pre>
    </div>
</div>

The CSS that I tried to use:

 .icon-arrow-right {
  float: right;
  }

Upvotes: 1

Views: 17521

Answers (1)

Prashanth R
Prashanth R

Reputation: 181

<div class="modal-content json-modal-body" id="full-width" ng-controller="projectdetailsController" close="CloseModal()">
<div class="modal-header modal-header-confirm">
    <h4 class="modal-title ng-binding">
        <span class="glyphicon glyphicon-indent-left"></span>{{modalOptions.headerText}}
        <a title="Close"><i ng-click="CloseModal()" class="glyphicon glyphicon-remove icon-arrow-right pull-right"></i></a> 
    </h4>
</div>
<div class="modal-body"> 
     <pre class="Modal-pre" ng-bind-html="modalOptions.bodyText"></pre>
</div>
</div>

Just add a pull-right to the class to make the element appear right. The above code should work

Upvotes: 5

Related Questions