-
Hello. Back in my previous post here, I asked how I could get two listings to display side-by-side. I got a helpful solution which produced what I was aiming for. ::::: {.columns}
:::: {.column width="45%"}
## Lab Reports
:::{#lab-reports}
:::
::::
:::: {.column width="45%"}
## Meeting Notes
:::{#meeting-notes}
:::
::::
::::: However, when I resize my window so that it becomes more narrow, the listings become too squished. I would like to make the two listings to come one after the other when the window becomes narrow, and display side-by-side when the window becomes wide. How can I go about doing that? I appreciate any input! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
To accomplish this, I think you'll have to layout the columns manually yourself. Here is a very simple proof of concept for this using CSS grid: ---
title: "blog"
listing:
- id: listing-1
contents: posts
sort: "date desc"
type: default
categories: false
sort-ui: false
filter-ui: false
- id: listing-2
contents: posts
sort: "date desc"
type: grid
categories: false
sort-ui: false
filter-ui: false
page-layout: full
title-block-banner: true
---
```{=html}
<style>
@media screen and (min-width: 1000px) {
.custom-columns {
display: grid;
grid-template-columns: 1fr 1fr;
border: solid red 1px;
}
}
.custom-columns > div {
border: solid green 1px;
}
@media screen and (max-width: 999px) {
.custom-columns {
display: grid;
grid-template-columns: 1fr;
border: solid purple 1px;
}
}
</style>
```
:::{.custom-columns}
:::{#listing-1}
:::
:::{#listing-2}
:::
:::
|
Beta Was this translation helpful? Give feedback.
-
Another solution would be to use Boostrap CSS (included in Quarto) to define your grid layout, especially using the responsive classes (https://getbootstrap.com/docs/5.2/layout/grid/#responsive-classes). |
Beta Was this translation helpful? Give feedback.
Another solution would be to use Boostrap CSS (included in Quarto) to define your grid layout, especially using the responsive classes (https://getbootstrap.com/docs/5.2/layout/grid/#responsive-classes).
See: https://getbootstrap.com/docs/5.2/layout/grid/ and https://getbootstrap.com/docs/5.2/layout/columns/
(I can't make an example right now)