CrazySynthax CrazySynthax - 4 months ago 10
AngularJS Question

Why don't I get all 4 elements in the same row?

Please look at the following code:

<div class="container">
<form class="form-inline" role="form">
<div class="form-group">
<label for="first">FIRST</label>
<input class="form-control" id="first" ng-model="???" ng-readonly="true" />
</div>

<div class="form-group">
<label for="second">SECOND</label>
<input class="form-control" id="second" ng-model="???" ng-readonly="true" />
</div>

<div class="form-group">
<label for="third">THIRD</label>
<input class="form-control" id="third" ng-model="???" ng-readonly="true" />
</div>

<div class="form-group">
<label for="fourth">FOURTH</label>
<input class="form-control" id="fourth" ng-model="???" ng-readonly="true" />
</div>
</form>
</div>


My purpose was to create a form with 4 elements in ONE line.
I wrote this code based on this example: http://www.w3schools.com/bootstrap/tryit.asp?filename=trybs_form_inline&stacked=h.

However, I got each one of these elements in a different line. Do you know why this code example didn't work out?

Answer

Maybe you need add these scripts and CSS:

<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
Comments