King@sh.itjust.works to Programmer Humor@programming.devEnglish · 7 days agoCentering a Divi.ibb.coimagemessage-square59linkfedilinkarrow-up11arrow-down10file-text
arrow-up11arrow-down1imageCentering a Divi.ibb.coKing@sh.itjust.works to Programmer Humor@programming.devEnglish · 7 days agomessage-square59linkfedilinkfile-text
minus-squarecbazero@programming.devlinkfedilinkarrow-up0·7 days agoIf you need to be good at a layout language to center something, then maybe the layout language sucks.
minus-squareirelephant [he/him]@programming.devlinkfedilinkarrow-up0·6 days agoYou literally just have to give it a width and add margin: 0 auto;
minus-squarehumorlessrepost@lemmy.worldlinkfedilinkEnglisharrow-up0·4 days agoI think it’s implied they’re talking about centering both horizontally and vertically. And probably with unknown height. Still easy these days , though.
minus-square𝕱𝖎𝖗𝖊𝖜𝖎𝖙𝖈𝖍@lemmy.worldlinkfedilinkarrow-up0·edit-25 days agoOr use Flexbox But your solution works as well for simple cases
minus-squareTrickDacy@lemmy.worldlinkfedilinkarrow-up0·7 days agoWhat it says is zero knowledge on the part of the whiner.
If you need to be good at a layout language to center something, then maybe the layout language sucks.
You literally just have to give it a width and add
margin: 0 auto;I think it’s implied they’re talking about centering both horizontally and vertically. And probably with unknown height.
Still easy these days , though.
Or use Flexbox
But your solution works as well for simple cases
What it says is zero knowledge on the part of the whiner.