how is this form can be between two divs

I don’t know how to achieve this particular space diva
No description
36 Replies
Jochem
Jochem5d ago
easiest is to use linear-gradient for the background if you set the endpoint of the first color to (almost) the same point as the start of the second one, you get that kind of line
roger
roger5d ago
Edit fiddle - JSFiddle - Code Playground
JSFiddle - Test your JavaScript, CSS, HTML or CoffeeScript online with JSFiddle.
roger
roger5d ago
Sorry if I asked the wrong question I want the form to be between them two divs but the problem is the green div doesn’t stay with the same space when I move form the space will also gone
Jochem
Jochem5d ago
if you change your background on .experience-parallel to
background: linear-gradient(transparent 50%, #172640 50.1%), linear-gradient(90deg, #50b39f 0%, #088a70 100%);
background: linear-gradient(transparent 50%, #172640 50.1%), linear-gradient(90deg, #50b39f 0%, #088a70 100%);
you should be good you may want to teak the percentages a little, it looks more like 2/3rds rather than half, in your screenshot
snxxwyy
snxxwyy5d ago
i think he means how the form is overlapping both divs
Jochem
Jochem5d ago
I'm 99% sure it's not you fake it overlapping the other div by giving part of the div it is in, the background of the div below it it looks like it's overlapping the next div, but there's no reason to break the flow like that if you can just fake it. There's no difference in the user experience, and it's much, much less likely to break or cause weird issues when the content changes
snxxwyy
snxxwyy5d ago
you could also use grid
Jochem
Jochem5d ago
(I agree that's what he's asking btw, just saying that the form is very, very likely not to actually be in two divs)
snxxwyy
snxxwyy5d ago
yeah that's fair enough
Jochem
Jochem5d ago
and whatever you want to do to make it actually overlap another div, is much less accessible and maintainable, and a lot more work than just setting up the gradients like this.
snxxwyy
snxxwyy5d ago
i don't think grid would make it less accessible right? i've don't think i've heard that, but i may be wrong. you'd just have something like grid-template-rows: repeat(4, auto); and place the content in the corresponding rows and could probably set up a utility class for the overlapping for maintainability too. i may be wrong as i said though.
Jochem
Jochem5d ago
hmm, maybe not less accessible but still much more complicated you'd have to layer two elements into the same grid cell, and that's just entirely unnecessary
roger
roger5d ago
When I overlap form I don’t get the empty spaces I want to achieve in the particular div I.e upper div
Jochem
Jochem5d ago
I don't know what you mean
snxxwyy
snxxwyy5d ago
i think they mean this
No description
Jochem
Jochem5d ago
That's literally what this does though?
snxxwyy
snxxwyy5d ago
perhaps it's not too clear
Jochem
Jochem5d ago
the border is just there to show where the div boundaries are
roger
roger5d ago
Yes exactly I appreciate you guys thank you I am trying to figure this out thanks for putting input @Jochem @snxxwyy
snxxwyy
snxxwyy5d ago
Actually I tried out the grid method I recommended and it doesn’t work as I thought, might make a post about that
b1mind
b1mind5d ago
You could do something like this though https://codepen.io/b1mind/pen/xxvgvmK
b1mind
b1mind5d ago
Grid for layers/stacking is ❤️ obviously you could play with things too* size/padding/margin different. 😄 🤔 looking at the op image though if I was to have content in it I would want the extra template rows
snxxwyy
snxxwyy5d ago
i had something like this but the issue i ran into was the overlap of content
b1mind
b1mind5d ago
https://codepen.io/b1mind/pen/xxvgvmK updated 😄 I'd probably use a combo of Jochems and this 🤔 I don't like just having blank divs for the bg.
b1mind
b1mind5d ago
Would be so nice if we could just color grid cells and tracks >.>;; oops I had two open... xD ok proper update cause right doing absolute will still overlap even though its assigned to be in the track 🤔 not in the same flow xD
clevermissfox
clevermissfox5d ago
I’ll often use pseudo elements for backgrounds in my grid and assign it a cell
b1mind
b1mind5d ago
oooo thats a great idea.. Though I had issues with grid/psuedos in the past, there is some jank around how they work in grid yea this crazy mess... https://codepen.io/b1mind/pen/JjpLKyO maybe I need to revisit 🤪
clevermissfox
clevermissfox5d ago
Agh really ?? What kind of jank have you run into ? PS I love that you use Pug!! It’s awesome
b1mind
b1mind5d ago
its so nice for pens too xD I should be using stylus too but 🤷‍♂️ grid tracks mainly, or combo of track and place ... I didn't leave myself notes 🤣 (this was long ago though could be a skill issue)
clevermissfox
clevermissfox5d ago
Sigh… grid tracks and rules . So annoying to try and make Why stylus over scss ?
roger
roger5d ago
This is kinda tricky I want it responsive too
MarkBoots
MarkBoots5d ago
interesting, never done that. You mean like so? https://codepen.io/MarkBoots/pen/zYgZGzG
clevermissfox
clevermissfox4d ago
Yes , although I tend to use named grid lines but yes the concept is the same!
Want results from more Discord servers?
Add your server