How can i create view using bootstrap in mvc - asp.net-mvc

I am new to bootstrap, how can i create view shown in image.a corosel has number of boxes[enter image

Use this template for get the image. You can edit it on top of this structure.
<div class="container">
<div class="row row-cols-5">
<div class="col p-5">Column</div>
<div class="col p-5">Column</div>
<div class="col p-5">Column</div>
<div class="col p-5">Column</div>
<div class="col p-5">Column</div>
<div class="col p-5">Column</div>
<div class="col p-5">Column</div>
<div class="col p-5">Column</div>
<div class="col p-5">Column</div>
<div class="col p-5">Column</div>
</div>
</div>

Related

Bootstrap stack 2 columns vertically

I've read the documentation for hours and checked all demos and also searched SO but I can't figure out how to achieve the below layout:
This is what I've done and the output result looks like what I need but I'm not sure it is the correct way or not:
<div class="container">
<div class="row">
<div class="w-75 rounded bg-dark">
<p>
This is a sample
</p>
</div>
<div class="w-25">
<div class="col rounded bg-dark">
<p>
This is a sample
</p>
</div>
<div class="col rounded bg-dark">
<p>
This is a sample
</p>
</div>
</div>
</div>
</div>
The output is here: https://jsfiddle.net/ezt5fyL1/
The correct way is to nest the grid...
<div class="container">
<div class="row">
<div class="col-9 rounded bg-dark">
<p> This is a sample </p>
</div>
<div class="col-3">
<div class="row gy-1 gx-1">
<div class="col-12 rounded bg-dark">
<p> This is a sample </p>
</div>
<div class="col-12 rounded bg-dark">
<p> This is a sample </p>
</div>
</div>
</div>
</div>
</div>
codeply

How to arrange partials in parent view using bootstrap in MVC4?

I have 4 partials and want to put these partials in the parent view. Currently, I am using a container to put all the partials together but I want to display the partials in the given order which I have shown in the code.
<div class="col-md-7">
<div class="panel panel-default">
<div class="panel-heading">
ABC
</div>
<div class="panel-body">
</div>
<div id="container">
#{ Html.RenderPartial("_PartialABC", Model); }//Currently I am displaying all the partials here
// Want to display _PartialA here
</div>
</div>
</div>
<div class="col-md-5">
<div class="panel panel-default">
<div class="panel-heading">
// Want to display _PartialB here
</div>
<div class="panel-body">
// Want to display _PartialC here
// Want to display _PartialD here
</div>
</div>
_Partials
#model Aplication.Models.ABC.ClsA
<div id="myA">
#{ Html.RenderPartial("_PartialA", Model.firsts); }
</div>
<div id="myB">
#{ Html.RenderPartial("_PartialB", Model.seconds);}
</div>
<div id="myC">
#{ Html.RenderPartial("_PartialC", Model.thirds);}
</div>
<div id="myD">
#{ Html.RenderPartial("_PartialD", Model.fourths);}
</div>

Can Bootstrap panel be reordered in different sequence when seen in mobile?

I want to display the panel in the same way when displays in desktop view but want to change the sequence when seen in mobile.In mobile view, the first panel First Name and the last panel Last Name should be seen one after another. I googled it but could not found the solution. Please help me.
<div class="container active col-md-4 col-sm-6">
<div class="panel panel-default">
<div class="panel-heading">First Name</div>
</div>
</div>
<div class="container active col-md-4 col-sm-6">
<div class="panel panel-default">
<div class="panel-heading">Address</div>
</div>
</div>
<div class="container active col-md-4 col-sm-6">
<div class="panel panel-default">
<div class="panel-heading">Company</div>
</div>
</div>
<div class="container active col-md-4 col-sm-6">
<div class="panel panel-default">
<div class="panel-heading">Last Name</div>
</div>
</div>
Yes, this is done with Bootstrap's order classes.
Bootstrap 4.0+
You can use order-1 through order-12 and the col's will be ordered from 1-12. To set responsive break points in this you can use them like order-sm-6 and order-sm-7.
In your code, to move the lastName to the second slot you would reorder them and set the order custom for the breakpoint and higher like so:
<div class="container active col-md-4 col-sm-6 order-md-1">
<div class="panel panel-default">
<div class="panel-heading">First Name</div>
</div>
</div>
<div class="container active col-md-4 col-sm-6 order-md-4">
<div class="panel panel-default">
<div class="panel-heading">Last Name</div>
</div>
</div>
<div class="container active col-md-4 col-sm-6 order-md-2">
<div class="panel panel-default">
<div class="panel-heading">Address</div>
</div>
</div>
<div class="container active col-md-4 col-sm-6 order-md-3">
<div class="panel panel-default">
<div class="panel-heading">Company</div>
</div>
</div>
Putting them in the current order you have on md and up.
https://getbootstrap.com/docs/4.0/layout/grid/#order-classes Has more information.
Bootstrap 3
Ordering is done with push/pull.
So col-md-push-3 would push the column over 3/12 if it could snap. An example below being the columns are rendered in code order below md, but are reversed md and above:
<div class="row">
<div class="col-md-9 col-md-push-3">.col-md-9 .col-md-push-3</div>
<div class="col-md-3 col-md-pull-9">.col-md-3 .col-md-pull-9</div>
</div>
In this case (pushing last name back to the end for md and up):
<div class="container active col-md-4 col-sm-6">
<div class="panel panel-default">
<div class="panel-heading">First Name</div>
</div>
</div>
<div class="container active col-md-4 col-sm-6 col-md-push-8">
<div class="panel panel-default">
<div class="panel-heading">Last Name</div>
</div>
</div>
<div class="container active col-md-4 col-sm-6">
<div class="panel panel-default">
<div class="panel-heading">Address</div>
</div>
</div>
<div class="container active col-md-4 col-sm-6">
<div class="panel panel-default">
<div class="panel-heading">Company</div>
</div>
</div>

Bootstrap columns not aligned properly

Currently I am making a twitter clone using RubyOnRails and bootstrap as the framework. When trying to distribute some text in a post panel using the "col-sm" div class, the text seems jammed together on the left,
as seen here.
Here is my code:
<div class="row">
<div class="col-xs-3">
<div class="panel panel-default">
<div class="panel-body">
<p>status</p>
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
<p>trend</p>
</div>
</div>
</div>
<div class="col-xs-6">
<%= render '/components/post_form' %><br></br>
<% for #p in #posts %>
<div class="panel panel-default post-panel">
<div class="panel-body">
<div class="col-sm-1">
AVATAR
</div>
<div class="col-sm-11">
<p><%= #p.content %></p>
</div>
<div class="col-sm-12">
LINKS
</div>
</div>
</div>
<% end %>
</div>
<div class="col-xs-3">
<div class="panel panel-default">
<div class="panel-body">
<p>about</p>
</div>
</div>
</div>
</div>
I am using the latest bootstrap sass version 3.3.6 which is included in the gemfile. Is there something wrong with the code or does the latest version of bootstrap mean I need to do something different?
Look at this section:
<div class="col-sm-1">
AVATAR
</div>
<div class="col-sm-11">
<p><%= #p.content %></p>
</div>
<div class="col-sm-12">
LINKS
</div>
The first issue is the text "AVATAR" is wider than 1 bootstrap column, so it's extending out of your container. using col-sm-2/col-sm-10 may fix the issue.
Second, column sizes should add up to 12 columns per row. Here you have a col-sm-1, col-sm-11, and col-sm-12 all in the same row.

i need help getting ratchet push.js fade transition to work?

this is a basic example calling "two.html", with the fade transition
<div class="content">
<div class="medium-6 columns text-center top">
POSPAId
</div>
</div>
and this is two.html
<div class="content">
<div class="medium-6 columns text-center top">
<a href="index.html" data-transition="slide-out">
back
</a>
</div>
</div>

Resources