JSP Bootstrap Div column issue - html

Good day! I am trying to generate different boxes in my page and I'm planning to have a layout that is something like this:
4x1 layout
But what happens to my file is that it generates boxes like this:
1x4 layout
When I do this hard coded, there are no problems. However, when I use scriptlets to get the values from my MySQL Database the problem appears. Any ideas on what I should do? Thank you!!! This is my code BTW:
<div class="content-wrapper">
<% EmployeeDAO personalInfo = new EmployeeDAO();%>
<% for (int i = 0; i < personalInfo.getAllPersonalInfo().size(); i++) {%>
<!-- Content Header (Page header) -->
<div class="row">
<div class="col-md-4 col-sm-4 col-xs-12 profile_details">
<div class="box-body">
<div class="col-sm-12">
<h4 class="brief"><i>Digital Strategist</i></h4>
<div class="left col-xs-7">
<h2 id="applicantName<%=+i%>" id="applicantName<%=+i%>">
<%=personalInfo.getAllPersonalInfo().get(i).getFirstName() + " "%><%=personalInfo.getAllPersonalInfo().get(i).getLastName()%>
</h2>
<p><strong>About: </strong> Web Designer / UX / Graphic Artist / Coffee Lover </p>
<ul class="list-unstyled">
<li><i class="fa fa-building"></i> Address: </li>
<li><i class="fa fa-phone"></i> Phone #: </li>
</ul>
</div>
<div class="right col-xs-5 text-center"> <img src="dist/img/user2-160x160.jpg" alt="" class="img-circle img-responsive"> </div>
</div>
<div class="col-xs-12 bottom text-center">
<div class="col-xs-12 col-sm-6 emphasis">
<p class="ratings"> <a>4.0</a> <span class="fa fa-star"></span> <span class="fa fa-star"></span> <span class="fa fa-star"></span> <span class="fa fa-star"></span> <span class="fa fa-star-o"></span> </p>
</div>
<div class="col-xs-12 col-sm-6 emphasis">
<button type="button" class="btn btn-success btn-xs"> <i class="fa fa-user"> </i> <i class="fa fa-comments-o"></i> </button>
<button type="button" class="btn btn-primary btn-xs" data-toggle="modal" data-backdrop="static" data-keyboard="false" data-target="#AddTicket<%=+i%>"> <i class="fa fa-user"> </i> View Profile </button>
</div>
</div>
</div>
</div>
</div>

As I can see there are 2 issues in your code.
If you want to loop 4 profile_details divs you should place the loop after row div since in bootstrap, "row" class define an actual row. With your code, you will get separate row for each profile_details.
closing brackets for "for loop" is missing
Fix those things first and check

Related

Responsive bootstrap panel header with buttons?

I need some advice to make bootstrap panel header responsive. Panel has title with several buttons on the right side. It looks fine in large screen but looks ugly when browser size is small.
My full code here jsfiddle.
.panel {
margin: 15px;
}
.panel-title {
padding-top: 7px;
font-size: 20px;
}
.mr-10 {
margin-right: 10px;
}
<div class="panel panel-success panel-br-4">
<div class="panel-heading clearfix">
<h4 class="panel-title pull-left">
<i class="fa fa-file-text" aria-hidden="true"></i> <span>Documents</span>
</h4>
<a id="document-сreate-btn" class="btn btn-success pull-right">
<i class="fa fa-plus-circle"></i>
<span>Create new document</span>
</a>
<a class="btn btn-warning pull-right mr-10">
<i class="fa fa-chevron-circle-down" aria-hidden="true"></i>
</a>
<a class="btn btn-warning pull-right mr-10">
<span>Save new order</span>
</a>
</div>
<div class="panel-body">Some content</div>
</div>
When all items cannot fit in one line, I want to make header as in the next picture:
Is such things makes by flexbox or bootstrap grid system? Whats the better way? I will appreciate any examples! :)
This is just a quick example of how to use Bootstrap grid system. It's not gonna be as perfect as you want but it will give you an introduction to grid systems. Also, don't forget to read about media queries.
<div class="panel panel-success panel-br-4">
<div class="panel-heading">
<div class="row">
<div class="col-sm-6">
<h4 class="panel-title">
<i class="fa fa-file-text" aria-hidden="true"></i>
<span>Documents</span>
</h4>
</div>
<div class="col-sm-3" style="display: flex">
<a class="btn btn-warning mr-10">
<span>Save new order</span>
</a>
<a class="btn btn-warning">
<i class="fa fa-chevron-circle-down" aria-hidden="true"></i>
</a>
</div>
<div class="col-sm-3">
<a id="document-сreate-btn" class="btn btn-success mr-10" data-url="">
<i class="fa fa-plus-circle"></i>
<span>Create new document</span>
</a>
</div>
</div>
</div>
<div class="panel-body">Some content</div>

Keep aspect 4:3 ratio & scale video div on a chat app using bootstrap

I am playing around with WebRTC and I want to create a video chat. I am after a layout that looks something like this:
Using best of my knowledge, I've put together the following:
<div class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#"><i class="fa fa-commenting" aria-hidden="true"></i> My Chat App</a>
<button class="navbar-toggle" data-target="#navbar-main" data-toggle="collapse" type="button">
<span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span></button>
</div>
<div class="navbar-collapse collapse" id="navbar-main">
<ul class="nav navbar-nav">
<li>
<i class="fa fa-question-circle" aria-hidden="true"></i> Help
</li>
<li>
<i class="fa fa-info-circle" aria-hidden="true"></i> About
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<i class="fa fa-users" aria-hidden="true"></i> 1 Online
</li>
</ul>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-ld-4 col-md-4 col-sm-6">
<div class="panel panel-default">
<div class="panel-body pad5">
<div style="height: 320px; background-color: #000;">
</div>
</div>
<div class="panel-footer">
Them
</div>
</div>
<div class="panel panel-default">
<div class="panel-body pad5">
<div style="height: 320px; background-color: #000;">
</div>
</div>
<div class="panel-footer">
You
</div>
</div>
</div>
<div class="col-ld-8 col-md-8 col-sm-6">
<div class="panel panel-default">
<div class="panel-body">
<p><b>You</b>: Hello</p>
<p><b>Them</b>: Hi</p>
</div>
<div class="panel-footer custom-panel-footer pad5">
<div class="input-group">
<span class="input-group-addon" id="message-icon">
<i class="fa fa-commenting" aria-hidden="true"></i>
</span>
<input type="text" class="form-control" placeholder="Type your message here ..." aria-describedby="message-icon">
<span class="input-group-btn">
<button class="btn btn-primary" type="button">
<i class="fa fa-paper-plane" aria-hidden="true"></i> Send
</button>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
This does not render quite right, here's a preview:
How can I implement the layout like my sketch? I just want "My" and "Their" video div to keep the 4:3 aspect ratio and scale with available width.
When the window resizes, I want the whole layout to shrink whilst keeping the aspect ratio of the video divs. But on a larger monitor, if there's space, i want the video divs to scale up whilst maintaining the aspect ratio.
Any ideas?

HTML bootstrap separation line between divs

I am practicing with bootstrap and HTML. Please take a look at the picture where I've managed to build and display a return flight. Next thing that I would like to do in order to make it look nicer and more structured: introduce a separation line between flights (separate outgoing from return).
My problem is that I am not sure what to use in order to achieve such design feature in HTML using bootstrap. Should I introduce another row between flights and inject an image or just try to accomplish it by using borders?
Thanks for any help!
<div class="container well well-md searchResult">
<ul class="list-group">
<li class="list-group-item">
<div class="row">
<div class="col-md-10">
<div class="departFlyRow">
<div class="col-md-2 col-md-offset-2">
<div><b>06:20</b></div>
<div>LHR</div>
</div>
<div class="col-md-2">
<i class="btn btn-default"><i class="glyphicon glyphicon-plane gly-rotate-90"></i> </i>
</div>
<div class="col-md-2">
<div>5h 30</div>
<div>direct</div>
</div>
<div class="col-md-2">
<i class="btn btn-default"><i class="glyphicon glyphicon-plane gly-rotate-90"></i> </i>
</div>
<div class="col-md-2">
<div><b>12:50</b></div>
<div>SVO</div>
</div>
</div>
<div class="returnFlyRow">
<div class="col-md-2 col-md-offset-2">
<div><b>06:20</b></div>
<div>SVO</div>
</div>
<div class="col-md-2">
<i class="btn btn-default"><i class="glyphicon glyphicon-plane gly-rotate-90"></i> </i>
</div>
<div class="col-md-2">
<div>5h 30</div>
<div>direct</div>
</div>
<div class="col-md-2">
<i class="btn btn-default"><i class="glyphicon glyphicon-plane gly-rotate-90"></i> </i>
</div>
<div class="col-md-2">
<div><b>12:50</b></div>
<div>LHR</div>
</div>
</div>
</div>
<div class="col-md-2 selectButtonColumn">
<div><b>£100</b></div>
<button type="button" class="btn btn-success">Select</button>
</div>
</div>
</li>
</ul>
</div>
Add a <hr> between your returnFlyRow div's.
Also add the clearfix class to the returnFlyRow divs.
http://jsfiddle.net/m9nn9tvj/1/
I changed your col-md-2 to col-xs-2 to work better in jsfiddle.
You can try one of the following:
1.For the start flight, start the row with an icon of an airplane taking off, for the return flight, start the row with an icon of airplane descending.
2. Arrange start and return in columns.
3. Add a border between flights.
HTH.

Trying to line up text under Font Awesome icon

I'm currently using 2 Font Awesome icons. The problem is that I want to add text under each one that align with these icons. The problem is that the text is centered on the page but not under the corresponding icons.
Code:
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h1 class="brand-heading">Title</h1>
<p class="intro-text">description</p>
<a href="#about" class="btn btn-circle page-scroll btn-lg">
<i class="fa fa-angle-double-down animated"></i>
</a>
<a href="#contact" class="btn btn-circle page-scroll">
<i class="fa fa-angle-double-up animated"></i>
</a>
</div>
</div>About Contact
</div>
I think this is what you want to do. Here is the fiddle:
http://jsfiddle.net/plushyObject/02s7wnm8/
<div class="col-md-8 col-md-offset-2 text-center outline">
<h1 class="brand-heading">Title</h1>
<p class="intro-text">description</p>
<div class="col-sm-4 outline">
<a href="#about" class="btn btn-circle page-scroll btn-lg outline">
<i class="fa fa-angle-double-down fa-fw"></i>
</a>
<p class="outline">
Text is centered by 'text-center' class inherited from first
column.
</p>
</div>
</div>
If you text-align the parent element, it will be inherited by the picture.
CSS
.container {
text-align: center;
}
Line it up using an HTML <table>, and style it with CSS. That way it will stay on top of the icons correctly.
http://jsfiddle.net/vd6smL75/

Adding menu in a circular Position using Html

Hello i am trying to do something like this http://imgur.com/Ilu7ZM5 but instead of icons i am trying to place icons
my current html code is
<div>
<center>
<a href="#">
<button class="btn btn-success btn-lg">a</button></a>
</center>
<left><img src="img/arrow.png" alt="" width="250px" height="150px"/></left>
<br>
<br>
<left>
<button class="btn btn-warning btn-lg"><center>b</center></button>
</left>
<button class="btn btn-danger btn-lg">1</button>
<br>
<br>
<br>
<br>
<center> <button class="btn btn-success btn-lg">2</button><br><br></center>
</div>
how do i achieve that ?
Here you go. Demo includes a version with icons and a version with text. See the demo link for full code as there is an animation to the menus not seen in the screenshot below. If you'd like to use these, feel free to fork it..
Icons
<div class="wrap">
<div class="circle">
<i class="icon i1 icon-flag"></i>
<i class="icon i2 icon-heart"></i>
<i class="icon i3 icon-code"></i>
<i class="icon i4 icon-coffee"></i>
<div class="line1"></div>
<div class="line2"></div>
<span class="text">Menu</span>
</div>
</div>
Text
<div class="wrap2">
<div class="circle">
<i class="icon i1">A</i>
<i class="icon i2">B</i>
<i class="icon i3">C</i>
<i class="icon i4">D</i>
<div class="line1"></div>
<div class="line2"></div>
<span class="text">Menu</span>
</div>
</div>
See link for the full CSS code for both versions.. didn't post here because it's quite a bit.