Welcome to Code Forum!

Join a community that supports you and your coding journey from day one. We strive to be a friendly, supportive community that empowers everyone to be better developers. By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.

    GIF shows where to locate </> in the thread and or post editor toolbar.
    To learn more about how to use our BBCode feature, review our "How to post your code into threads" here.

    Thank you, Code Forum.

Theoretical layout discussion

tomliv

Gold Coder
Hello,

I come across this frequently, and am wondering how others would solve for this.

I get designs that appear to need 2 different structures between breakpoints. I can think of one way to solve this but is there another, better way.

CleanShot 2024-07-15 at 09.27.33@2x.png

I realize this is exceedingly simplified, but picture on mobile A=A couple paragraphs, B=A long form (8-10 fields) and C=A call to action or other brief info.

On desktop, C is flush to the bottom of the form that is in the right column - and that's the tricky issue here. Initially I am thinking, 'oh, floats, go old-school on it' but then I see that C is flush to the bottom of B on desktop - and it's all responsive, so the column depths are going to change at different viewport widths due to copy wrapping and getting deeper.

The next option that comes to mind is duplicating C (using show/hide methods) and having 2 structures - using flex on desktop for the flush bottom needs - but duping content feels icky to me.

What are your thoughts? Am I missing something obvious? I tend to do that...
 
To be clear, I'm not asking for anyone to code this. I am asking how you think you might go about coding this layout. Structure and CSS method - Grid, flex, floats etc.
 
Just in case someone comes across this, I was able to achieve this layout using CSS Grid and 'C' was aligned to the bottom of 'B B B' with align-self:self-end; on desktop.
 
Back
Top Bottom