I am facing an issue with aligning a span
element in a nested div structure. The main row
div contains a child div named horizontal-form
, which further includes two form-group
divs. Each form-group
div has a child div called input-group
, housing an a
tag and a text span
. I want to align these spans to the rightmost position within either the row
or horizontal-form
div. I tried using the class = pull-right
but it only aligned the span relative to the immediate input-group
div.
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.0/css/font-awesome.min.css" rel="stylesheet"/>
<link href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<div class="row">
<div class="horizontal-form">
<div class="form-group">
<div class="input-group subQuestionsLabel" data-toggle="collapse" >
<a href="javascript:">FirstItem</a>
<span class="button">
<button type="button" class="btn btn-default"><i class="fa fa-indent"></i> </button>
</span>
</div>
</div>
<div class="form-group">
<div class="input-group subQuestionsLabel" data-toggle="collapse" >
<a href="javascript:">SecondItem</a>
<span class="button">
<button type="button" class="btn btn-default"><i class="fa fa-indent"></i> </button>
</span>
</div>
</div>
</div>
</div>