I'm creating a real estate with boostrap ccs and i'm trying organized my ads. However i can't find the way to make them all to the same size. i want for each line 3 ads. In this search only found 5 ads.
the next image is what i have using:
div class="row row-cols-1 row-cols-sm-2 row-cols-md-3 g-5"
My situation
And what i'm looking for is:
The future
thanks for helping me
<div class="row">
<div class="col-4">
<!-- Add advert item here -->
</div>
<div class="col-4">
<!-- Add advert item here -->
</div>
<div class="col-4">
<!-- Add advert item here -->
</div>
</div>
<div class="row">
<div class="col-4">
<!-- Add advert item here -->
</div>
<div class="col-4">
<!-- Add advert item here -->
</div>
</div>
Also you will need to adjust for media queries for smaller screens.
Related
I am building a site using Flask and Bootstrap and I have long lists of objects that I want to display on the page. I have a 6 column layout and I want the list spill over one column to the next. I know I can do this on the python side but I am wondering if there is a way that bootstrap or CSS can handle it?
UPDATE: better explanation --> I want a long list of names to be divided up in to six equal(ish) columns. I can divide the list on the backend but was hoping there is a way to do this on the front end.
UPDATE UPDATE: Duh! here is what I was looking for ...
'''Jinja
<div class="container">
<div class="row">
<div class="col-2">
<!--I want this part to flow over all 6 columns-->
{% for name in names %}
{{name.firstname}} {{name.lastname}} <br>
{% endfor %}
</div>
</div>
</div>
''''
Because the columns automatically wrap after 12 columns I don't need to code each column. That's what I was missing. Thank you everyone!
To make 6 even columns, you can create a single container, a single row then an element for each item in your list with the class "col-2" (these could be divs, links, list items, etc). Bootstrap will automatically make each element 1/6 of the screen wide. And even though you only have one "row" div, Bootstrap will make all of your elements flow into as many rows as needed.
The code below will give you 2 rows of 6 columns.
<div class="container-fluid">
<div class="row">
<div class="col-2">Element 1</div>
<div class="col-2">Element 2</div>
<div class="col-2">Element 3</div>
<div class="col-2">Element 4</div>
<div class="col-2">Element 5</div>
<div class="col-2">Element 6</div>
<div class="col-2">Element 7</div>
<div class="col-2">Element 8</div>
<div class="col-2">Element 9</div>
<div class="col-2">Element 10</div>
<div class="col-2">Element 11</div>
<div class="col-2">Element 12</div>
</div>
</div>
I think you can achieve what you want with simple bootstrap grid system.
<div class="row">
<div class="col-2"></div>
<div class="col-2"></div>
...
...
<div class="col-2"></div>
</div>
here is what I was looking for
'''Jinja
<div class="container">
<div class="row">
<div class="col-2">
<!--I want this part to flow over all 6 columns-->
{% for name in names %}
{{name.firstname}} {{name.lastname}} <br>
{% endfor %}
</div>
</div>
</div>
''''
I don't need to code each column separately! The for loop puts each item in a 2 column wide column that automatically wraps after 12 total columns. That's what I was missing. Thank you everyone!
Using OOTB SXA, I am trying to render selected items from Multilist with Search.
The data renders, but with everything nested in a single <li> broken into <div>'s
Among other things, I've tried using and Item Query (re: https://ggullentops.blogspot.com/2017/04/sitecore-sxa-pagelist-item-query.html), but didn't have any success.
Q: What is the correct way to render my items as individual <li>'s?
Current Results displayed:
<main>
<div id="content" class="container">
<div class="component page-list col-12">
<div class="component-content">
<ul class="items">
<li class="item">
<div class="field-first-name">Stephen</div>
<div class="field-last-name">King</div>
<div class="field-first-name">Gregory</div>
<div class="field-last-name">Mertens</div>
<div class="field-first-name">Penny</div>
<div class="field-last-name">Mertens</div>
</li>
</ul>
</div>
</div>
</div>
</main>
Multi Select List Data Source:
List Item:
Control Properties:
Rendering Variant
I'm trying to achieve something in Foundation 6 and I can't figure it out. Here's a graphic illustrating my issue.
Graphic of what I'm trying to do
I do! Sorry about that :)
<!-- Signup / Login / FAQ / Social -->
<div class="row">
<!-- Left Side -->
<div class="large-4 medium-4 columns Rem1MarginBottom hide-for-small-only">
<!-- Have a friend-->
<h4 class="georgiaNormal">Text Column</h4>
</div>
<div class="large-2 medium-2 columns" style="border: 1px solid;">
<h4 class="georgiaBold">Link 1</h4>
</div>
<div class="large-2 medium-2 columns" style="border: 1px solid;">
<h4 class="georgiaBold">Link 2</h4>
</div>
<!-- Left Side -->
<!-- Right Side -->
<div class="large-4 medium-4 columns">
<div class="row" style="border: 1px solid;">
<div class="large-12 medium-12 columns hide-for-small-only">
<h4 class="georgiaBoldSmall centeredRed trouble">Text</h4>
</div>
<div class="large-12 medium-12 columns hide-for-small-only">
<h4 class="georgiaNormalSmall centeredRed faq_contact">Text Link page or Link.
</h4>
</div>
<div class="large-12 medium-12 small-12 columns Rem1MarginTop text-center Rem1MarginBottom">
<img src="https://picturethismaths.files.wordpress.com/2016/03/fig6bigforblog.png" width="50" alt="#" /> <img src="https://picturethismaths.files.wordpress.com/2016/03/fig6bigforblog.png" width="50" alt="#" />
</div>
</div>
</div>
<!-- Right Side -->
</div>
Thanks for adding the code.
What you have is four columns, but what you really want is three columns and for some content to stack in the middle column.
Try doing this to the left side give this a try:
<!-- Signup / Login / FAQ / Social -->
<div class="row">
<!-- Left Side -->
<div class="large-6 medium-6 columns Rem1MarginBottom hide-for-small-only">
<!-- Have a friend-->
<h4 class="georgiaNormal">Text Column</h4>
</div>
<div class="large-2 medium-2 columns" style="border: 1px solid;">
<div><!-- this div should stack now -->
<h4 class="georgiaBold">Link 1</h4>
</div>
<div><!-- this div will be below the other link -->
<h4 class="georgiaBold">Link 2</h4>
</div>
</div>
<!-- Left Side -->
<!-- Right Side -->
...
<!-- Right Side -->
</div>
I changed the first column to be '6' wide and removed what you did have as the third column (the one that contained your second link).
So now the middle column contains two divs and they will stack on top of each other. You may need to add some custom css to get the design you're after, but at least now you have the correct structure.
As I know large-12 class only show stuff on large screen. If I decrease the size like on mobile it won't show anything unless I assign another class small-12
Now I've this code and it's showing large-12 in mobile as well and small-12 on large screen as well.
<div class="row">
<div class="large-12 columns">
<div class="panel">
<img src="design/images/nationalskills_logo.png" />
<img src="design/images/toyota_logo.png" style="float: right;"/>
</div>
</div>
<div class="small-6 columns">
<div class="panel">
<img style="width: 30%;" src="design/images/nationalskills_logo.png" />
<img style="width: 30%;" src="design/images/toyota_logo.png" style="float: right;"/>
</div>
</div>
</div>
Can anyone please help me out.
I want to show larger-12 div on big screens and small-6 only on small screen not on big screen. What is wrong with my code.
12 class only show stuff on large screen. If I decrease the size like on mobile it won't show anything unless I assign another class small-12"
This assumption is totally wrong just see the doc http://foundation.zurb.com/docs/components/grid.html
For image resizing use interchange option.
http://foundation.zurb.com/docs/components/interchange.html
You can use different size classes for coloumns in one single div which hides other class definitions based on size..
<div class="row">
<div class="small-6 large-6 columns">
<div class="panel">
<img data-interchange="[/path/to/default.jpg, (default)], [/path/to/bigger-image.jpg, (large)]" />
<img class="right" data-interchange="[/path/to/default.jpg, (default)], [/path/to/bigger-image.jpg, (large)]" />
</div>
</div>
</div>
With Zurb foundation version 3, if I include the foundation.css file
I'm able to make grids, etc.
With version 4, if I do everything the same way, it does not work.
What am I missing?
If I do everything the same way
There are new classes to use for grids in V4. You cannot just say four columns but instead specify if the columns are for a large or small view/device. So you need to have small-X or large-X where X is the number of columns a div needs to consume. Here's an example:
<div class="row">
<div class="ten columns centered">
<h1>This grid won't work on V4</h1>
<div class="row">
<div class="four columns">
<div class="panel">
<p>Left panel</p>
</div>
</div>
<div class="four columns">
<div class="panel">
<p>Center panel</p>
</div>
</div>
<div class="four columns">
<div class="panel">
<p>Right panel</p>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="ten columns centered">
<h1>But this will...</h1>
<div class="row">
<div class="small-2 large-4 columns">
<div class="panel">
<p>Left panel</p>
</div>
</div>
<div class="small-4 large-4 columns">
<div class="panel">
<p>Center panel</p>
</div>
</div>
<div class="small-6 large-4 columns">
<div class="panel">
<p>Right panel</p>
</div>
</div>
</div>
</div>
</div>
Notice the combination of small and large on a single div. What it tells you is that the Left panel will only be two columns on small devices (mobile phones) and four columns on large devices such as on a desktop. Similarly, the Right panel will be six columns on small devices and four columns on large devices. You can see the difference by playing with the size of your browser.
To get more information on how the V4 Grid works, go to this page.