What framework?
.center-the-stuff {
display: flex;
align-items: center;
justify-content: center;
} .parent {
position: relative;
}
.child {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}If I fire up a reasonable layout system (Xaml for example) which is completely foreign, it's trivial to do there.
I can't understand why html/CSS makes it so hard.
The only way around the poor performance of table layouts is to use table-layout: fixed, which then means you lose all responsive layout so you'd need to create a new version for every screen size you wanted to support (and implicitly, not be able to support every size of mobile screen since percentages don't play well with fixed layout. In this case, you haven't saved any time and in fact have created more work for yourself along with a worse version of your site since fewer people will be able to view it properly.
[1] http://www.stubbornella.org/content/2009/03/27/reflows-repai...
This is what I love about CSS flexbox and grid. Flexbox completely changed how I approach layouts, and I'm excited for grid to hit the big time as well.
The only thing I wish flexbox could do is allow custom spacing functions, so I could write my own alternative to "justify-content: space-around".
The link you shared above is a big upgrade.
Right-click inspect element selects the element you want to modify. Then change CSS properties in a GUI editor. Only problem is persistence.
I love designing and tweaking with devtools iteratively.
A lot of things are done in editors because it gives you a lot of control of logic. Designing assets in visual language like flash makes a lot of sense.
Unity has the same idea. Create your assets visually and assign behaviors to it via code. Their GUI/code fusion is pretty cool.
Writing a public var in a class exposes it in GUI and makes it bindable to other things via click and drag.
Keep an eye on "Houdini" -- a new browser API draft that exposes the internals of CSS's layout system (and much more): https://www.youtube.com/watch?v=sE3ttkP15f8
Since you need a programmer anyway, you might as well use a freeform design tool (Photoshop) to let the designer design whatever the hell he wants without the constraints that a more specialized app might impose. Then, let the programmer take that design and create whatever infrastructure he thinks is necessary without also constraining him to whatever a specialized app might impose.
I've been doing both design and programming a bit lately and I absolutely love apps like Subform, Webflow and Apple's interface builder. But, once I get past the fast iteration mockup phase, the structure of the app or webapp I'm making changes enough that the tools become unwieldy.
What I would really like are more robust layout APIs for both the browser and native apps. In Subform, you can define relative widths and positions both to other components and to the window itself. It's great for taking some of the tediousness out of design, but from a programming perspective, centering an object horizontally and vertically consistently is still a surprisingly difficult endeavor.