3 ms·
as mentioned in another comment this only works if you know the height. Your example is exactly the issue that the original comment was talking about. Your int
by ux-app 12y ago
as mentioned in another comment this only works if you know the height. Your example is exactly the issue that the original comment was talking about.
Your intention is to align both centers. Why do we need to be dealing with 'top' and 'margin-top' to achieve this? It is a poor way to describe your intention.
It's much easier to say:
box1.center == box2.center
The cassowary solver allows you to specify exactly your intentions in relation to the edges and centers of boxes. It's easier to reason about and doesn't require the bag of weird tricks that are needed in CSS (eg. margin: 0 auto; to center??? wtf?)