I am trying to create a bracket for a sports tournament in HTML and CSS (using JS later to be able to interact with it).
So far my concept is to use containers with only the top, bottom, and right-side borders to create this effect. I apologize for the crudeness, but something like this (the solid lines are solid borders and the dashed lines are borders that are not present). However, I am not able to find how to align the containers with each other the way I want.
How do you align containers by their borders and midlines? (align the top border of one div container in-line with the horizontal midline of another container)
So far I have asked lady Google a bunch, poked around Stack Overflow, and read MDN resources, but I cannot find anything that fits with my problem.
The next thing I am going to try is using a bunch of containers to get the positions I want by stacking them to fit, but I feel like that is going to get messy quickly, so I figured I would see if there are any better solutions out there.
Any nudge in the right direction/similar post or online resource/advice/fix would be greatly appreciated 🙂
2
Answers
you can use postion top right left etc and margin also to align divs where u want
I come up with something like this! Hope this helps. It will auto adjust depending on the items in columns. I also added placeholders where the team names probably will be