King@sh.itjust.works to Programmer Humor@programming.devEnglish · edit-25 days agoCentering a Divi.ibb.coimagemessage-square61linkfedilinkarrow-up1297arrow-down112file-text
arrow-up1285arrow-down1imageCentering a Divi.ibb.coKing@sh.itjust.works to Programmer Humor@programming.devEnglish · edit-25 days agomessage-square61linkfedilinkfile-text
minus-squarecbazero@programming.devlinkfedilinkarrow-up24arrow-down5·4 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-up4·3 days agoYou literally just have to give it a width and add margin: 0 auto;
minus-squarehumorlessrepost@lemmy.worldlinkfedilinkEnglisharrow-up3·edit-22 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-up2·edit-23 days agoOr use Flexbox But your solution works as well for simple cases
minus-squareirelephant [he/him]@programming.devlinkfedilinkarrow-up1·1 day agoI generally avoid flex for simple stuff (i like weird browsers), but for more complex layouts it should certainly be used.
minus-squareTrickDacy@lemmy.worldlinkfedilinkarrow-up9·4 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
I generally avoid flex for simple stuff (i like weird browsers), but for more complex layouts it should certainly be used.
What it says is zero knowledge on the part of the whiner.