Mozilla Firefox breakes html layout - html

I have a problem with my page layout in the Mozilla Firefox web-browser. I use bootstrap and quite simple layout.
<form role="form">
<div class="...">
<button class="btn btn-block"></button>
</div>
<div class="entry-placeholder">
<input class="form-control entry" type="text" />
</div>
</form>
<div class="top-buffer-medium"></div>
<div class="dropdown">
...
</div>
<div class="...">
<div class="btn-group">
<span class="btn btn-default">
<span class="glyphicon glyphicon-calendar"></span>
</span>
<span class="btn btn-default">
<span class="glyphicon glyphicon-chevron-left"></span>
</span>
<span class="btn btn-default">
<span class="glyphicon glyphicon-chevron-right"></span>
</span>
</div>
</div>
<div class="btn">
<button class="btn btn-default btn-block"></button>
</div>
<div class="btn">
<button class="btn btn-default btn-block"></button>
</div>
<div class="table">
<table class="table table-hover table-striped">
<tr ng-repeat="...">
<td>
<input type="checkbox" ng-model="isRowSelected" />
</td>
<td></td>
<td></span>
</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</div>
I use the default bootstrap css and no custom styles for the table. All browsers display my layout properly. And only Firefox brekes it. As you can see the table goes too far right. I thought that the problem is in the body position and tried to add
.body {
-webkit-position: absolute;
-khtml-position: absolute;
-moz-position: absolute;
position: absolute;
}
But it didn't help.

As mentioned in the comments, put all your button in a row div and your table in a different one:
<form>
<div class="row">
<!-- ALL your buttons -->
</div>
<div class="row">
<!-- Your table -->
</div>
</form>
Also body style position: absolute; is just plain wrong.

Related

how to align divs inside a td horizontally?

as shown in the image,things are deranged a bit, maybe its because its inside a td.
is it possible to do that?
<td>
<div class="col">
<div class="input-group text-center">
<div class="input-group-btn">
<button class="btn btn-primary" type="submit" id="button-minus"> - </button>
</div>
<input type="text" class="form-control" value="1" size="1">
<div class="input-group-btn">
<button class="btn btn-primary" type="submit" id="button-plus"> + </button>
</div>
</div> <!-- input-group.// -->
</div> <!-- Col.// -->
</td>
You might try to remove the default Bootstrap padding and margin for td, p, button and try :
td {
padding: 0;
margin: 0;
}
You can place the buttons and form on the same line by adding display: inline-flex to .input-group
.input-group {display: inline-flex}
<td>
<div class="col">
<div class="input-group text-center">
<div class="input-group-btn">
<button class="btn btn-primary" type="submit" id="button-minus"> - </button>
</div>
<input type="text" class="form-control" value="1" size="1">
<div class="input-group-btn">
<button class="btn btn-primary" type="submit" id="button-plus"> + </button>
</div>
</div> <!-- input-group.// -->
</div> <!-- Col.// -->
</td>

New to Modals and can not get modal to appear when button is selected

On this screen, a user can see all the questions from the database. Features include the ability to move the order of the question, delete, or add a question. When the user selects add I want a modal to appear. The following code will not work and is nonresponsive when I hit add.
<div class="modal" id="addQuestion" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button class="close" data-dismiss="modal">×</button>
<h4>DemoTitle</h4>
</div>
<div class="modal-body">
<p>put a lot of stuff here</p>
</div>
<div class="modal-footer">
<button class="btn btn-primary" data-dismiss="modal">close</button>
</div>
</div>
</div>
<div class="admin-center">
<table id="main-table" class="table table-striped table-bordered">
<thead>
<tr>
<th class="select-all">
<input type="checkbox" class="hide" id="select-all-checkbox" />
<h3><label style="font-weight:normal;" for="select-all-checkbox">Select</label></h3>
</th>
<th><h4 class="nobr"><label>Position</label></h4></th>
<th><h4 style="text-align:left;" class="nobr"><label>Question</label></h4></th>
</tr>
</thead>
<tbody>
#foreach (var question in Model.allQuestions)
{
<tr>
<td><input type="checkbox" name="select" value="#question.position" /></td>
<td>#question.position</td>
<td style="text-align:left;">#question.question</td>
</tr>
}
</tbody>
</table>
<br />
<br />
<div class="admin-center">
<button id="btnUp" class="btn btn-lg btn-primary">Move Up</button>
<button id="btnDown" class="btn btn-lg btn-primary">Move Down</button>
</div>
<br />
<div class="admin-center">
<a class="btn btn-lg btn-primary" data-toggle="#addQuestion">Add Questions</a>
<a class="btn btn-lg btn-primary">Delete Question</a>
</div>
#addQuestion Should be the value of data-target attribute. Also data-toggle attribute should have a value of modal
This should work
<a class="btn btn-lg btn-primary" data-toggle="modal"
data-target="#addQuestion">Add Questions</a>
Assuming you have properly loaded the needed JavaScript files(bootstrap) and you do not have any other script errors in the page which is preventing the script needed for modal dialog to work properly.(You can verify this in console tab of your F12 dev tools)
Here is a working JSFiddle for you to refer http://jsbin.com/neyixukuzu/edit?html,console,output
please add two attribute to your a link
data-toggle="modal" data-target="#addQuestion"

Divide spacing in bootstrap group of buttons

How to get equal spacing in this group of buttons?
When I add pull-right to the class the search and plus buttons is set to below the search box.
<tr>
<th class="col-md-3">
<small>Firma</small>
<span class="glyphicon glyphicon-sort-by-alphabet glyph_sorting" aria-hidden="true"></span>
<span class="glyphicon glyphicon-sort-by-alphabet-alt glyph_sorting" aria-hidden="true"></span>
</th>
<th class="col-md-3"><small>Plaats</small></th>
<th class="col-md-3"><small>Telefoon</small></th>
<th class="col-md-3">
<form action="" method="post">
<div class="form-group col-xs-8">
<input type="text" class="form-control input-sm" placeholder="Search">
</div>
<button type="submit" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-search" aria-hidden="true"></span></button>
<button type="button" class="btn btn-sm"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></button>
</form>
</th>
</tr>
Edit based on comment:
Set parent container (form) to flexbox row, and center it's children elements horizontally with even space in-between with justify-content:space-between & vertically with align-items:center.
Override bootstrap's .form-control's padding & margin, which is whats causing the space async between buttons & the search input.
form {
display: flex;
flex-flow: row wrap;
justify-content: space-between;
align-items: center;
}
div.form-group {
padding: 0;
margin: 0;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<table>
<tr>
<th class="col-md-3">
<small>Firma</small>
<span class="glyphicon glyphicon-sort-by-alphabet glyph_sorting" aria-hidden="true"></span>
<span class="glyphicon glyphicon-sort-by-alphabet-alt glyph_sorting" aria-hidden="true"></span>
</th>
<th class="col-md-3"><small>Plaats</small></th>
<th class="col-md-3"><small>Telefoon</small></th>
<th class="col-md-3">
<form action="" method="post">
<div class="form-group col-xs-8">
<input type="text" class="form-control input-sm" placeholder="Search">
</div>
<button type="submit" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-search" aria-hidden="true"></span></button>
<button type="button" class="btn btn-sm"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></button>
</form>
</th>
</tr>
</table>

Angular Datepicker displaying twice in bootstrap modal

I'm new to Angular JS. I was working with Angular JS calendar and am trying to display the angular Datepicker inside Bootstrap modal window. However the Datepicker is displayed twice as shown in the image below.
Here's my modal html code.
<div class="modal-header">
<h3 class="modal-title">{{ vm.event.event.title }}</h3>
</div>
<div class="modal-body" ng-repeat="event in vm.event track by $index">
<h3 class="post-subtitle">
{{event.type}}
</h3>
<table class="table table-bordered">
<thead>
<th>Starts on</th>
<th>Ends on</th>
</thead>
<tbody>
<td>
<p class="input-group" style="max-width: 250px">
<input
type="text"
class="form-control"
readonly
uib-datepicker-popup="dd MMMM yyyy"
ng-model="event.startsAt"
is-open="event.startOpen"
close-text="Close" >
<span class="input-group-btn">
<button
type="button"
class="btn btn-default"
ng-click="vm.object.toggle($event, 'startOpen', event)">
<i class="glyphicon glyphicon-calendar"></i>
</button>
</span>
</p>
<uib-timepicker
ng-model="event.startsAt"
hour-step="1"
minute-step="15"
show-meridian="true">
</uib-timepicker>
</td>
<td>
<p class="input-group" style="max-width: 250px">
<input
type="text"
class="form-control"
readonly
uib-datepicker-popup="dd MMMM yyyy"
ng-model="event.endsAt"
is-open="event.endOpen"
close-text="Close">
<span class="input-group-btn">
<button
type="button"
class="btn btn-default"
ng-click="vm.object.toggle($event, 'endOpen', event)">
<i class="glyphicon glyphicon-calendar"></i>
</button>
</span>
</p>
<uib-timepicker
ng-model="event.endsAt"
hour-step="1"
minute-step="15"
show-meridian="true">
</uib-timepicker>
</td>
</tbody>
</table>
</div>
<div class="modal-footer">
<button class="btn btn-primary" ng-click="$close()">OK</button>
</div>

how to include an html file to a single application, for example if you click add button it should display the content about add button?

I have a form which search for the country code, name, and a valid date. It has got two buttons named search and cancel. At the bottom of a form it also has four buttons named terminate, add, edit, and delete. When you click add button it should display another that has the following, but I just do not have an idea on how am I gonna make this work.
Here is the html file for both forms:
<div class="container">
<div class="row">
<div class="col-md-4">
<thead>
<hr>
<div class="panel panel-default">
IETA-Admin-Exchange Rate
</div>
</thead>
<div class="panel panel-success">
<div class="table-responsive">
<table class="table table-striped">
<tr>
<th>Code</th>
<th>Rate</th>
<th>Start Date</th>
<th>End Date</th>
</tr>
<tr>
<td>ZAR</td>
<td>1.02</td>
<td>13/10/15</td>
<td>12/11/15</td>
</tr>
<tr>
<td>LUX</td>
<td>1.02</td>
<td>13/10/15</td>
<td>12/11/15</td>
</tr>
<tr>
<td>JPY</td>
<td>1.02</td>
<td>13/10/15</td>
<td>12/11/15</td>
</tr>
<tr>
<td>EEK</td>
<td>1.02</td>
<td>13/10/15</td>
<td>12/11/15</td>
</tr>
<tr>
<td>CAD</td>
<td>1.02</td>
<td>13/10/15</td>
<td>12/11/15</td>
</tr>
</table>
</div>
</div>
</div>
<div class="col-md-8">
<hr>
<p>Search___________________________________________________________________________________________________________________________________________________________</p>
<form class="form-vertical">
<div class="col-md-12">
<div class="form-group">
<label for="code" class="col-md-8 control-label">Code:</label>
<div class="col-md-12">
<input type="text" class="form-control" ng-model="code">
</div>
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<label for="name" class="col-md-8 control-label">Name:</label>
<div class="col-md-12">
<input type="text" class="form-control" ng-model= "name">
</div>
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<label for="date" class="col-md-12 control-label">Valid On:</label>
<div class="col-md-6">
<input type="date" class="form-control" ng-model="date">
</div>
</div>
</div>
<div class="jumbotron text-right">
<button ng-click="search()" class="btn btn-active btn-sm">
<span class="glyphicon glyphicon-search">Search</button>
<button ng-click="cancel()" class="btn btn-active btn-sm">
<span class="glyphicon glyphicon-remove"></span>Cancel</button>
</div>
</form>
</div>
</div>
<hr>
<!-- Add html file-->
<!-- end of Add html-->
<div class="jumbotron text-right">
<div class="col-md-12">
<button ng-click="terminateToday()" class="btn btn-active btn-sm">Terminate Today</button>
<button ng-click="add()" class="btn btn-active btn-sm">
<span class="glyphicon glyphicon-plus"></span>Add</button>
<button ng-click="edit()" class="btn btn-active btn-sm">
<span class="glyphicon glyphicon-edit"></span>Edit</button>
<button ng-click="delete()" class="btn btn-active btn-sm">
<span class="glyphicon glyphicon-trash"></span>Delete</button>
</div>
</div>
</div>
<!-- end of Add html-->
Please help!