Hey all! As you know, the code formats on this site are different than our last one. We are very much figuring it out together right now! We don’t currently have a guide up, but that will be one of the things we work on as we’re able to.
In the meantime, please do feel free to check out this thread here: Things That Work So Far. That’s what we’re all contributing to right now, and you might find something helpful in there, even if it isn’t as tidy as the old div guide.
I would also like to say that everyone is more than welcome to ask for help. If you’re on Discord, there are code help channels in both RPF Discord and Sandbox Discord. If you’re not on discord or would rather post to a thread (sometimes it’s easier for people to work things out if they have something to start with), feel free to use this thread here!
You can do anything from the simplest “how do I make my text blue” to super complex questions. We might not be able to answer the more complex things, but we’ll all pitch in as a community to try to figure out something that works.
Flex makes the things go boi-oi-oi-oing on the screen! They smoosh to fit.
So!
start with:
attr="style", "display:flex;"
You can also use "display:inline-flex" and "display:block-flex" They do some pretty neat weird stuff? Play with them!
next: flex-direction
row or column. Basically, are you going over or are you going down?
next, wrapping: flex-wrap: no-wrap does nothing flex-wrap:wrap if it gets too smooshy, moves the second part below the first part flex-wrap:wrap-reverse if it gets too smooshy, put it in a column in reverse order whooooaaaa cool
next, justify-content center, flex-start, flex-end, space-around, or space-between! None of them work so it doesn't matter! Pick one and yeet it out there.
next, gap if you want a gap between your elements, set it using gap:45px or something
Cool, that probably sets it up. New div.
attr="style",flex-grow:1
or 2 or 3. This determines how fast each part grows with respect to the other parts.
then I like to do a min-width:42px means it gets no smaller than this before it wraps, setting a min-width is what makes your wrap work otherwise it just smooshies
you can also do a straight up width: in pixels or percents - I like to use a percentage here and pixels for the min-width, but you do you
you can also set a max-width:69px so it doesn't get bigger than that
Close ya div.
Next element, attr="style",flex-grow:1
this again with all the stuff thrown in.
You can stick divs in there, too.
Edit: Flex does not play well with code or noparse tags.
Oh also a Thing I have discovered: In flexbox, gap just straight up doesn’t work on my tablet, even though it works perfectly on my desktop. It’s probably a browser-specific thing. You can work around it by using like... margin-left and margin-right between elements if you want to, but then it doesn’t look quite as tidy when it wraps, so you have to choose which is more important in that particular div.