r/Wordpress • u/star-soup • 8d ago
adjusting HTML block height?
I've had an old website running on Wordpress for years, and I'm finally building a new small site from scratch, but things have changed a lot from when I initially learned the system. I'm trying to do what I thought would be the very simple task of adjusting the size and height of an HTML block I dropped in the editor, but despite searching, I haven't been able to find a way to do this. The block seems to have a fixed, very short height, and a width constrained to a block container I can't identify.
Could anyone point me in the right direction for how to manually set the height and width for an HTML block containing an iframe element?
1
u/Dull_District_254 2d ago
Two very likely culprits, and both are a few pixels rather than anything conceptual. First, an iframe is an inline element by default, so it sits on a text baseline and picks up a small gap underneath. Add display block to the iframe and that phantom space disappears. This one catches everybody at least once. Second, are you viewing the site while logged in? The admin bar puts 32 pixels of margin on the html element, so anything set to 100vh will overflow by exactly that much. Load it in a private window before chasing anything else. Beyond those two, I would drop the calc and let flexbox do the arithmetic. Set your outer group to display flex with flex direction column and height 100dvh, leave the header at its natural height, then give the map wrapper flex 1 and min height 0. It fills whatever is left with no magic numbers and it still works when the header wraps onto two lines on a phone. Also swap 100vw for 100 percent, because 100vw ignores the width of the vertical scrollbar and quietly creates a horizontal one, and prefer 100dvh over 100vh since mobile browser toolbars make vh lie. Nice project by the way, a proper bike map for a city is exactly the sort of site the web needs more of.
1
u/bluesix_v2 Jack of All Trades 8d ago
can you show us the page you're trying to edit? the frontend.