to keep max width at 780px. Out of curiosity when I remove width: 100% in the above rule the output box becomes narrower. When I hover over <main class="archive"> in dev tools, the width of the content box is showing as 538.05 - rest is the space taken by left and right auto margins.
I did it before and the page shrinks and gets narrower as the calculated width is no longer 780px. I guess my questions if its possible to keep archive page at max-width 780px without resorting to width 100%
Yes. However why max-width 780 works on .blog, .blog-single without width: 100%
I am trying to achieve something similar to https://snook.ca/archives/ for my archive page
Did you not understand that it’s only because you have enough content that the text is wrapping? Go to your archive page and leave 1 word of text. I gave you the hint in my first reply (Post #2) .
Thanks @RyanReese I understand - no way to keep it at 780 without width 100%. On blog and single view pages its just the amount of content that pushes the element width to 780 max and then text just wraps…
What would be the proper way to control what happens to post title and post date at different screen sizes? Say I was thinking of adding .archive > div { flex-flow: row wrap; } to preceding media query (max-width: 420px) however because post titles would vary in length that doesn’t seem like a good solution because on some posts with shorter titles date wouldn’t wrap
Hi,
Rather than changing to flex-flow: row wrap; you can just reset the div to display:block from flex and let them all stack as blocks regardless of title lengths.
The children will no longer be flex items and they will follow their default rules.
Your date is in a div so it stacks below the anchor (post title) as a block.
@media all and (max-width: 500px) {
.archive > div {
display: block;
}
}