[personal profile] pixellated posting in [community profile] style_system
hi! here's what i'm trying to achieve: i want my journal's main page to display one entry (the most recent one), and i want that entry to be vertically centered, so that the distance from the top of the entry to the navstrip is the same as the distance from the bottom of the entry to the bottom of the page. here is a quick mockup of what i have in mind:


click here for fullsize

i've tried using margin: auto for this, but it didn't work; googling around leads me to believe that that's because the entry container is an inline element and thus doesn't have a specified height, which you need for that to work. i thought about using a flexbox inside the entry with three elements arranged in a column, with the middle element holding the actual contents of the entry and the top and bottom elements growing/shrinking to provide padding, to achieve something visually similar, but i don't think that would work either for the same reason (no specified height).

is there any way to do this? the theme i'm currently using is blanket, but i'm not married to it, so if there is a different theme that allows me to do this, i will happily switch.

thank you!

Date: 2025-07-05 04:05 am (UTC)
momijizukamori: (🍥)
From: [personal profile] momijizukamori

Vertical centering is such a pain in the ass in CSS unfortunately - I will poke tomorrow and see if I can pull any of the old tricks out of my brain, but I wanted to compliment you on your amazing icon before I forgot ;)

Date: 2025-07-06 09:28 pm (UTC)
baisemain: (Default)
From: [personal profile] baisemain
Looks like you're trying to do a splash page? The way I've handled it is to have a stickied entry with the following code:

and then in the CSS I have this:


Is that enough to get you started?

Date: 2025-07-06 10:39 pm (UTC)
baisemain: (Default)
From: [personal profile] baisemain
Okay, my suggestion would be to add a padding-top:48px; (or whatever the height of your navstrip is) to .page-recent .splash to make room for the navstrip? It's not perfect because the navstrip is usually taller than that on mobile, but it's closer to what you want.

Date: 2025-07-07 06:43 pm (UTC)
baisemain: (Default)
From: [personal profile] baisemain
I wonder if you could do this with flexboxes...? Let me think on this and I'll get back to you. Are you still using the Blanket layout?

Okay, here's my other incredibly hacky solution:

I believe this would be compatible with any layout you picked, but lmk if there's issues. I have a ton of display:none; in there to hide elements except for the contents of your very first entry.
Edited Date: 2025-07-07 07:36 pm (UTC)

Profile

Dreamwidth style system discussion

July 2025

S M T W T F S
  123 45
6789101112
13141516171819
20212223242526
2728293031  

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 16th, 2025 06:22 am
Powered by Dreamwidth Studios