Earlier quoted context omitted.
The answer to (a) (along with many other things) is to use Flexbox: .my-container { display: flex; justify-content: center; align-items: center; } This should work for (b) as long as the height isn't in terms of a percentage: .my-video { --my-video-height: 120px; height: var(--my-video-height); width: calc(var(--my-video-height) * 16/9); }
You can also use grid and the place-content shorthand! These things are getting better. CSS was a nightmare in the 2000s.
Hell Yes CSS
11–20 of 120 posts
Re: Hell Yes CSS
#12Re: Hell Yes CSS
#13paywalled article
Re: Hell Yes CSS
#14I paid $60 to a guy on Fiverr to do css for me just a few days ago. I should have been able to do it myself but after fooling with it for awhile I gave up.
Re: Hell Yes CSS
#15Re: Hell Yes CSS
#16Earlier quoted context omitted.
The answer to (a) (along with many other things) is to use Flexbox: .my-container { display: flex; justify-content: center; align-items: center; } This should work for (b) as long as the height isn't in terms of a percentage: .my-video { --my-video-height: 120px; height: var(--my-video-height); width: calc(var(--my-video-height) * 16/9); }
You can also use grid and the place-content shorthand! These things are getting better. CSS was a nightmare in the 2000s.
So for instance I would do the responsive page layout in grid, probably. Then I would do positioning the elements within a article or section with flexbox.
Re: Hell Yes CSS
#17Just a question as a non native speaker. Is the "hell yes" in the title considered slightly offensive? On par with "Damn LLVM" or something?
Anyone who would take offense at that is going to find something to be offended by in anything ediger than Mr. Roger's Neighborhood.
Re: Hell Yes CSS
#18Just a question as a non native speaker. Is the "hell yes" in the title considered slightly offensive? On par with "Damn LLVM" or something?
Re: Hell Yes CSS
#19Earlier quoted context omitted.
You can also use grid and the place-content shorthand! These things are getting better. CSS was a nightmare in the 2000s.
Even I'll admit that Grid is complicated. It serves a valid use-case, but it's honestly a very rare one in my experience and the learning curve is steep
Re: Hell Yes CSS
#20Just a question as a non native speaker. Is the "hell yes" in the title considered slightly offensive? On par with "Damn LLVM" or something?